summary: 'du' gives different results

From: ktn@dodo.com.au
Date: Tue Mar 23 2004 - 20:57:13 EST


Thanks Terry for your quick response!

This looks like you have multiple hard links to the original files in the
directory being backed up. So each directory adds up all the hard links
in it and gets 1.7GB. But across all of them, you have files that are
only hard linked in some of the directories and not others. So, the
entire disk space that is being used is counted only once for each hard
link and comes out to about 2.7GB.

To find out which are hard links -
Use ls with a -i1. Note the first number on the line. so...
ls -i1
526503 1
532446 bin
530993 c_play
1023362 last_ticket
292932 local_sa_projects
307009 loggin_Problems
532447 mail
526500 mbox
292932 this_is_a_hard_link

Note the hard link of inode#292932 above.

Original:
>
> Dear managers,
>
> I'm really confused - hope someone can help. I did a 'du' on a directory
and
> it gives me about 3GB. But going into the directory and doing a 'du' for
the
> the many subdirectories in there gives about 2GB for each of the subdir,
> that manually adds up to be much much more. This is on Solaris 9. When I
> move the contents elsewhere however, they size starts to correspond to the
> larger one. I do not know the details of these files, but if necessary let
> me know what I should check on. Will summarise, thanks!
>
> i.e.
> webmaster:BACKUP> du -s -k -h .
> 2.7G .
> webmaster:BACKUP> du -s -k -h *
> 1.7G Backup.23Mar2004_17:06:01
> 1.7G Backup.23Mar2004_19:06:01
> 1.7G Backup.23Mar2004_21:06:01
> 1.7G Backup.23Mar2004_23:06:01
> 1.7G Backup.24Mar2004_07:06:01
> 1.7G Backup.24Mar2004_09:06:01
> 31K MOST_RECENT
> ________________________________________________
>
> Message sent using Dodo
> Internet Webmail Server
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@sunmanagers.org
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers
>
>
>
>
>

________________________________________________

Message sent using
Dodo Internet Webmail Server
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:28:20 EDT