df -a
Denys Vlasenko
vda.linux at googlemail.com
Thu Feb 28 11:30:42 UTC 2008
On Wednesday 27 February 2008 18:08, Clem Taylor wrote:
> On Wed, Feb 27, 2008 at 9:41 AM, Denys Vlasenko
> <vda.linux at googlemail.com> wrote:
> > Will "find the latest line for '/'" work?
>
> The work around I initially tried was to parse /proc/cmdline and map
> 'root=[0-9a-f]+' to a device. I didn't really like doing this, so I
> just backed out the df change as a patch to my buildroot.
>
> > It was done to match coreutils.
>
> I hadn't noticed this with coreutils 6.9:
>
> $ cat /proc/mounts
> rootfs / rootfs rw 0 0
> /dev/root / xfs rw,sunit=512,swidth=1536,ikeep,noquota 0 0
> /proc /proc proc rw 0 0
> ....
>
> $ /bin/df -h
> Filesystem Size Used Avail Use% Mounted on
> /dev/md0 2.1T 1.9T 194G 91% /
> /dev/sda1 130M 41M 82M 34% /boot
> ...
Well, just built coreutils 6.9 here and:
bash-3.2# df --help 2>&1 | head -1
BusyBox v1.9.0.svn (2007-12-20 23:47:50 GMT) multi-call binary
bash-3.2# /usr/bin/df --version 2>&1 | head -1
df (GNU coreutils) 6.9
bash-3.2# df
Filesystem 1k-blocks Used Available Use% Mounted on
rootfs 964500 448052 467452 49% /
/dev/root 964500 448052 467452 49% /
/dev/sda6 15622696 6922256 8700440 44% /.share
/dev/sda7 97656112 92523936 5132176 95% /.1
/dev/sda8 171930376 141091564 30838812 82% /.2
/dev/sda6 15622696 6922256 8700440 44% /.local
bash-3.2# /usr/bin/df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 964500 448052 467452 49% /
/dev/root 964500 448052 467452 49% /
/dev/sda6 15622696 6922256 8700440 45% /.share
/dev/sda7 97656112 92523936 5132176 95% /.1
/dev/sda8 171930376 141091568 30838808 83% /.2
/dev/sda6 15622696 6922256 8700440 45% /.local
So bare "df" is the same,
bash-3.2# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 941.9M 437.6M 456.5M 49% /
/dev/root 941.9M 437.6M 456.5M 49% /
/dev/sda6 14.9G 6.6G 8.3G 44% /.share
/dev/sda7 93.1G 88.2G 4.9G 95% /.1
/dev/sda8 164.0G 134.6G 29.4G 82% /.2
/dev/sda6 14.9G 6.6G 8.3G 44% /.local
bash-3.2# /usr/bin/df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 942M 438M 457M 49% /
/dev/root 942M 438M 457M 49% /
/dev/sda6 15G 6,7G 8,3G 45% /.share
/dev/sda7 94G 89G 4,9G 95% /.1
/dev/sda8 164G 135G 30G 83% /.2
/dev/sda6 15G 6,7G 8,3G 45% /.local
and "df -h" is only cosmetically different.
I grepped through coreutils-6.9 source and found no "/dev/root"
string. Can somebody find out how coreutils df excludes /dev/root
for other people? It doesn't do that for me.
--
vda
More information about the busybox
mailing list