LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-13-2019, 03:24 PM   #1
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 13.1,13.37,14.0,14.1,14.2 64 and 32bit and arm
Posts: 299

Rep: Reputation: 78
Question /dev/root missing in slackware>13.1


I have slackware 14.2 with the 4.19.14 kernel from current.
Code:
df -BM
lists all the partitions with space in MB
Code:
/dev/root        201459M  10713M   180491M   6% /
devtmpfs          15789M      0M    15789M   0% /dev
tmpfs             15825M      1M    15824M   1% /run
tmpfs             15825M      0M    15825M   0% /dev/shm
cgroup_root       15825M      0M    15825M   0% /sys/fs/cgroup
/dev/nvme0n1p1   938773M 129568M   761496M  15% /emails
/dev/sda3        453442M 157735M   272652M  37% /sharedfiles
/dev/sdb1       1922734M     68M  1824975M   1% /backup
cgmfs                 1M      0M        1M   0% /run/cgmanager/fs
it shows filesystem /dev/root mounted at /
however,
Code:
ls /dev/r*
gives
Code:
/dev/ram0   /dev/ram12  /dev/ram2  /dev/ram6  /dev/random
/dev/ram1   /dev/ram13  /dev/ram3  /dev/ram7  /dev/rfkill
/dev/ram10  /dev/ram14  /dev/ram4  /dev/ram8  /dev/rtc
/dev/ram11  /dev/ram15  /dev/ram5  /dev/ram9  /dev/rtc0
and there is no /dev/root device shown.
There are not there with the 4.4.19 or 4.4.144 kernel either. in various version of slackware (13.1,14.2) it showed /dev/root instead of the actual device and i use
Code:
ls -l /dev/root|awk '{print "/dev/" $NF}'
to get the actual device, but the /dev/root link seems to be missing in newer versions of slackware. (obviously I know what partiton root is really on - /dev/sda1 ) but I need a reliable programatic way of getting that partition. I suppose I could use
Code:
mount|grep "on / "|awk '{print $1)'
but it is disconcerting that /dev/root seems to have disappeared, even though it is refered to in the output of
Code:
df -l
 
Old 01-13-2019, 04:14 PM   #2
ehartman
Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 301

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by timsoft View Post
there is no /dev/root device shown.
As far as I know it never has been part of the /dev (udev) tree, /dev/root is a pseudo device, built INTO the kernel itself, so that it can access the root fs to load init etc. In earlier days you could even encode the actual root device into the kernel with the rdev command, nowadays the boot loader mostly does that for you.
For instance lilo uses the 'root=' clause in the config file to pass that value TO the kernel.
As the boot progresses rc.S tries to change the /dev/root into the real device with
Code:
# Add entry for / to /etc/mtab:
/sbin/mount -f -w /
which is essentially a fake mount (-f).
 
1 members found this post helpful.
Old 01-13-2019, 06:17 PM   #3
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 13.1,13.37,14.0,14.1,14.2 64 and 32bit and arm
Posts: 299

Original Poster
Rep: Reputation: 78
in 13.1 it was a link to the actual /dev/partition which was what my original script for reporting free space was based on.
it's a pity that df treats root differently than the other mounts and doesn't show the actual partition. I guess / is always mounted so I'll just pull the actual dev from mount instead as I mentioned.
thanks for the explanation.
 
Old 01-14-2019, 03:04 AM   #4
ehartman
Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 301

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by timsoft View Post
in 13.1 it was a link to the actual /dev/partition which was what my original script for reporting free space was based on.
it's a pity that df treats root differently than the other mounts and doesn't show the actual partition. I guess / is always mounted so I'll just pull the actual dev from mount instead as I mentioned.
thanks for the explanation.
In my system df does show the actual partition. I think that if /dev/root IS present, even as a link, mount etc might be confused into thinking it is an actual device. I did have cases where / was reported as being mounted on /dev/root so maybe that's why the udev rule to create that link was removed after 13.1
But especially with an initrd or with an encrypted root fs (LUKS) /dev/root changes from meaning during the boot process and - my opinion - it is best for the root fs to point to the actual partition, logical volume or whatever, both in df and in mount tables.

BTW: an initrd (or initramfs) is needed when the root fs cannot be determined directly by the kernel, /dev/root then points to the "in RAM /" and software there will do its best to make the real root fs available.
Examples are
Code:
specifying it "by uuid" or "by label" - udev has to be started to resolve that
it being on a LVM logical volume, the lvmtab has to read and the mapper activated
software RAID mirroring - I believe dm will choose ONE of the disks then
LUKS encryption - the decrypting software has to be activated first
and probably quite a few things I cannot remember right now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pseudo terminals: /dev/ptmx <-> /dev/pts/ vs. /dev/ptyp <-> /dev/ttyp rtspitz Linux - Software 2 12-02-2011 03:07 PM
/dev/audio, /dev/dsp and /dev/mixer missing in Debian Etch 1337_penguin Debian 2 04-11-2007 12:33 PM
/dev/cdrom links to /dev/sg0 instead of /dev/sr0 -why? Yalla-One Slackware 3 10-01-2006 08:02 PM
/dev/tty0, /dev/tty1, /dev/tty10...and so on...which should be used for a device ??? b0nd Slackware 2 04-02-2006 09:14 AM
I cannot access EITHER CD drive! And there's no /dev/hdc or /dev/hdd or /dev/cdrom! Dmalic Linux - Hardware 13 11-18-2005 08:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration