df listings

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Sep 21 19:48:16 UTC 2004


On Tue, Sep 21, 2004 at 03:42:41PM -0400, Chris F.A. Johnson wrote:
> 
>      Last year, with Mandrake 9.2, the output of df changed from:
> 
> Filesystem            1024-blocks      Used  Available  Capacity Mounted on
> /dev/hda1                 1921156   1596468     227096       88% /
> /dev/hda4                15417532   7686384    6947980       53% /data
> /dev/hda6                 1383520    259964    1053276       20% /home
> 
>      To:
> 
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/ide/host0/bus0/target0/lun0/part1
>                        1921156   1596468    227096  88% /
> /dev/ide/host0/bus0/target0/lun0/part4
>                       15417532   7686384   6947980  53% /data
> /dev/ide/host0/bus0/target0/lun0/part6
>                        1383520    259964   1053276  20% /home
> 
> 
>      I don't know whether this is a result of a change in df, or
>      something Mandrake did, or a result using devfs.

The device name change is caused by devfs (which is deprecated in 2.6
kernels from what I read, so using it is just nuts in my book).

>      How widespread is this new form? Does your distro use it?

Very few due to the many problems it causes with legacy applications
that expect certain device names.

>      I am trying to decide whether to include my "fix" in a book I am
>      writing; the book is not specifically Linux oriented, so unless
>      it is widespread, I won't bother with it.
> 
>      For those who are interested, I have this in my ~/.bashrc:
> 
> xchar="\`\'\-\> "
> fix_dev="` echo "fixdev()
> {
>    case \\\$1 in"
> stat -c "%N" /dev/hd*  | tr -s "$xchar" " " |
>    while read a b
>    do
>      printf "\t/dev/%s) fs=%s ;;\n" "$b" "$a"
>    done
> echo "   esac
> }"
> `"
> 
> eval "$fix_dev"
> unset fix_dev
> 
> df ()
> {
>     command df -P "$@" | {
>         read FS BL U A C M;
>         printf "%-20s %12s %9s %10s %9s %s\n" "${FS}" "$BL" "$U" "$A" "$C" 
>         "$M";
>         while read fs bl u a c m; do
>             fixdev $fs
>             printf "%-20s %12s %9s %10s %9s %s\n" "${fs}" "$bl" "$u" "$a" 
>             "$c" "$m";
>         done
>     }
> }

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list