df listings

Chris F.A. Johnson c.f.a.johnson-bJEeYj9oJeDQT0dZR+AlfA at public.gmane.org
Tue Sep 21 19:42:41 UTC 2004


      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.

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

      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
     }
}

-- 
 	Chris F.A. Johnson                      http://cfaj.freeshell.org
 	=================================================================
                 Everything in moderation -- including moderation
--
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