[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question about output from 'df'.



Claudius Hubig wrote:
> Christian Dysthe wrote:
> > When I do 'df' (or look in System Monitor) I see the following for
> > file systems:
> > /dev/disk/by-uuid/3… 10896648 5101224 5235248 50% /
> > /dev/sda5 769760 44844 684980 7% /boot
> > /dev/sda7 599139368 344433792 224264420 61% /home
> >
> > Why is /dev/sda6 indicated as 'dev/disk/by-uuid' and the other two simply
> > as /dev/sda5 and /dev/sda7? I can not remember that there has been a
> > difference between the three in the df output before.
> 
> Likely because the busybox-mount in the initramfs during initial boot
> does not dereference the symlink, whereas the later /sbin/mount in
> the fully booted system does. This is then reflected in the content
> of /proc/mounts, which is read by df.

By default grub is configured in /etc/default/grub with:

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

Which causes update-grub to create the /boot/grub/grub.cfg to contain
an entry like this:

        linux   /vmlinuz-2.6.32-5-486 root=UUID=a1a36327-0c07-4b91-a35e-0804c0a9020e ro  quiet

This comes through to the linux kernel command line.  You can see the
kernel command line with:

  $ cat /proc/cmdline
  root=UUID=a1a36327-0c07-4b91-a35e-0804c0a9020e ro 

It is parsed by the /init script in the initramfs which sets:

  ROOT="/dev/disk/by-uuid/${ROOT#UUID=}"

And on from there.  To avoid this set GRUB_DISABLE_LINUX_UUID=true in
the /etc/default/grub file and run update-grub.  That will update the
grub.cfg file.  Reboot and it will update the kernel command line
which will change the way the root filesystem is mounted.

File /etc/default/grub:

  GRUB_DISABLE_LINUX_UUID=true

The change from Squeeze to Wheezy is due to the change from /etc/mtab
being a file that tracked mounts to being a symlink to /proc/mounts.

Warning!  The reason for using UUIDs is that people move disks around
and the Linux kernel does not have a stable order for assigning device
names.  Using UUIDs is done to avoid the possibly changing disk
assignment.  Having said that I think it is always possible to arrange
the order as needed to force a particular order.  But if you don't
know what you are doing (and many postings to this mailing list are
from people who have run into this problem and don't understand it)
then you might have a system that needs to be rescued with manual
commands at the grub command line to select the correct root
filesystem.  If you only ever have one disk in your system then this
should be okay though.

Note that I had to search in order to find a machine that had this
problem since I always use LVM.  When using LVM the lvm system
internally uses uuid values but those are never exposed to the user.
The /etc/fstab contains the logical volume name /dev/mapper/vg-root or
some such and not the uuid.  With lvm you always use the lvm name and
this problem with df and uuids is avoided.  Yet another reason to make
using lvm on systems desirable.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: