On Thu, Dec 2, 2010 at 3:53 PM, Harry Putnam <rea...@newsguy.com> wrote:
> Can anyone tell me how determine what these kind of useless names
> really mean?
>
> From df -h
> Filesystem            Size  Used Avail Use% Mounted on
> rootfs                1.9G  283M  1.6G  15% /
> /dev/root             1.9G  283M  1.6G  15% /
>
> How are you supposed to tell what actual device these things are on.
>
> I know I can look in fstab... but that is something of a crap shoot
> since it is user configured.

And I think in this case it is related to the linux boot process,
where fstab doesn't even come into play yet anyway. In fact that's
probably the reason for the "makebelieve baloney" names, I would guess
(more on that later). :)

> So what commands will show real devices not makebelieve baloney, and
> allow me to see the usage devices are put to?

In addition to what others suggested (ls or readlink), you can use
stat, or you can look early-on in dmesg, for example mine shows this:
[    7.139281] EXT4-fs (sda2): mounted filesystem with ordered data
mode. Opts: (null)
[    7.153529] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.

which seems pretty conclusive. In the case of rootfs and /dev/root you
can also probably just look at your kernel commandline:
$ cat /proc/cmdline
root=/dev/sda2 doscsi raid=noautodetect rootfstype=ext4
video=uvesafb:1280x720p-59,mtrr:2,ywrap

Which shows my root device as /dev/sda2 which matches what dmesg and
ls and readlink and stat tell me.

If your root is a device-mapper array or you're booting on a diskless
machine over the network or other more "exotic" configurations maybe
this info might not be so straightforward. In my case I have a normal
PC with a non-raid boot/root drive so it's easy.

> Why do we use these kind of names anyway?

Kernel documentation sheds some light on it. Check out
/usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt in
particular. The most relevant snippet from my brief perusal:

[snip]
What is rootfs?
---------------

Rootfs is a special instance of ramfs (or tmpfs, if that's enabled), which is
always present in 2.6 systems.  You can't unmount rootfs for approximately the
same reason you can't kill the init process; rather than having special code
to check for and handle an empty list, it's smaller and simpler for the kernel
to just make sure certain lists can't become empty.

Most systems just mount another filesystem over rootfs and ignore it.  The
amount of space an empty instance of ramfs takes up is tiny.
[/snip]

Reply via email to