This strange behavior begins a few day ago. This is df of all file system
michele@OptiPlex-360:~$ df
File system 1K-blocchi Usati Disponib. Uso% Montato su
udev 1974808 8 1974800 1% /dev
tmpfs 397120 1340 395780 1% /run
/dev/sda1 45225008 14448892 28455736 34% /
none 4 0 4 0% /sys/fs/cgroup
none 5120 4 5116 1% /run/lock
none 1985596 80 1985516 1% /run/shm
none 102400 68 102332 1% /run/user
/dev/sda6 190822060 65912468 115193268 37% /media/volume1
Now I ask for sda1 and it gives me a wrong answer
michele@OptiPlex-360:~$ df /dev/sda1
File system 1K-blocchi Usati Disponib. Uso% Montato su
udev 1974808 8 1974800 1% /dev
instead sda6 works
michele@OptiPlex-360:~$ df /dev/sda6
File system 1K-blocchi Usati Disponib. Uso% Montato su
/dev/sda6 190822060 65912468 115193268 37% /media/volume1
Well, what's wrong?
Ah, same issue I have on my other PC with same Ubuntu installed.
Additional output as muru asked for:
michele@OptiPlex-360:~$ mount | grep /dev/sda1
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
michele@OptiPlex-360:~$ df /
File system 1K-blocchi Usati Disponib. Uso% Montato su
/dev/disk/by-uuid/2438603c-1bfd-4e79-9f6c-ad6575988aee 45225008 14448908 28455720 34% /
My personal explanation to this effect is the following:
df
reads/proc/self/mountinfo
file but doesn't find/dev/sda1
there.I know it reads
/proc/self/mountinfo
because when I dostrace df /dev/sda1
I get the following line in the outputNow, if we examine that file,
/dev/sda
is not there, but it does find/dev/sdb
there, which explains correct reports for those partitions.Why it's not there ? I don't know. I can only provide what I've found.
But why does it report
udev
in the output ?df
looks at filesystems, and/dev/sda1
is under/dev
folder, which is whereudev
virtual filesystem is mounted. It's the same behavior if we'd calldf FILE
, likedf /home
ordf /media/MYWINDOWSPARTITION/RANDOMFILE.txt
I would suggest reporting it as a bug or at least ask the GNU developers about this behavior (copied from man page )
Edit
In addition, the
df /
behavior is explained again by/proc/self/mountinfo
file having the following entryThe root filesystem itself is mounted as
/dev/dis/by-uuid/ACTUAL-UUID-NUMBER.
But I don't have explanation for
df
with no arguments reporting/dev/sda1
rather than the path to disk by uuid. Probably the reason is because/dev/dis/by-uuid/ACTUAL-UUID-NUMBER
itself is a symlink to/dev/sda1
, so it resolves it fully without arguments, but with arguments needs to search/proc/self/mountinfo
fileThat's normal (for the second output) as partitions are mounted by their uuid, not using device names (that's the older style) Some Linux distributions use the old style and some use the new ones. Here is a note to better explain the issue mount partitions by uuid
This mechanism protects against changing disk drive order of you swap disks inside your hardware. If you want, you can easily change this by specifying the device name in /etc/fstab.