Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Here you can see two devices are mounted as root:

$ df
Filesystem                                             1K-blocks      Used Available Use% Mounted on
rootfs                                                  29221788  18995764   8761244  69% /
udev                                                       10240         0     10240   0% /dev
tmpfs                                                     203260      2192    201068   2% /run
/dev/disk/by-uuid/1d8879f2-9c47-4a72-9ef4-a6ecdd7a8735  29221788  18995764   8761244  69% /
tmpfs                                                       5120         0      5120   0% /run/lock
tmpfs                                                     406516       376    406140   1% /tmp
tmpfs                                                     406516        72    406444   1% /run/shm
/dev/sda2                                               29225884  15019636  12741264  55% /home
/dev/sda3                                              226881528 191247596  24275680  89% /opt
...

However, I didn't specify UUID in /etc/fstab:

proc            /proc           proc    defaults        0       0
LABEL=debian    /               ext4    errors=remount-ro 0       1
LABEL=istore    /mnt/istore ext4    defaults    0   0
LABEL=home  /home           ext4    defaults        0       2
...

I'd like to see mount info in "/dev/xxx" rather then "/dev/disk/by-uuid/...". Though mount by UUIDs have many advantages, but I prefer to the old style... It's also weired why there are two rootfs mount?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

This is a side effect of how the debian initramfs operates. Initially the kernel creates a tmpfs for the root, and unpacks the initramfs, which is a compressed cpio archive, there. The programs and scripts in the initramfs mount the real root device and then chroot there. Simply ignore the first entry that lists the filesystem as rootfs, as that is just the initramfs. It is the other one that is your real root filesystem.

Since /etc/fstab is in your root fs, it can not be consulted to mount your root fs, so this is done via kernel command line arguments passed by the boot loader. If you are using grub, it uses the UUID by default to avoid problems if the drives happen to be enumerated in a different order. You can edit /etc/default/grub to change this behavior, but it is not a good idea.

share|improve this answer
    
You are right, but why the initial rootfs isn't unmounted, after system boot up? –  Xiè Jìléi Jul 20 '12 at 2:29
    
@XièJìléi it can't be. From the kernel documentation initramfs is rootfs: you can neither pivot_root rootfs, nor unmount it. and Most systems just mount another filesystem over rootfs and ignore it. The amount of space an empty instance of ramfs takes up is tiny. –  Patrick Jul 20 '12 at 3:39
    
@Patrick I've checked some other Linux installs, however, rootfs doesn't show in df output.. –  Xiè Jìléi Jul 20 '12 at 6:32
    
If the first entry is the initramfs, why does df show the size of the root file system, instead of the size of the initramfs? –  Marco Jul 20 '12 at 9:24
    
@XièJìléi are you sure they're using an initramfs? –  Patrick Jul 20 '12 at 12:08
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.