[Bug 1201114] New: mount fails after umount -R, then unplug/re-plug external drive
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 Bug ID: 1201114 Summary: mount fails after umount -R, then unplug/re-plug external drive Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: openSUSE Tumbleweed Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: screening-team-bugs@suse.de Reporter: genes1122@gmail.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Things appear normal initially: gene@Mobile-PC:~> sudo mount -v UUID=4c96a0c2-f72f-4827-b023-83ba000b2fd2 /mnt/chroot mount: /dev/sdb2 mounted on /mnt/chroot. gene@Mobile-PC:~> sudo mount -v --rbind /sys /mnt/chroot/sys mount: /sys bound on /mnt/chroot/sys. gene@Mobile-PC:~> sudo mount -v --make-rslave /mnt/chroot/sys mount: /mnt/chroot/sys propagation flags changed. gene@Mobile-PC:~> sudo umount -v -R /mnt/chroot umount: /mnt/chroot/sys/kernel/security unmounted umount: /mnt/chroot/sys/fs/cgroup (cgroup2) unmounted umount: /mnt/chroot/sys/fs/pstore unmounted umount: /mnt/chroot/sys/firmware/efi/efivars unmounted umount: /mnt/chroot/sys/fs/bpf (bpf) unmounted umount: /mnt/chroot/sys/kernel/debug unmounted umount: /mnt/chroot/sys/kernel/tracing (tracefs) unmounted umount: /mnt/chroot/sys/fs/fuse/connections (fusectl) unmounted umount: /mnt/chroot/sys/kernel/config unmounted umount: /mnt/chroot/sys unmounted umount: /mnt/chroot unmounted gene@Mobile-PC:~> sudo mount -v UUID=4c96a0c2-f72f-4827-b023-83ba000b2fd2 /mnt/chroot mount: /dev/sdb2 mounted on /mnt/chroot. gene@Mobile-PC:~> sudo mount -v --rbind /sys /mnt/chroot/sys mount: /sys bound on /mnt/chroot/sys. gene@Mobile-PC:~> sudo mount -v --make-rslave /mnt/chroot/sys mount: /mnt/chroot/sys propagation flags changed. gene@Mobile-PC:~> sudo umount -v -R /mnt/chroot umount: /mnt/chroot/sys/kernel/security unmounted umount: /mnt/chroot/sys/fs/cgroup (cgroup2) unmounted umount: /mnt/chroot/sys/fs/pstore unmounted umount: /mnt/chroot/sys/firmware/efi/efivars unmounted umount: /mnt/chroot/sys/fs/bpf (bpf) unmounted umount: /mnt/chroot/sys/kernel/debug unmounted umount: /mnt/chroot/sys/kernel/tracing (tracefs) unmounted umount: /mnt/chroot/sys/fs/fuse/connections (fusectl) unmounted umount: /mnt/chroot/sys/kernel/config unmounted umount: /mnt/chroot/sys unmounted umount: /mnt/chroot unmounted However, if the external USB connected NVMe SSD is unplugged/re-plugged between the two successive mount sequences, the second one fails. gene@Mobile-PC:~> sudo mount -v UUID=4c96a0c2-f72f-4827-b023-83ba000b2fd2 /mnt/chroot mount: /dev/sdb2 mounted on /mnt/chroot. gene@Mobile-PC:~> sudo mount -v --rbind /sys /mnt/chroot/sys mount: /sys bound on /mnt/chroot/sys. gene@Mobile-PC:~> sudo mount -v --make-rslave /mnt/chroot/sys mount: /mnt/chroot/sys propagation flags changed. gene@Mobile-PC:~> sudo umount -v -R /mnt/chroot umount: /mnt/chroot/sys/kernel/security unmounted umount: /mnt/chroot/sys/fs/cgroup (cgroup2) unmounted umount: /mnt/chroot/sys/fs/pstore unmounted umount: /mnt/chroot/sys/firmware/efi/efivars unmounted umount: /mnt/chroot/sys/fs/bpf (bpf) unmounted umount: /mnt/chroot/sys/kernel/debug unmounted umount: /mnt/chroot/sys/kernel/tracing (tracefs) unmounted umount: /mnt/chroot/sys/fs/fuse/connections (fusectl) unmounted umount: /mnt/chroot/sys/kernel/config unmounted umount: /mnt/chroot/sys unmounted umount: /mnt/chroot unmounted gene@Mobile-PC:~> # unplug/replug /dev/sdb2 gene@Mobile-PC:~> sudo mount -v UUID=4c96a0c2-f72f-4827-b023-83ba000b2fd2 /mnt/chroot mount: /mnt/chroot: mount(2) system call failed: File exists. Deleting/re-creating the mount point leads to a successful remount. gene@Mobile-PC:~> sudo rmdir /mnt/chroot gene@Mobile-PC:~> sudo mkdir /mnt/chroot gene@Mobile-PC:~> sudo mount -v UUID=4c96a0c2-f72f-4827-b023-83ba000b2fd2 /mnt/chroot mount: /dev/sdc2 mounted on /mnt/chroot. gene@Mobile-PC:~> sudo mount -v --rbind /sys /mnt/chroot/sys mount: /sys bound on /mnt/chroot/sys. gene@Mobile-PC:~> sudo mount -v --make-rslave /mnt/chroot/sys mount: /mnt/chroot/sys propagation flags changed. gene@Mobile-PC:~> sudo umount -v -R /mnt/chroot umount: /mnt/chroot/sys/kernel/security unmounted umount: /mnt/chroot/sys/fs/cgroup (cgroup2) unmounted umount: /mnt/chroot/sys/fs/pstore unmounted umount: /mnt/chroot/sys/firmware/efi/efivars unmounted umount: /mnt/chroot/sys/fs/bpf (bpf) unmounted umount: /mnt/chroot/sys/kernel/debug unmounted umount: /mnt/chroot/sys/kernel/tracing (tracefs) unmounted umount: /mnt/chroot/sys/fs/fuse/connections (fusectl) unmounted umount: /mnt/chroot/sys/kernel/config unmounted umount: /mnt/chroot/sys unmounted umount: /mnt/chroot unmounted Thanks for your help, Gene -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 Gene Snider <genes1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 http://bugzilla.opensuse.org/show_bug.cgi?id=1201114#c2 --- Comment #2 from Gene Snider <genes1122@gmail.com> --- After the first > sudo umount -v -R /mnt/chroot:
ll /mnt/chroot total 0 -rw-r--r-- 1 root root 0 Jul 7 13:26 nothing_is_mounted
mount proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) devtmpfs on /dev type devtmpfs (rw,nosuid,size=4096k,nr_inodes=1048576,mode=755,inode64) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,size=3141212k,nr_inodes=819200,mode=755,inode64) cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime) bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700) /dev/nvme0n1p4 on / type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=504,subvol=/@/.snapshots/239/snapshot) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=25704) mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M) debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime) tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,nr_inodes=1048576,inode64) fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime) configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime) /dev/nvme0n1p4 on /.snapshots type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=265,subvol=/@/.snapshots) /dev/nvme0n1p4 on /boot/grub2/x86_64-efi type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=263,subvol=/@/boot/grub2/x86_64-efi) /dev/nvme0n1p4 on /boot/grub2/i386-pc type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=264,subvol=/@/boot/grub2/i386-pc) /dev/nvme0n1p4 on /home type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=262,subvol=/@/home) /dev/sda1 on /mnt/backups type btrfs (rw,relatime,ssd,space_cache,subvolid=5,subvol=/) /dev/nvme0n1p4 on /srv type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=259,subvol=/@/srv) /dev/nvme0n1p4 on /root type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=260,subvol=/@/root) /dev/nvme0n1p4 on /opt type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=261,subvol=/@/opt) /dev/nvme0n1p4 on /var type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=257,subvol=/@/var) /dev/nvme0n1p4 on /usr/local type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=258,subvol=/@/usr/local) /dev/nvme0n1p1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro) tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1570604k,nr_inodes=392651,mode=700,uid=1000,gid=1000,inode64) gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000) portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
cat /proc/mounts proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 devtmpfs /dev devtmpfs rw,nosuid,size=4096k,nr_inodes=1048576,mode=755,inode64 0 0 securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /dev/shm tmpfs rw,nosuid,nodev,inode64 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 tmpfs /run tmpfs rw,nosuid,nodev,size=3141212k,nr_inodes=819200,mode=755,inode64 0 0 cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0 pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0 bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0 /dev/nvme0n1p4 / btrfs rw,relatime,ssd,space_cache=v2,subvolid=504,subvol=/@/.snapshots/239/snapshot 0 0 systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=25704 0 0 mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0 hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0 debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0 tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /tmp tmpfs rw,nosuid,nodev,nr_inodes=1048576,inode64 0 0 fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0 configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0 /dev/nvme0n1p4 /.snapshots btrfs rw,relatime,ssd,space_cache=v2,subvolid=265,subvol=/@/.snapshots 0 0 /dev/nvme0n1p4 /boot/grub2/x86_64-efi btrfs rw,relatime,ssd,space_cache=v2,subvolid=263,subvol=/@/boot/grub2/x86_64-efi 0 0 /dev/nvme0n1p4 /boot/grub2/i386-pc btrfs rw,relatime,ssd,space_cache=v2,subvolid=264,subvol=/@/boot/grub2/i386-pc 0 0 /dev/nvme0n1p4 /home btrfs rw,relatime,ssd,space_cache=v2,subvolid=262,subvol=/@/home 0 0 /dev/sda1 /mnt/backups btrfs rw,relatime,ssd,space_cache,subvolid=5,subvol=/ 0 0 /dev/nvme0n1p4 /srv btrfs rw,relatime,ssd,space_cache=v2,subvolid=259,subvol=/@/srv 0 0 /dev/nvme0n1p4 /root btrfs rw,relatime,ssd,space_cache=v2,subvolid=260,subvol=/@/root 0 0 /dev/nvme0n1p4 /opt btrfs rw,relatime,ssd,space_cache=v2,subvolid=261,subvol=/@/opt 0 0 /dev/nvme0n1p4 /var btrfs rw,relatime,ssd,space_cache=v2,subvolid=257,subvol=/@/var 0 0 /dev/nvme0n1p4 /usr/local btrfs rw,relatime,ssd,space_cache=v2,subvolid=258,subvol=/@/usr/local 0 0 /dev/nvme0n1p1 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0 tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=1570604k,nr_inodes=392651,mode=700,uid=1000,gid=1000,inode64 0 0 gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0 portal /run/user/1000/doc fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
I didn't see any references to /dev/sdb or /mnt/chroot with grep for either command. The journal says the umount was successful: Jul 07 13:42:48 Mobile-PC sudo[3403]: gene : TTY=pts/0 ; PWD=/home/gene ; USER=root ; COMMAND=/usr/bin/umount -v -R /mnt/chroot Jul 07 13:42:48 Mobile-PC sudo[3403]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000) Jul 07 13:42:48 Mobile-PC sudo[3403]: pam_unix(sudo:session): session closed for user root Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-security.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-config.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys-fs-fuse-connections.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-tracing.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-debug.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys-fs-bpf.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys-firmware-efi-efivars.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys-fs-pstore.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys-fs-cgroup.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot-sys.mount: Deactivated successfully. Jul 07 13:42:48 Mobile-PC systemd[1]: mnt-chroot.mount: Deactivated successfully. Check out what happens when I run journalctl -f and umplug/replug the drive: Jul 07 13:50:31 Mobile-PC kernel: usb 2-1: USB disconnect, device number 2 Jul 07 13:50:31 Mobile-PC systemd[1]: Stopping Sabrent-Samsung temperature monitor daemon, started by udev rule... Jul 07 13:50:31 Mobile-PC systemd[1]: Sabrent-Samsung-tempd.service: Deactivated successfully. Jul 07 13:50:31 Mobile-PC systemd[1]: Stopped Sabrent-Samsung temperature monitor daemon, started by udev rule. Jul 07 13:50:31 Mobile-PC systemd[1]: Sabrent-Samsung-tempd.service: Consumed 5.075s CPU time. Jul 07 13:50:32 Mobile-PC kernel: sd 2:0:0:0: [sdb] Synchronizing SCSI cache Jul 07 13:50:32 Mobile-PC kernel: sd 2:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK Jul 07 13:50:38 Mobile-PC kernel: usb 2-1: new SuperSpeed Plus Gen 2x1 USB device number 3 using xhci_hcd Jul 07 13:50:38 Mobile-PC kernel: usb 2-1: New USB device found, idVendor=0bda, idProduct=9210, bcdDevice=20.01 Jul 07 13:50:38 Mobile-PC kernel: usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Jul 07 13:50:38 Mobile-PC kernel: usb 2-1: Product: Sabrent Jul 07 13:50:38 Mobile-PC kernel: usb 2-1: Manufacturer: Sabrent Jul 07 13:50:38 Mobile-PC kernel: usb 2-1: SerialNumber: 012345678930 Jul 07 13:50:38 Mobile-PC kernel: scsi host3: uas Jul 07 13:50:38 Mobile-PC mtp-probe[4457]: checking bus 2, device 3: "/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb2/2-1" Jul 07 13:50:38 Mobile-PC mtp-probe[4457]: bus: 2, device: 3 was not an MTP device Jul 07 13:50:38 Mobile-PC kernel: scsi 3:0:0:0: Direct-Access Sabrent 1.00 PQ: 0 ANSI: 6 Jul 07 13:50:38 Mobile-PC mtp-probe[4458]: checking bus 2, device 3: "/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb2/2-1" Jul 07 13:50:38 Mobile-PC mtp-probe[4458]: bus: 2, device: 3 was not an MTP device Jul 07 13:50:38 Mobile-PC kernel: sd 3:0:0:0: Attached scsi generic sg1 type 0 Jul 07 13:50:38 Mobile-PC systemd[1]: Started Sabrent-Samsung temperature monitor daemon, started by udev rule. Jul 07 13:50:38 Mobile-PC kernel: sd 3:0:0:0: [sdc] 1000215216 512-byte logical blocks: (512 GB/477 GiB) Jul 07 13:50:38 Mobile-PC kernel: sd 3:0:0:0: [sdc] Write Protect is off Jul 07 13:50:38 Mobile-PC kernel: sd 3:0:0:0: [sdc] Mode Sense: 37 00 00 08 Jul 07 13:50:38 Mobile-PC kernel: sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Jul 07 13:50:38 Mobile-PC kernel: sd 3:0:0:0: [sdc] Optimal transfer size 33553920 bytes Jul 07 13:50:38 Mobile-PC kernel: sdc: sdc1 sdc2 Jul 07 13:50:38 Mobile-PC kernel: sd 3:0:0:0: [sdc] Attached SCSI disk Jul 07 13:50:38 Mobile-PC kernel: BTRFS warning: duplicate device /dev/sdc2 devid 1 generation 6733 scanned by systemd-udevd (4456) Notice that it reattached as /dev/sdc2. I get the same message when the mount fails: Jul 07 13:52:20 Mobile-PC sudo[4716]: gene : TTY=pts/1 ; PWD=/home/gene ; USER=root ; COMMAND=/usr/bin/mount -v UUID=4c96a0c2-f72f-4827-b023-83ba000b2fd2 /mnt/chroot Jul 07 13:52:20 Mobile-PC kernel: BTRFS warning: duplicate device /dev/sdc2 devid 1 generation 6733 scanned by mount (4717) Jul 07 13:52:20 Mobile-PC sudo[4716]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000) Jul 07 13:52:20 Mobile-PC sudo[4716]: pam_unix(sudo:session): session closed for user root Let me know if you need more info. An aside, this only seems to happen for --rbind and --make-rslave. Just mounting the root drive doesn't cause a problem. Thanks, Gene -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 http://bugzilla.opensuse.org/show_bug.cgi?id=1201114#c3 --- Comment #3 from Stanislav Brabec <sbrabec@suse.com> --- This is very strange: Jul 07 13:52:20 Mobile-PC kernel: BTRFS warning: duplicate device /dev/sdc2 devid 1 generation 6733 scanned by mount (4717) It looks that even if everything was correctly unmounted, something in the kernel still holds a record for /dev/sdb2, which prevents it from releasing. Just a dumb idea: What happens if you do rmdir /mnt/chroot after unplug, but before replug. It seems, that something becomes bound to this directory, but it is not a mounted volume. Does the bug happens then? Does the device get name sdb2 or sdc2 then? In any case, it looks like a kernel problem that has nothing to do with mount/libmount. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 http://bugzilla.opensuse.org/show_bug.cgi?id=1201114#c4 --- Comment #4 from Gene Snider <genes1122@gmail.com> --- "What happens if you do rmdir /mnt/chroot after unplug, but before replug?" Bad things happen. Commands first, then journal entries follow:
sudo umount -v -R /mnt/chroot umount: /mnt/chroot/sys/kernel/security unmounted umount: /mnt/chroot/sys/fs/cgroup (cgroup2) unmounted umount: /mnt/chroot/sys/fs/pstore unmounted umount: /mnt/chroot/sys/firmware/efi/efivars unmounted umount: /mnt/chroot/sys/fs/bpf (bpf) unmounted umount: /mnt/chroot/sys/kernel/debug unmounted umount: /mnt/chroot/sys/kernel/tracing (tracefs) unmounted umount: /mnt/chroot/sys/fs/fuse/connections (fusectl) unmounted umount: /mnt/chroot/sys/kernel/config unmounted umount: /mnt/chroot/sys unmounted umount: /mnt/chroot unmounted
Jul 07 16:50:27 Mobile-PC sudo[3031]: gene : TTY=pts/1 ; PWD=/home/gene ; USER=root ; COMMAND=/usr/bin/umount -v -R /mnt/chroot Jul 07 16:50:27 Mobile-PC sudo[3031]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000) Jul 07 16:50:27 Mobile-PC sudo[3031]: pam_unix(sudo:session): session closed for user root Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys-fs-bpf.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys-firmware-efi-efivars.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys-fs-pstore.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys-fs-cgroup.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-security.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-config.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys-fs-fuse-connections.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-tracing.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-debug.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot-sys.mount: Deactivated successfully. Jul 07 16:50:27 Mobile-PC systemd[1]: mnt-chroot.mount: Deactivated successfully. Jul 07 16:50:32 Mobile-PC chronyd[1118]: Selected source 162.159.200.1 (2.opensuse.pool.ntp.org) Jul 07 16:50:36 Mobile-PC kernel: usb 2-1: USB disconnect, device number 2 Jul 07 16:50:36 Mobile-PC systemd[1]: Stopping Sabrent-Samsung temperature monitor daemon, started by udev rule... Jul 07 16:50:36 Mobile-PC systemd[1]: Sabrent-Samsung-tempd.service: Deactivated successfully. Jul 07 16:50:36 Mobile-PC systemd[1]: Stopped Sabrent-Samsung temperature monitor daemon, started by udev rule. Jul 07 16:50:36 Mobile-PC kernel: sd 2:0:0:0: [sdb] Synchronizing SCSI cache Jul 07 16:50:36 Mobile-PC kernel: sd 2:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sudo rmdir /mnt/chroot
Jul 07 16:50:49 Mobile-PC sudo[3070]: gene : TTY=pts/1 ; PWD=/home/gene ; USER=root ; COMMAND=/usr/bin/rmdir /mnt/chroot Jul 07 16:50:49 Mobile-PC sudo[3070]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000) Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 1, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 2, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 3, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 4, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 5, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 6, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 7, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 8, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 9, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2): bdev /dev/sdb2 errs: wr 0, rd 10, flush 0, corrupt 0, gen 0 Jul 07 16:50:49 Mobile-PC kernel: BTRFS: error (device sdb2: state A) in add_to_free_space_tree:1051: errno=-5 IO failure Jul 07 16:50:49 Mobile-PC kernel: BTRFS info (device sdb2: state EA): forced readonly Jul 07 16:50:49 Mobile-PC kernel: BTRFS: error (device sdb2: state EA) in do_free_extent_accounting:2874: errno=-5 IO failure Jul 07 16:50:49 Mobile-PC kernel: BTRFS: error (device sdb2: state EA) in btrfs_run_delayed_refs:2151: errno=-5 IO failure Jul 07 16:50:49 Mobile-PC kernel: BTRFS warning (device sdb2: state EA): Skipping commit of aborted transaction. Jul 07 16:50:49 Mobile-PC kernel: BTRFS: error (device sdb2: state EA) in cleanup_transaction:1982: errno=-5 IO failure Jul 07 16:50:49 Mobile-PC kernel: BTRFS error (device sdb2: state EA): commit super ret -5 Jul 07 16:50:49 Mobile-PC sudo[3070]: pam_unix(sudo:session): session closed for user root The kernel BTRFS driver is very confused at this point. Gene -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 http://bugzilla.opensuse.org/show_bug.cgi?id=1201114#c5 --- Comment #5 from Gene Snider <genes1122@gmail.com> --- I forgot to mention whether it remounted as sdb2 or sdbc2, so I reran the test. It remounts as /dev/sdb2.
sudo umount -v -R /mnt/chroot umount: /mnt/chroot/sys/kernel/security unmounted umount: /mnt/chroot/sys/fs/cgroup (cgroup2) unmounted umount: /mnt/chroot/sys/fs/pstore unmounted umount: /mnt/chroot/sys/firmware/efi/efivars unmounted umount: /mnt/chroot/sys/fs/bpf (bpf) unmounted umount: /mnt/chroot/sys/kernel/debug unmounted umount: /mnt/chroot/sys/kernel/tracing (tracefs) unmounted umount: /mnt/chroot/sys/fs/fuse/connections (fusectl) unmounted umount: /mnt/chroot/sys/kernel/config unmounted umount: /mnt/chroot/sys unmounted umount: /mnt/chroot unmounted
# unplug
sudo rmdir /mnt/chroot
# replug
sudo mkdir /mnt/chroot
sudo mount -v UUID=4c96a0c2-f72f-4827-b023-83ba000b2fd2 /mnt/chroot mount: /dev/sdb2 mounted on /mnt/chroot.
Gene -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 http://bugzilla.opensuse.org/show_bug.cgi?id=1201114#c6 --- Comment #6 from Gene Snider <genes1122@gmail.com> --- It's not btrfs specific, here's the log for the same operations on an ext4 partition. Jul 08 11:44:23 Mobile-PC sudo[3379]: gene : TTY=pts/0 ; PWD=/home/gene ; USER=root ; COMMAND=/usr/bin/umount -v -R /mnt/chroot Jul 08 11:44:23 Mobile-PC sudo[3379]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000) Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-security.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC sudo[3379]: pam_unix(sudo:session): session closed for user root Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-config.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys-fs-fuse-connections.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-tracing.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys-kernel-debug.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys-fs-bpf.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys-firmware-efi-efivars.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys-fs-pstore.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys-fs-cgroup.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot-sys.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1]: mnt-chroot.mount: Deactivated successfully. Jul 08 11:44:23 Mobile-PC systemd[1448]: Created slice User Background Tasks Slice. Jul 08 11:44:23 Mobile-PC systemd[1448]: Starting Cleanup of User's Temporary Files and Directories... Jul 08 11:44:23 Mobile-PC systemd[1448]: Finished Cleanup of User's Temporary Files and Directories.
# unplug
Jul 08 11:44:36 Mobile-PC kernel: usb 2-1: USB disconnect, device number 2 Jul 08 11:44:36 Mobile-PC kernel: device offline error, dev sdb, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 0 prio class 0 Jul 08 11:44:36 Mobile-PC systemd[1]: Stopping Sabrent-Samsung temperature monitor daemon, started by udev rule... Jul 08 11:44:36 Mobile-PC systemd[1]: Sabrent-Samsung-tempd.service: Deactivated successfully. Jul 08 11:44:36 Mobile-PC systemd[1]: Stopped Sabrent-Samsung temperature monitor daemon, started by udev rule. Jul 08 11:44:36 Mobile-PC systemd[1]: Sabrent-Samsung-tempd.service: Consumed 1.867s CPU time. Jul 08 11:44:36 Mobile-PC kernel: sd 2:0:0:0: [sdb] Synchronizing SCSI cache Jul 08 11:44:36 Mobile-PC kernel: sd 2:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sudo rmdir /mnt/chroot
Jul 08 11:44:47 Mobile-PC sudo[3426]: gene : TTY=pts/0 ; PWD=/home/gene ; USER=root ; COMMAND=/usr/bin/rmdir /mnt/chroot Jul 08 11:44:47 Mobile-PC sudo[3426]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000) Jul 08 11:44:47 Mobile-PC kernel: Buffer I/O error on dev sdb3, logical block 1081344, lost sync page write Jul 08 11:44:47 Mobile-PC kernel: JBD2: Error -5 detected when updating journal superblock for sdb3-8. Jul 08 11:44:47 Mobile-PC kernel: Aborting journal on device sdb3-8. Jul 08 11:44:47 Mobile-PC kernel: Buffer I/O error on dev sdb3, logical block 1081344, lost sync page write Jul 08 11:44:47 Mobile-PC kernel: JBD2: Error -5 detected when updating journal superblock for sdb3-8. Jul 08 11:44:47 Mobile-PC kernel: EXT4-fs error (device sdb3): ext4_put_super:1226: comm rmdir: Couldn't clean up the journal Jul 08 11:44:47 Mobile-PC kernel: EXT4-fs (sdb3): Remounting filesystem read-only Jul 08 11:44:47 Mobile-PC sudo[3426]: pam_unix(sudo:session): session closed for user root Lots of different error messages, but that's expected. Gene -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 http://bugzilla.opensuse.org/show_bug.cgi?id=1201114#c7 --- Comment #7 from Gene Snider <genes1122@gmail.com> --- (In reply to Stanislav Brabec from comment #3)
This is very strange:
Jul 07 13:52:20 Mobile-PC kernel: BTRFS warning: duplicate device /dev/sdc2 devid 1 generation 6733 scanned by mount (4717)
It looks that even if everything was correctly unmounted, something in the kernel still holds a record for /dev/sdb2, which prevents it from releasing.
Just a dumb idea:
What happens if you do rmdir /mnt/chroot after unplug, but before replug. It seems, that something becomes bound to this directory, but it is not a mounted volume.
Does the bug happens then? Does the device get name sdb2 or sdc2 then?
In any case, it looks like a kernel problem that has nothing to do with mount/libmount.
Should I open a bug against the kernel, then? Or will you move this bug? Thanks, Gene -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 http://bugzilla.opensuse.org/show_bug.cgi?id=1201114#c8 Stanislav Brabec <sbrabec@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sbrabec@suse.com Assignee|sbrabec@suse.com |kernel-bugs@opensuse.org Flags|needinfo?(genes1122@gmail.c | |om) | --- Comment #8 from Stanislav Brabec <sbrabec@suse.com> --- Thanks. Reassigning. Just guessing that the problem is somewhere in the kernel, in the way, how it holds information about rslave. It seems to stay connected to the device, even if it is successfully remounted. It could easily happen, because technically, setting of propagation flag (--make-rslave) uses a special form of mount() syscall: mount("none", "/mnt/chroot/sys", NULL, MS_REC|MS_SLAVE, NULL) = 0 I do not see any reverse command that could be called before the unplug. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 http://bugzilla.opensuse.org/show_bug.cgi?id=1201114#c9 --- Comment #9 from Gene Snider <genes1122@gmail.com> --- This seems to be a workaround: sudo sh -c "umount -v -R /mnt/chroot && rmdir -v /mnt/chroot && mkdir -v /mnt/chroot" Gene -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 http://bugzilla.opensuse.org/show_bug.cgi?id=1201114#c10 --- Comment #10 from Stanislav Brabec <sbrabec@suse.com> --- It indeed looks that something else than mounted volume is bound to the directory. But in difference to mount command, it does not prevent rmdir. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1201114 Andreas Stieger <Andreas.Stieger@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 - Medium |P5 - None -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com