* du command on AdvFS
@ 2002-01-29 1:02 Priscilla
2002-01-29 8:57 ` Joerg Bruehe
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Priscilla @ 2002-01-29 1:02 UTC (permalink / raw)
I'm trying to find out why the du -sk command is sometimes reporting
the wrong disk usage on my directories. In my latest trial, I drilled down
and found specifically one file that was way off that was causing the whole
directory report to be off.
/archive> du -sk smith.cf
100992 smith.cf
/archive> ls -l smith.cf
-rw-rw-r-- 1 prod tspi 372203552 Jan 24 11:03 smith.cf
I tar'd the whole directory over to another fileset and now the file
size (and directory usage) are correctly reported.
/tmp/archive> du -sk smith.cf
363488
I'm running Tru64 UNIX V 5.1
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: du command on AdvFS 2002-01-29 1:02 du command on AdvFS Priscilla @ 2002-01-29 8:57 ` Joerg Bruehe 2002-01-29 10:13 ` Marre du Spam dans les news ` (2 subsequent siblings) 3 siblings, 0 replies; 7+ messages in thread From: Joerg Bruehe @ 2002-01-29 8:57 UTC (permalink / raw) Hi! Priscilla wrote: > [...] > /archive> du -sk smith.cf > 100992 smith.cf > > /archive> ls -l smith.cf > -rw-rw-r-- 1 prod tspi 372203552 Jan 24 11:03 smith.cf The buzzword is probably "sparse files", a property of _all_ Unix file systems from the very beginnings AFAIK. Regards, Joerg Bruehe -- Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany (speaking only for himself) mailto: joerg@sql.de ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: du command on AdvFS 2002-01-29 1:02 du command on AdvFS Priscilla 2002-01-29 8:57 ` Joerg Bruehe @ 2002-01-29 10:13 ` Marre du Spam dans les news 2002-01-29 11:54 ` Quarter Horseman 2002-01-31 20:30 ` Tim Mooney 3 siblings, 0 replies; 7+ messages in thread From: Marre du Spam dans les news @ 2002-01-29 10:13 UTC (permalink / raw) it s a sparse file, u can t modifie this with dd or with gnu tar oir star "Priscilla" <pdioquino@yahoo.com> wrote in message news:110fcff.0201281702.7e624109@posting.google.com... | I'm trying to find out why the du -sk command is sometimes reporting | the wrong disk usage on my directories. In my latest trial, I drilled down | and found specifically one file that was way off that was causing the whole | directory report to be off. | | /archive> du -sk smith.cf | 100992 smith.cf | | /archive> ls -l smith.cf | -rw-rw-r-- 1 prod tspi 372203552 Jan 24 11:03 smith.cf | | I tar'd the whole directory over to another fileset and now the file | size (and directory usage) are correctly reported. | | /tmp/archive> du -sk smith.cf | 363488 | | I'm running Tru64 UNIX V 5.1 | | Thanks. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: du command on AdvFS 2002-01-29 1:02 du command on AdvFS Priscilla 2002-01-29 8:57 ` Joerg Bruehe 2002-01-29 10:13 ` Marre du Spam dans les news @ 2002-01-29 11:54 ` Quarter Horseman 2002-01-29 19:07 ` Alan Rollow - Dr. File System's Home for Wayward Inodes. 2002-01-31 20:30 ` Tim Mooney 3 siblings, 1 reply; 7+ messages in thread From: Quarter Horseman @ 2002-01-29 11:54 UTC (permalink / raw) Read the AdvFS Admin manual and pay specific attention to the "Checking Free Space and Disk Usage" section as well as the sections referred to by "quotacheck" entries in the manual's index. All the manuals are online and publicly-available. QH ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: du command on AdvFS 2002-01-29 11:54 ` Quarter Horseman @ 2002-01-29 19:07 ` Alan Rollow - Dr. File System's Home for Wayward Inodes. 2002-01-30 11:41 ` Quarter Horseman 0 siblings, 1 reply; 7+ messages in thread From: Alan Rollow - Dr. File System's Home for Wayward Inodes. @ 2002-01-29 19:07 UTC (permalink / raw) In article <e6c2d89d.0201290354.117dadd@posting.google.com>, QuarterHorseman@penvillage.com (Quarter Horseman) writes: >Read the AdvFS Admin manual and pay specific attention to the >"Checking Free Space and Disk Usage" section as well as the sections >referred to by "quotacheck" entries in the manual's index. All the >manuals are online and publicly-available. The problem with this bit of advise, is that it doesn't apply to the du(1) command. df(1) yes. du(1) no. As others noted the problem is that the particular file is probably sparse; it doesn't have blocks allocated to all the space it presents. Such space reads as zeros and when written allocates space. Most file copying utilities don't know how to detect the whole and simply fill them in when the data is copied. The difference in reporting is that du(1) adds up the number of allocated blocks in files. Since this doesn't have blocks allocated for all the space, you see a difference. du(1) also won't report the space used by files that are open, but which don't have names. > >QH > -- Alan Rollow alan@nabeth.cxo.cpqcorp.net (previously .dec.com) ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: du command on AdvFS 2002-01-29 19:07 ` Alan Rollow - Dr. File System's Home for Wayward Inodes. @ 2002-01-30 11:41 ` Quarter Horseman 0 siblings, 0 replies; 7+ messages in thread From: Quarter Horseman @ 2002-01-30 11:41 UTC (permalink / raw) Thanks Alan for the correction, and my apologies to the thread/group for the foul ball. QH ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: du command on AdvFS 2002-01-29 1:02 du command on AdvFS Priscilla ` (2 preceding siblings ...) 2002-01-29 11:54 ` Quarter Horseman @ 2002-01-31 20:30 ` Tim Mooney 3 siblings, 0 replies; 7+ messages in thread From: Tim Mooney @ 2002-01-31 20:30 UTC (permalink / raw) In article <110fcff.0201281702.7e624109@posting.google.com>, Priscilla <pdioquino@yahoo.com> wrote: > I'm trying to find out why the du -sk command is sometimes reporting > the wrong disk usage on my directories. In my latest trial, I drilled down > and found specifically one file that was way off that was causing the whole > directory report to be off. > > /archive> du -sk smith.cf > 100992 smith.cf > > /archive> ls -l smith.cf > -rw-rw-r-- 1 prod tspi 372203552 Jan 24 11:03 smith.cf It's likely a sparse file. du -ks is showing you the actual amount of space the file is using, while ls is showing you how much space it would be using if there weren't big gaps in it. du is showing you how much Swiss cheese you actually have (when you account for the holes), while ls is just showing you a big block of cheese, without telling you there are big sections that don't contain any cheese. Note that AdvFS quota files are sparse files (assuming you don't have completely consecutive numeric ids), so you'll see this same behavior there. > I tar'd the whole directory over to another fileset and now the file > size (and directory usage) are correctly reported. :-) And now you have a file that's no longer sparse, so ls and du can agree. Of course, it's possibly wrecked the file (especially if the file was some type of database file), so you may be worse off than you were before. When you're going to move or archive sparse files, be sure you use a tool that correctly handles sparse files. The traditional UNIX backup tools (dump or ufsdump, and vdump for AdvFS) correctly handle sparse files. The traditional UNIX archive tools (tar, cpio, pax) generally do *not*. GNU tar has an option, `--sparse', that you can pass it, and it will correctly handle sparse files (the option may not even be needed anymore, it may handle them automatically, but old habits die hard so I still supply that option). Tim -- Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu Information Technology Services (701) 231-1076 (Voice) Room 242-J6, IACC Building (701) 231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-01-31 20:30 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2002-01-29 1:02 du command on AdvFS Priscilla 2002-01-29 8:57 ` Joerg Bruehe 2002-01-29 10:13 ` Marre du Spam dans les news 2002-01-29 11:54 ` Quarter Horseman 2002-01-29 19:07 ` Alan Rollow - Dr. File System's Home for Wayward Inodes. 2002-01-30 11:41 ` Quarter Horseman 2002-01-31 20:30 ` Tim Mooney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox