Bug#812589: fsck -M has stopped working
>> The "802" is the root= argument passed to the kernel by the boot loader. >> Major device 8, minor 2. What I don't understand is why libmount thinks >> it's a file name (in $PWD, no less). > The boot loader should be passing "/dev/sda2", not "802". Are you using > an ancient boot loader ( like the dos linload.com ) or something? Package: lilo Status: install ok installed Priority: optional Section: admin Installed-Size: 649 Maintainer: Joachim WiedornArchitecture: i386 Version: 1:24.2-1 And regardless of the boot loader, if the kernel is documented as accepting a root= format, code that parses /proc/cmdlike should handle it gracefully. At an *absolute* minimum provide a specific error message that a particular format is not supported, as opposed to implementing RFC 748 and losing randomly.
Bug#812589: fsck -M has stopped working
> Thanks for your bug report, but I'm not able to reproduce it and > it lacks information needed to investigate it. (Tagged as such > in a separate email to the bug tracking system.) Sorry, I tried to include pretty much everything. > Also adding -V (for verbose) would give some additional information. Actually, the additional info is very limited (basically, showing the invocation of f2ck.ext4) which is already after is_mounted() has returned the wrong answer, so it wasn't helpful. > 7320: libmount: INIT: library debug mask: 0x > 7320: libmount: INIT: library version: 2.27.0 > 7320: libmount: INIT: feature: selinux > 7320: libmount: INIT: feature: assert > 7320: libmount: INIT: feature: debug > Available "LIBMOUNT_DEBUG=[,...]|" debug masks: >all [0x] : info about all subsystems >cache[0x0004] : paths and tags cache >cxt [0x0200] : library context (handler) >diff [0x0400] : mountinfo changes tracking >fs [0x0040] : FS abstraction >help [0x0001] : this help >locks[0x0010] : mtab and utab locking >options [0x0008] : mount options parsing >tab [0x0020] : fstab, mtab, mounninfo routines >update [0x0080] : mtab, utab updates >utils[0x0100] : misc library utils >monitor [0x0800] : mount tables monitor > 7320: libmount:CACHE: [0x9480048]: alloc > fsck from util-linux 2.27.1 > 7320: libmount: TAB: [0x9480068]: alloc > 7320: libmount: TAB: [0x9480068]: /etc/fstab: start parsing [entries=0, > filter=not] > 7320: libmount: TAB: [0x9480068]: add entry: /dev/sda2 / > 7320: libmount: TAB: [0x9480068]: add entry: UUID=[swap device] none > 7320: libmount: TAB: [0x9480068]: add entry: proc /proc > 7320: libmount: TAB: [0x9480068]: add entry: sys /sys > 7320: libmount: TAB: [0x9480068]: add entry: dev /dev > 7320: libmount: TAB: [0x9480068]: add entry: devpts /dev/pts > 7320: libmount: TAB: [0x9480068]: add entry: [network mount redacted] > 7320: libmount: TAB: [0x9480068]: add entry: /dev/sr0 /media/cdrom0 > 7320: libmount: TAB: [0x9480068]: add entry: /dev/mmcblk0p1 /mnt > 7320: libmount: FS: [0x9480b30]: free [refcount=0] > 7320: libmount: TAB: [0x9480068]: /etc/fstab: stop parsing (9 entries) > 7320: libmount: TAB: [0x9480068]: parsing done [filename=/etc/fstab, > rc=0] > 7320: libmount:CACHE: [0x9480048]: canonicalize path /dev/sda2 > 7320: libmount:CACHE: [0x9480048]: add entry [ 1] (path): /dev/sda2: > /dev/sda2 > 7320: libmount: TAB: [0x9480068]: lookup TARGET: '/' > 7320: libmount: TAB: [0x9480130]: alloc > 7320: libmount: TAB: [0x9480130]: mtab parse: ignore mtab > 7320: libmount: TAB: [0x9480130]: mtab parse: #1 read mountinfo > 7320: libmount: TAB: [0x9480130]: /proc/self/mountinfo: start parsing > [entries=0, filter=not] > 7320: libmount: TAB: [0x9480130]: add entry: /dev/root / > 7320: libmount:CACHE: canonicalize path /proc/self/mountinfo > 7320: libmount: TAB: TID for /proc/self/mountinfo is 7320 > 7320: libmount: TAB: [0x9480130]: root FS: 802 > 7320: libmount:CACHE: [0x9480048]: canonicalize path 802 > 7320: libmount:CACHE: [0x9480048]: add entry [ 2] (path): 802: 802 > 7320: libmount: TAB: [0x9480130]: canonical root FS: 802 > This '802' business looks weird. Having your complete > /proc/self/mountinfo would be useful. The "802" is the root= argument passed to the kernel by the boot loader. Major device 8, minor 2. What I don't understand is why libmount thinks it's a file name (in $PWD, no less). 13 0 8:2 / / rw,relatime - ext4 /dev/root rw,errors=remount-ro,data=ordered 14 13 0:13 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sysfs rw 15 13 0:14 / /run rw,nosuid,noexec,relatime - tmpfs tmpfs rw,size=335456k,mode=755 16 15 0:15 / /run/lock rw,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw,size=5120k 17 13 0:4 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw 18 13 0:6 / /dev rw,nosuid,relatime - devtmpfs devtmpfs rw,size=10240k,nr_inodes=216237,mode=755 19 15 0:16 / /run/shm rw,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw,size=1454860k 20 18 0:11 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620 > This is where things should return true for is_mounted(...) but > apparently doesn't for you. In verbose mode you should get: > "/dev/sda2 is mounted" I get "is not mounted", followed by e2fsck saying "is mounted". > Without access to your mountinfo there's not much I can do to help you > out and without a proper submitter address I'm not able to reach you, Oh, it's a proper address. At first I was worried about spammers address harvesing the BTS and created a separate address so it could be heavily filtered, but then I discovered that spammers tend to filter out e-mail addresses that include the word "spam"! > so I'm closing this bug report. You need to find out what's broken > on your
Bug#812589: fsck -M has stopped working
On 1/25/2016 11:16 AM, sacrificial-spam-addr...@horizon.com wrote: > The "802" is the root= argument passed to the kernel by the boot loader. > Major device 8, minor 2. What I don't understand is why libmount thinks > it's a file name (in $PWD, no less). The boot loader should be passing "/dev/sda2", not "802". Are you using an ancient boot loader ( like the dos linload.com ) or something?
Bug#812589: fsck -M has stopped working
Package: util-linux Version: 2.27.1-1 Architecture: i386 (libmount1 and libblkid1 are also 2.27.1.) My most recent reboot (and it's been a while, so it may be some dependent library or new 4.4 kernel or something) failed in checkfs.sh. Upon debugging, it appeared that the invocation of "fsck -C -M -A -a" was, despite the -M flag, trying to check /dev/sda2, my root file system. e2fsck of course complained about this, leading to a recovery shell and a need for manual intervention. $ cat /var/log/fsck/checkfs Log of fsck -C -M -A -a Sun Jan 24 20:36:30 2016 fsck from util-linux 2.27.1 /dev/sda2 is mounted. e2fsck: Cannot continue, aborting. fsck exited with status code 8 Sun Jan 24 20:36:30 2016 Running fsck under strace shows the following interesting parts (boring bits like memory allocation elided): open("/etc/fstab", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 read(3, ...) close(3) = 0 lstat64("/dev", {st_mode=S_IFDIR|0755, st_size=3420, ...}) = 0 lstat64("/dev/sda2", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 2), ...}) = 0 stat64("/dev/sda2", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 2), ...}) = 0 # NFclue why it needs a stat() after lstat() says it's not a symlink stat64("/sbin/fsck.ext4", ...) = 0 # Path search open("/proc/self/mountinfo", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 read(3, "13 0 8:2 / / rw,relatime - ext4 "..., 1024) = 638 # That's the right root file system readlink("/proc/self", "2690", 4095)= 4 lstat64("/proc/2690/mountinfo", {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 # Not sure what's being reverified here open("/proc/cmdline", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 5 read(5, "auto BOOT_IMAGE=Linux ro root=802 "..., 1024) = 155 close(5)= 0 getcwd("$HOME", 4096) # No, not literally, I've substituted lstat64("$HOME/802", ...) = -1 ENOENT # This looks wrong read(3, "", 1024) = 0 close(3)= 0 ... then it clone()s and tries to run fsck.ext4. I'd think the process of elimination would go as follows: - For each line in /etc/fstab - If it's a real file system for which we have an fsck, stat the device node. - Search /proc/self/mountinfo for the same device mode. If it's mounted already (rw or ro), skip it. Poking around the code, I also found some debug options. Trying LIBMOUNT_DEBUG=all LIBBLKID_DEBUG=all fsck -C -M -A produces: 7320: libmount: INIT: library debug mask: 0x 7320: libmount: INIT: library version: 2.27.0 7320: libmount: INIT: feature: selinux 7320: libmount: INIT: feature: assert 7320: libmount: INIT: feature: debug Available "LIBMOUNT_DEBUG=[,...]|" debug masks: all [0x] : info about all subsystems cache[0x0004] : paths and tags cache cxt [0x0200] : library context (handler) diff [0x0400] : mountinfo changes tracking fs [0x0040] : FS abstraction help [0x0001] : this help locks[0x0010] : mtab and utab locking options [0x0008] : mount options parsing tab [0x0020] : fstab, mtab, mounninfo routines update [0x0080] : mtab, utab updates utils[0x0100] : misc library utils monitor [0x0800] : mount tables monitor 7320: libmount:CACHE: [0x9480048]: alloc fsck from util-linux 2.27.1 7320: libmount: TAB: [0x9480068]: alloc 7320: libmount: TAB: [0x9480068]: /etc/fstab: start parsing [entries=0, filter=not] 7320: libmount: TAB: [0x9480068]: add entry: /dev/sda2 / 7320: libmount: TAB: [0x9480068]: add entry: UUID=[swap device] none 7320: libmount: TAB: [0x9480068]: add entry: proc /proc 7320: libmount: TAB: [0x9480068]: add entry: sys /sys 7320: libmount: TAB: [0x9480068]: add entry: dev /dev 7320: libmount: TAB: [0x9480068]: add entry: devpts /dev/pts 7320: libmount: TAB: [0x9480068]: add entry: [network mount redacted] 7320: libmount: TAB: [0x9480068]: add entry: /dev/sr0 /media/cdrom0 7320: libmount: TAB: [0x9480068]: add entry: /dev/mmcblk0p1 /mnt 7320: libmount: FS: [0x9480b30]: free [refcount=0] 7320: libmount: TAB: [0x9480068]: /etc/fstab: stop parsing (9 entries) 7320: libmount: TAB: [0x9480068]: parsing done [filename=/etc/fstab, rc=0] 7320: libmount:CACHE: [0x9480048]: canonicalize path /dev/sda2 7320: libmount:CACHE: [0x9480048]: add entry [ 1] (path): /dev/sda2: /dev/sda2 7320: libmount: TAB: [0x9480068]: lookup TARGET: '/' 7320: libmount: TAB: [0x9480130]: alloc 7320: libmount: TAB: [0x9480130]: mtab parse: ignore mtab 7320: libmount: TAB: [0x9480130]: mtab parse: #1 read mountinfo 7320: libmount: TAB: [0x9480130]: /proc/self/mountinfo: start parsing [entries=0, filter=not] 7320: libmount: TAB: [0x9480130]: add entry: /dev/root / 7320: libmount:CACHE: canonicalize path /proc/self/mountinfo 7320: libmount: TAB: TID for /proc/self/mountinfo is 7320 7320: