FS#25659 - [udev] /dev/root symlink is not created
Attached to Project:
Arch Linux
Opened by Paride Legovini (torn) - Thursday, 18 August 2011, 22:44 GMT
Last edited by Tom Gundersen (tomegun) - Friday, 26 August 2011, 16:20 GMT
Opened by Paride Legovini (torn) - Thursday, 18 August 2011, 22:44 GMT
Last edited by Tom Gundersen (tomegun) - Friday, 26 August 2011, 16:20 GMT
|
Details
The /dev/root symlink to the the actual device mounted as
the root filesystem is not created. In this way one ends
with a broken mount output, e.g.
% mount /dev/root on / type ext4 (rw,relatime,barrier=1,data=ordered) [...] where /dev/root does not exist. This breaks any script that relies on mount to find the root filesystem device, for example grub-mkconfig: # grub-mkconfig /sbin/grub-probe: error: cannot stat `/dev/root'. For comparison in Debian there's an udev rule (/lib/udev/write_dev_root_rule) that created the /dev/root symlink. Just in case it matters I'm running Linux-3.0.3 without an initramfs/initrd. |
This task depends upon
Closed by Tom Gundersen (tomegun)
Friday, 26 August 2011, 16:20 GMT
Reason for closing: Won't fix
Additional comments about closing: The problems described should be fixed in other packages. Adding /dev/root is not the solution.
Friday, 26 August 2011, 16:20 GMT
Reason for closing: Won't fix
Additional comments about closing: The problems described should be fixed in other packages. Adding /dev/root is not the solution.
It caused more issues than it helped, imho.
So how do I deal with the programs that look for /dev/root? For example grub-mkconfig doesn't work for me at the moment, as I wrote in the bug description.
I can reproduce the problem (running without the initrd). I fear this has to be fixed in the kernel, as /dev/root does not seem to make much sense to me.
May devtmpfs give a solution?
I'm able to reproduce with devtmpfs (by the way, if you are not using devtmpfs, you should. /dev on tmpfs is hardly tested anymore and is known to be suboptimal).
What in my opinion is really bad is that at the moment it isn't possible in Arch Linux to use a kernel without an initrd and have grub.cfg created by the standard tools. I have to write it by hand. I also find strange that this issue is not mentioned in the kernel compiling howto page on bbs.archlinux.org.
What happens in Debian if /dev/root points to /dev/sda1 and that /dev/sdb1 is another partition, and you then do:
mount /dev/sdb1 /mnt
mount --bind /dev /mnt/dev
chroot /mnt /bin/bash
ls -l /dev/root
?
I think it was something with dbus.
/dev/root is used if is the kernel that mounts root filesystem from block device [init/do_mounts.c] or from ramdisk block device [init/do_mounts_rd.c], /dev/root is created by the kernel in rootfs (is not a symlink). In other words if not initramfs mechanism is used to mount root [init/initramfs.c] like in Arch Linux.
Anyway using or not using devtmpfs does not care, /dev/root node will not exists (neither if devtmpfs is automatically mounted by kernel).
The question is: why this /dev/root is not created in devtmpfs when main namespace is created [init/do_mounts.c]? I do not know. Maybe because devtmpfs_mount always return 0 if not supported and also 0 if supported but not mounted automatically. Maybe because create such node will be out-of-control from devtmpfs or does not fit in the devtmpfs logic. Maybe mounting root via kernel is deprecated for general purpose (crossing fingers). I think that Kay Sievers (devtmpfs and udev author) give the right answer here. I am just guessing!
As you suggested I'll file a bug report for grub too. I'm not sure that's the right place where to fix the issue, but at least they should be aware of it.
I never added myself to that discussion, but the only reason for having
a /dev/root is because it shows up in the mount output. Without
a /dev/root symlink, hal would be unable to detect what device was the
root device.
As hal is dead and /dev/root doesn't show up in standard mount output,
it's no longer required and we decided to kill it. I think it was killed
during the udev rules cleanup, as it required special udev rules to get
it working.
Regards,
Jan
You can create a minimal one using mkinitcpio with /etc/mkinitcpio.conf containing only
HOOKS="base"
@Tom: That will works if Paride has initramfs support. (For example I do not have it enabled)
@djgera: thank you for the suggestion on putting the symlink in /lib/udev/devices/, I'll try that.