You are not logged in.

#1 2014-07-07 15:59:00

earlz
Member
Registered: 2010-07-11
Posts: 39

df reports 380G of space used, du reports 200G of space used

Hello, I'm aware of the many differences between df and du, and how it can skew numbers a bit between them. However, I have an XFS volume that has a huge amount of skew. du -h reports everything as using 200G of space, while df -h reports 380G of space. This volume has been used to hold very large files (VM harddrive images), if that may cause such a problem. I need to know why the numbers are so far apart, and also which one actually indicates how much space I can use. If I try to create a 250G file, would it fail or succeed?

Offline

#2 2014-07-07 16:13:53

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: df reports 380G of space used, du reports 200G of space used

Maybe try du with the --apparent-size flag.

FTR I've never used it; I thought your VM disk images could be sparse files and it came up when I searched the du manpage for 'sparse'.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2014-07-07 16:16:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: df reports 380G of space used, du reports 200G of space used

Does this fs has some special tools for measuring the used space?
http://unix.stackexchange.com/questions … -the-files

Offline

#4 2014-07-07 16:17:33

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,367

Re: df reports 380G of space used, du reports 200G of space used

Are his volumes on different partitions?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2014-07-07 16:44:43

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: df reports 380G of space used, du reports 200G of space used

Give ncdu a try, and see what difference (if any) is shown for the values of "Total disk usage" and "Apparent size".

Offline

#6 2014-07-07 19:48:32

earlz
Member
Registered: 2010-07-11
Posts: 39

Re: df reports 380G of space used, du reports 200G of space used

alphaniner wrote:

Maybe try du with the --apparent-size flag.

FTR I've never used it; I thought your VM disk images could be sparse files and it came up when I searched the du manpage for 'sparse'.


I tried --apparent size. That says 229G, so a bit closer to expected. Also, some VM disk images are not sparse purposefully. if a disk image is not sparse, and fairly unfragmented on disk, then you gain a major performance advantage with VM disk performance

ncdu reports similar to du with apparent size. It reports both apparent size of 228.8G and total disk usage of 228.4G

Offline

Board footer

Powered by FluxBB