Summary: | <sys-fs/udev-init-scripts-25 no longer provides /dev/root symlink | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Maksim 'max_posedon' Melnikau <maxposedon> |
Component: | [OLD] Core system | Assignee: | udev maintainers <udev-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | base-system, bircoph, bugzie, dschridde+gentoobugs, floppym, lmedinas, nikoli, proteuss, scarabeus, systemd, udev-bugs |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 381761 | ||
Bug Blocks: |
Description
Maksim 'max_posedon' Melnikau
2011-11-14 12:43:25 UTC
e.g. system boots and runs successfully, problem is that /dev/root missing (how in this case fs was mounted?) <kay> mgorny: /dev/root was distro specific, we don't do that anymore, and recommend not having it <kay> mgorny: it will break with stuff like btrfs, and tools should learn to live without it So, using it is a bug in grub. If base-system really insists on that, I guess we can add some fallback but fixing grub seems like a better idea to me. i don't think /dev/root was distro specific. the kernel provides that info. simply look in /proc/mounts. (In reply to comment #3) > i don't think /dev/root was distro specific. the kernel provides that info. > simply look in /proc/mounts. <kay> mgorny: no, it's a dead text string in case initramfs is not used, it is no info <kay> mgorny: the kernel does an mknod() in an invisible namespace to mount / <kay> mgorny: it's not an info that is intentional (In reply to comment #4) this link has never been managed by openrc/baselayout that i can see. in Gentoo, udev is creating it. sounds like the systemd unit that you've made for udev isn't a complete replacement for the Gentoo init.d script. $ grep root /etc/init.d/udev root_link() /lib/udev/write_root_link_rule root_link (In reply to comment #5) > (In reply to comment #4) > > this link has never been managed by openrc/baselayout that i can see. in > Gentoo, udev is creating it. sounds like the systemd unit that you've made for > udev isn't a complete replacement for the Gentoo init.d script. > > $ grep root /etc/init.d/udev > root_link() > /lib/udev/write_root_link_rule > root_link That's why I said I can add it as backwards compat but kay here (who is udev dev btw) says it is a bad idea after all. I wouldn't be suprised if that binary disappeared sometime soon :P. (In reply to comment #6) that isn't a binary. it's a script the udev ebuild installs. as for grub, i think that's upstream code checking /dev/root, so the better place to report this would be the grub bugzilla. (In reply to comment #7) > as for grub, i think that's upstream code checking /dev/root, so the better > place to report this would be the grub bugzilla. That's why I reassigned the bug to someone who's supposed to have an account there :P. but you didn't re-assign it to someone who agrees/cares with your request :P The write_root_link_rule is something that is added to udev by our ebuild, so /dev/root is in fact distro specific. If upstreams are using it, they shouldn't be. Udev-171-r4 fixes the script to write the rule correctly on systemd systems, so this bug could be closed. However, a bug should be opened against grub upstream to get this fixed properly if grub is using /dev/root. systemd-37 requires at least udev-172, udev-175 doesn't have this fix. Could you add fix to udev-175 too? Did you check udev-175-r1? the fix should be there as well. I don't see shell-compat-KV.sh related fix in udev-175-r1, and still # grub2-mkconfig /sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?). (In reply to comment #14) > I don't see shell-compat-KV.sh related fix in udev-175-r1, and still > # grub2-mkconfig > /sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?). The shell-compat-KV.sh fix is not the one you want for this bug. Look at /lib/udev/write_root_link_rule. The fix is in there. If you haven't rebooted, you may need to run rc-service udev restart. It think this is a manifestation of bug 381761. Basically, /dev/root appears in /proc/mounts if you have a btrfs root filesystem and no initramfs. For more info on what might be causing this, you might want to look at bug #381761. Is that your issue? do you have a btrfs root filesystem? Yes, I use btrfs on / and no initrd, so, now this bug looks for me as duplicate of bug 381761 (In reply to comment #18) > Yes, I use btrfs on / and no initrd, so, now this bug looks for me as duplicate > of bug 381761 I have the same problem, after a stage4 migration to a larger hard disk. btrfs on / and no initrd. # grub2-probe / grub2-probe: error: cannot find a device for / (is /dev mounted?). The problem was reported in gentoo forum: http://forums.gentoo.org/viewtopic-p-6890676.html For me 'udevadm info --export --export-prefix="ROOT_" --device-id-of->file=/' gives ROOT_MAJOR=0 also, and so write_root_link_rule exits without writing the rule. This is for udev-171-r5 and grub-1.99-r2. i'm not sure how you can say /dev/root is distro specific when it's the kernel that uses this naming convention $ cd /usr/src/linux $ grep /dev/root init/*.c init/do_mounts.c: fd = sys_open("/dev/root", O_RDWR | O_NDELAY, 0); init/do_mounts.c: create_dev("/dev/root", ROOT_DEV); init/do_mounts.c: mount_block_root("/dev/root", root_mountflags); init/do_mounts_initrd.c: create_dev("/dev/root.old", Root_RAM0); init/do_mounts_initrd.c: mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY); init/do_mounts_initrd.c: int fd = sys_open("/dev/root.old", O_RDWR, 0); init/do_mounts_rd.c: create_dev("/dev/root", ROOT_DEV); init/do_mounts_rd.c: return rd_load_image("/dev/root"); $ grep /dev/root /proc/mounts /dev/root / ext4 rw,noatime,data=ordered 0 0 *** Bug 430426 has been marked as a duplicate of this bug. *** *** Bug 427818 has been marked as a duplicate of this bug. *** *** Bug 438028 has been marked as a duplicate of this bug. *** (In reply to comment #20) > i'm not sure how you can say /dev/root is distro specific when it's the > kernel that uses this naming convention > Just ask Linus about that, I'm sure he'll deal with Kay appropriately. (In reply to comment #24) > (In reply to comment #20) > > i'm not sure how you can say /dev/root is distro specific when it's the > > kernel that uses this naming convention > > > > Just ask Linus about that, I'm sure he'll deal with Kay appropriately. I don't see where the kernel is using this naming convention. it isn't on my box at all, and it doesn't appear when I run "grep /dev/root /proc/mounts". "/dev/root" was created by write_root_link_rule, which was a gentoo specific addon to udev. On my system I have /dev/root in /proc/mounts, but not in /etc/fstab. I use ext4 as a root fs, udev-194 and openrc-0.9.9.3. My kernel is configured to support and mount devtmpfs, that is where /dev/root is created in the first place: CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y just to be remounted and removed later by all-the-clever udev. (In reply to comment #26) > On my system I have /dev/root in /proc/mounts, but not in /etc/fstab. I use > ext4 as a root fs, udev-194 and openrc-0.9.9.3. And which version of udev-init-scripts? > My kernel is configured to support and mount devtmpfs, that is where > /dev/root is created in the first place: > CONFIG_DEVTMPFS=y > CONFIG_DEVTMPFS_MOUNT=y > just to be remounted and removed later by all-the-clever udev. No. udev-init-scripts does not attempt to remount /dev if you have config_devtmpfs_mount=y. To see that, look in /etc/init.d/udev-mount. I have sent an email to lkml to ask for sure whether the kernel creates this symlink. (In reply to comment #27) > (In reply to comment #26) > > On my system I have /dev/root in /proc/mounts, but not in /etc/fstab. I use > > ext4 as a root fs, udev-194 and openrc-0.9.9.3. > > And which version of udev-init-scripts? =sys-fs/udev-init-scripts-16 > > My kernel is configured to support and mount devtmpfs, that is where > > /dev/root is created in the first place: > > CONFIG_DEVTMPFS=y > > CONFIG_DEVTMPFS_MOUNT=y > > just to be remounted and removed later by all-the-clever udev. > > No. udev-init-scripts does not attempt to remount /dev if you have > config_devtmpfs_mount=y. To see that, look in /etc/init.d/udev-mount. Than I have no idea what removes /dev/root. According to /proc/mounts it was definitely there during mount process. Here is the thread I started on lkml: https://lkml.org/lkml/2012/10/12/483 (In reply to comment #29) > Than I have no idea what removes /dev/root. According to /proc/mounts it was > definitely there during mount process. Are you using an initramfs? If you are not, comment #4 above applies. In other words, /dev/root appearing in /proc/mounts is a left-over from the hidden device that the kernel uses to mount the rootfs. Another thing to consider is /usr/src/linux/Documentation/devices.txt. See the section on "Locally defined links". Note that all of these links are *optional*, so if software is relying on them, this is a bug in the software. (In reply to comment #31) > (In reply to comment #29) > > Than I have no idea what removes /dev/root. According to /proc/mounts it was > > definitely there during mount process. > > Are you using an initramfs? If you are not, comment #4 above applies. In > other words, /dev/root appearing in /proc/mounts is a left-over from the > hidden device that the kernel uses to mount the rootfs. No, I don't use initramfs, so this is my case. (In reply to comment #32) > Another thing to consider is /usr/src/linux/Documentation/devices.txt. See > the section on "Locally defined links". > > Note that all of these links are *optional*, so if software is relying on > them, this is a bug in the software. In my case quota doesn't depend on /dev/root, but depends on /proc/mounts which contain non-existent /dev/root, this confuses quota tools, because they can't access mounted device mentioned in /proc/mounts! So either symlink should exist, or /dev/root should not be mentioned in /proc/mounts. (In reply to comment #33) > So either symlink should exist, or /dev/root should not be mentioned in > /proc/mounts. Ideally, /dev/root should not be mentioned in /proc/mounts. I wrote a script that walks through /proc/mounts and ignores the line mentioning "/dev/root" as the device name. There is also a line mentioning "rootfs" as the device name which needs to be ignored. If you ignore both of those lines, you can still find the root file system in /proc/mounts. I am going to re-open the quotatools bug, because I think the best fix is for quotatools to ignore /dev/root. (In reply to comment #34) > (In reply to comment #33) > > So either symlink should exist, or /dev/root should not be mentioned in > > /proc/mounts. > > Ideally, /dev/root should not be mentioned in /proc/mounts. Well I suggest you hack up a kernel patch for that then since the kernel uses /dev/root a whole lot. (In reply to comment #35) > Well I suggest you hack up a kernel patch for that then since the kernel > uses /dev/root a whole lot. You mean like [1] or [2]? [1] https://bugs.gentoo.org/175243#C11 [2] https://bugs.gentoo.org/175243#C12 You probably know these patches better than I would, so would you please update them and see about getting them into the kernel? Thanks, William To clarify something, I did not mean any sarcasm or nasty tone at all by that last comment. I am just asking you to confirm that's what you meant, and, since you know the patches best, if you would follow up with them. Thanks, William I spoke with Cardoe on irc, and we both agreed that this is really a kernel issue. I am closing this bug as invalid for that reason and moving everything to #438380. If you are following this bug and want to continue following the work on it, add yourself to the cc list for that bug. /dev/root is created again by >=sys-fs/udev-init-scripts-25. It's temporary until everything has been ported away from it: grub:0, quota, nilfs-utils, ... So resolution INVALID doesn't really match anymore, changing to FIXED -> |