Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Missing /dev/root
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
sirtow
n00b
n00b


Joined: 02 Nov 2013
Posts: 10

PostPosted: Sat Nov 02, 2013 5:21 pm    Post subject: Missing /dev/root Reply with quote

Hi, i read about /dev/root not to be used but i have one application that relies on existence of that link so i was looking for a way to make this link to be created at boot time.
I have udev 204 and i turned on the
Code:
rc_dev_root_symlink="YES"
in /etc/conf.d/udev but seems its not working...

I can see that udev rule defined in
Code:
/lib/udev/dev-root-link.sh
is being created but the actual link is not being created in dev ...

Was wondering if anyone can direct me where to dig...
i have vanilla kernel 3.10.9
and my emerge --info :
Code:

Portage 2.1.11.62 (default/linux/amd64/13.0, gcc-4.4.3, glibc-2.12.2, 3.10.9 x86_64)
=================================================================
System uname: Linux-3.10.9-x86_64-Intel-R-_Core-TM-_i3_CPU_540_@_3.07GHz-with-gentoo-2.2
KiB Mem:     4040836 total,     58320 free
KiB Swap:    4008212 total,   4008212 free
Timestamp of tree: Sat, 02 Nov 2013 06:15:01 +0000
ld GNU ld (GNU Binutils) 2.21
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.6.5-r2, 2.7.3-r3, 3.1.2-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.9.6-r3, 1.11.1, 1.12.6
sys-devel/binutils:       2.21
sys-devel/gcc:            4.4.3-r2, 4.5.2
sys-devel/gcc-config:     1.4.1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.lug.udel.edu/pub/gentoo/ http://mirror.datapipe.net/gentoo"
LANG="en_US.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
Back to top
View user's profile Send private message
SamuliSuominen
Retired Dev
Retired Dev


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Sun Nov 03, 2013 9:46 am    Post subject: Re: Missing /dev/root Reply with quote

sirtow wrote:
Hi, i read about /dev/root not to be used but i have one application that relies on existence of that link so i was looking for a way to make this link to be created at boot time.
I have udev 204 and i turned on the
Code:
rc_dev_root_symlink="YES"
in /etc/conf.d/udev but seems its not working...

I can see that udev rule defined in
Code:
/lib/udev/dev-root-link.sh
is being created but the actual link is not being created in dev ...

Was wondering if anyone can direct me where to dig...
i have vanilla kernel 3.10.9
and my emerge --info :
Code:

Portage 2.1.11.62 (default/linux/amd64/13.0, gcc-4.4.3, glibc-2.12.2, 3.10.9 x86_64)
=================================================================
System uname: Linux-3.10.9-x86_64-Intel-R-_Core-TM-_i3_CPU_540_@_3.07GHz-with-gentoo-2.2
KiB Mem:     4040836 total,     58320 free
KiB Swap:    4008212 total,   4008212 free
Timestamp of tree: Sat, 02 Nov 2013 06:15:01 +0000
ld GNU ld (GNU Binutils) 2.21
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.6.5-r2, 2.7.3-r3, 3.1.2-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.9.6-r3, 1.11.1, 1.12.6
sys-devel/binutils:       2.21
sys-devel/gcc:            4.4.3-r2, 4.5.2
sys-devel/gcc-config:     1.4.1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.lug.udel.edu/pub/gentoo/ http://mirror.datapipe.net/gentoo"
LANG="en_US.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"


rc_dev_root_symlink="YES" is the *default* so removing the # and leaving it to YES won't change anything, as the purpose of the line in the /etc/conf.d/udev is to allow people to set rc_dev_root_symlink="NO" if they want

is /run mounted as tmpfs? check by `mount | grep /run`

is udev in the sysinit runlevel? check by `rc-update show | grep udev`

does running /lib/udev/dev-root-link.sh by hand as root create /run/udev/rules.d/61-dev-root-link.rules?

and you are not using BTRFS as filesystem? that filesystem in particular would be incompatible with /dev/root symlink and thus be skipped

once the dev-root-link.sh has created /run/udev/rules.d/61-dev-root-link.rules, then running `udevadm trigger` as root will create /dev/root symlink without booting

what is the output of command `udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/`? for me it shows, using EXT4 and /dev/sda1 as my root:
Code:

# udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/
ROOT_MAJOR=8
ROOT_MINOR=1
Back to top
View user's profile Send private message
sirtow
n00b
n00b


Joined: 02 Nov 2013
Posts: 10

PostPosted: Sun Nov 03, 2013 6:30 pm    Post subject: Reply with quote

Thanks for thereply ssuominen. I tried to answer your question below. Seems that all is setup ok but at the end its not working...

Quote:
is /run mounted as tmpfs? check by `mount | grep /run`

Code:
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)

Quote:
is udev in the sysinit runlevel? check by `rc-update show | grep udev`

Code:
                 udev |                                        sysinit
           udev-mount |                                        sysinit

Quote:
does running /lib/udev/dev-root-link.sh by hand as root create /run/udev/rules.d/61-dev-root-link.rules?

Yes it does :
Code:

pluto ~ # ls -l /run/udev/rules.d/61-dev-root-link.rules
-rw-r--r-- 1 root root 92 Nov  2 13:23 /run/udev/rules.d/61-dev-root-link.rules


Quote:
and you are not using BTRFS as filesystem?

Code:

pluto ~ # mount
rootfs on / type rootfs (rw)
/dev/root on / type xfs (rw,noatime,attr2,inode64,noquota)


Quote:
once the dev-root-link.sh has created /run/udev/rules.d/61-dev-root-link.rules, then running `udevadm trigger` as root will create /dev/root symlink without booting

Yes, this is my expectation... but its not happening. i dont get root created under dev after boot nor by manually running the trigger :(

Quote:
what is the output of command `udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/`?


Code:
pluto ~ # udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/
ROOT_MAJOR=8
ROOT_MINOR=3


Also the content of the generated rule file :
Code:
ACTION=="add|change", SUBSYSTEM=="block", ENV{MAJOR}=="8", ENV{MINOR}=="3", SYMLINK+="root"
Back to top
View user's profile Send private message
sirtow
n00b
n00b


Joined: 02 Nov 2013
Posts: 10

PostPosted: Sun Nov 03, 2013 6:52 pm    Post subject: Reply with quote

Not sure if im right, but udevadm trigger triggers action=change and subsytem acpi/input...
I tried to run
Code:
udevadm trigger --action=change --subsystem-match=block

and it produce no log whatsoever from udevd...
Im still puzzled what is going on with my system...

Update
As suggested on stackexchange for similar problem (rules not fired) i tried :
Code:
echo change  > /sys/block/sda/sda3/uevent

and link created :
Code:

seq 5320 queued, 'change' 'block'
seq 5320 forked new worker [16482]
seq 5320 running
no db file to read /run/udev/data/b8:3: No such file or directory
device 0x22f22d0 has devpath '/block/sda'
device 0x22f22d0 filled with db file data
LINK 'disk/by-id/scsi-35000c500455c29d9-part3' /lib64/udev/rules.d/60-persistent-storage.rules:43
IMPORT builtin 'blkid' /lib64/udev/rules.d/60-persistent-storage.rules:70
probe /dev/sda3 raid offset=0
LINK 'disk/by-uuid/8ac44b7a-fa92-4c19-b065-e637725bf107' /lib64/udev/rules.d/60-persistent-storage.rules:76
LINK 'disk/by-id/wwn-0x5000c500455c29d9-part3' /lib64/udev/rules.d/60-persistent-storage.rules:81
LINK 'root' /etc/udev/rules.d/61-dev-root-link.rules:1
handling device node '/dev/sda3', devnum=b8:3, mode=0600, uid=0, gid=0
creating symlink '/dev/block/8:3' to '../sda3'
creating link '/dev/disk/by-id/scsi-35000c500455c29d9-part3' to '/dev/sda3'
creating symlink '/dev/disk/by-id/scsi-35000c500455c29d9-part3' to '../../sda3'
creating link '/dev/disk/by-id/wwn-0x5000c500455c29d9-part3' to '/dev/sda3'
creating symlink '/dev/disk/by-id/wwn-0x5000c500455c29d9-part3' to '../../sda3'
creating link '/dev/disk/by-uuid/8ac44b7a-fa92-4c19-b065-e637725bf107' to '/dev/sda3'
creating symlink '/dev/disk/by-uuid/8ac44b7a-fa92-4c19-b065-e637725bf107' to '../../sda3'
creating link '/dev/root' to '/dev/sda3'
creating symlink '/dev/root' to 'sda3'
created db file '/run/udev/data/b8:3' for '/block/sda/sda3'
adding watch on '/dev/sda3'
created db file '/run/udev/data/b8:3' for '/block/sda/sda3'


:(
Something is wrong here...
Back to top
View user's profile Send private message
sirtow
n00b
n00b


Joined: 02 Nov 2013
Posts: 10

PostPosted: Tue Nov 05, 2013 4:05 pm    Post subject: Reply with quote

For that matter i have no links created under /dev/disk/by-XXX for any disks except LVM/md (those are ok).

Code:

ls -l /sys/block/ | grep -v "ram\|loop"
total 0
drwxr-xr-x 7 root root 0 Nov  3 16:12 dm-0
drwxr-xr-x 7 root root 0 Nov  3 16:12 md0
drwxr-xr-x 9 root root 0 Nov  3 16:12 sda
drwxr-xr-x 6 root root 0 Nov  3 16:12 sdb
drwxr-xr-x 6 root root 0 Nov  3 16:12 sdc
drwxr-xr-x 8 root root 0 Nov  3 16:12 sdd
drwxr-xr-x 6 root root 0 Nov  3 16:12 sde
drwxr-xr-x 6 root root 0 Nov  3 16:12 sdf
drwxr-xr-x 8 root root 0 Nov  4 19:38 sdg
drwxr-xr-x 6 root root 0 Nov  3 16:12 sr0


and

Code:

ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 10 Nov  3 16:12 dm-name-vg1-vol1 -> ../../dm-0
lrwxrwxrwx 1 root root 10 Nov  3 16:12 dm-uuid-LVM-v4fAsUonyeAcr7XPJJrQFL8rfPq9ictZJuUHndI6qzpXlleXLkVorsuaFUXDtLz0 -> ../../dm-0
lrwxrwxrwx 1 root root  9 Nov  3 16:12 md-name-pluto:0 -> ../../md0
lrwxrwxrwx 1 root root  9 Nov  3 16:12 md-uuid-e26f4884:36659c94:47180bec:6c959c54 -> ../../md0


Any ideas?
Back to top
View user's profile Send private message
sirtow
n00b
n00b


Joined: 02 Nov 2013
Posts: 10

PostPosted: Tue Nov 05, 2013 9:55 pm    Post subject: Reply with quote

Went little bit further and enabled udev monitoring and logging.
I can see lvm/md related events in log but not to any other ...
Code:

grep "queued.*block" /var/log/messages -A5
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    8.973403] udevd[1248]: seq 1739 queued, 'change' 'block'
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    8.973423] udevd[1248]: passed 183 bytes to netlink monitor 0x7a23a0
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    8.973511] udevd[1269]: seq 1739 running
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    8.973612] udevd[1269]: no db file to read /run/udev/data/b9:0: No such file or directory
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    8.973669] udevd[1269]: handling device node '/dev/md0', devnum=b9:0, mode=0600, uid=0, gid=0
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    8.973679] udevd[1269]: creating symlink '/dev/block/9:0' to '../md0'
--
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.006236] udevd[1248]: seq 1741 queued, 'change' 'block'
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.006249] udevd[1248]: passed 183 bytes to netlink monitor 0x7a23a0
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.006266] udevd[1269]: seq 1741 running
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.006338] udevd[1269]: device 0x7b0240 filled with db file data
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.006376] udevd[1269]: IMPORT '/sbin/mdadm --detail --export /dev/md0' /lib64/udev/rules.d/64-md-raid.rules:34
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.006570] udevd[1364]: starting '/sbin/mdadm --detail --export /dev/md0'
--
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568211] udevd[1248]: seq 1743 queued, 'add' 'block'
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568217] udevd[1269]: seq 1742 running
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568222] udevd[1248]: passed 184 bytes to netlink monitor 0x7a23a0
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568268] udevd[1269]: no db file to read /run/udev/data/+bdi:253:0: No such file or directory
[Nov  5 15:52:40][pluto][kernel][06][kern][info] [    9.568284] bio: create slab <bio-1> at 1
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568326] udevd[1269]: passed -1 bytes to netlink monitor 0x7c4a80
--
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568420] udevd[1248]: seq 1744 queued, 'change' 'block'
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568428] udevd[1270]: no db file to read /run/udev/data/b253:0: No such file or directory
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568451] udevd[1270]: GROUP 6 /lib64/udev/rules.d/50-udev-default.rules:50
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568474] udevd[1270]: handling device node '/dev/dm-0', devnum=b253:0, mode=0660, uid=0, gid=6
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568481] udevd[1270]: set permissions /dev/dm-0, 060660, uid=0, gid=6
[Nov  5 15:52:40][pluto][][1f][daemon][debug]    9.568498] udevd[1270]: creating symlink '/dev/block/253:0' to '../dm-0'



Why no events are being generated for rest of my sata disks?
Back to top
View user's profile Send private message
SamuliSuominen
Retired Dev
Retired Dev


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Mon Nov 11, 2013 1:48 pm    Post subject: Reply with quote

sirtow wrote:

Update
As suggested on stackexchange for similar problem (rules not fired) i tried :
Code:
echo change  > /sys/block/sda/sda3/uevent

:(
Something is wrong here...


I don't get it -- the kernel should change the uevent, echoing in by hand to /sys doesn't seem right at all. If I had to guess, there is some misconfiguration in your kernel itself.

http://www.mpipks-dresden.mpg.de/~mueller/docs/suse10.1/suselinux-manual_en/manual/sec.udev.kernel.html

If you find the reason for this behavior, please let me know here so I can do, if required, any adjustments in the /dev/root creating process itself. Perhaps there is some simple kernel CONFIG_ check missing from eg. udev's ebuild.
You have verified emerging sys-fs/udev doesn't print out any missing kernel opt messages?
Back to top
View user's profile Send private message
sirtow
n00b
n00b


Joined: 02 Nov 2013
Posts: 10

PostPosted: Mon Nov 11, 2013 8:07 pm    Post subject: Reply with quote

At the end it was two configuration parameters that were miss configured :

  • Probe all LUNs on each SCSI device - Cause the missing sd* entires to appear under /dev
  • CONFIG_SYSFS_DEPRECATED - It was set to "y" causing problems with udev 204. Un-setting it triggered relevant rules and creation /dev/root and rest of links udner /dev/disk ...

So at the end it was my upgrade process of kernel + udev that lead to the problem... I updated the kernel first (while keeping deprecated flag on) but didn't remove it after updating udev...

Thanks for spending your time ssuominen.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum