NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
mrQQ
Jun 19, 2015Apprentice
Please help me understand my used space
Hi,
I have 2 2TB drives in the system.
If I do `du -s /data` I get the used space as 154277424272. If I do a `df` I get used space as 1731570392. The difference is almost 200GB! Where does it go?
I have 2 2TB drives in the system.
If I do `du -s /data` I get the used space as 154277424272. If I do a `df` I get used space as 1731570392. The difference is almost 200GB! Where does it go?
22 Replies
Replies have been turned off for this discussion
- mdgm-ntgrNETGEAR Employee RetiredBecause your volume had got so full some snapshots have been deleted. You've deleted some more snapshots and now the df and du figures are closer to each other.
- mrQQApprenticeNo, not really.. When I was doing the figures, I had all the snapshots deleted. Now I deleted them all again, but still around 200GB is missing:
root@nas:~# du -s /data
1478458284 /data
root@nas:~# btrfs fi df /data -k
Data, single: total=1862118272.00KiB, used=1646336384.00KiB
System, DUP: total=32768.00KiB, used=228.00KiB
System, single: total=4096.00KiB, used=0.00KiB
Metadata, DUP: total=2621440.00KiB, used=1755064.00KiB
The reason for lowered disk usage is that I deleted some backups, however, the difference remained pretty much constant - 200GB less in all the visible files than reported usage by NAS. So where are those 200GB? :( - mdgm-ntgrNETGEAR Employee RetiredPerhaps run a defrag and then a balance now that you've deleted the snapshots.
- mrQQApprenticeI don't really see how a defrag could change space used. As for balance, I have run balance and scrub which didn't change anything?
- mdgm-ntgrNETGEAR Employee Retireddf and du are calculating space usage using different methods.
Furthermore df and du are not designed for use with BTRFS. btrfs fi df is designed for use with btrfs. - mrQQApprenticeAll that is fair and fine. I just want to understand what is using up 200GB of disk space, because NAS says I am using 1.54TB, on the other hand du says I am using 1.37TB which matches exactly what I see through windows when calculating /data /apps and /home. Sooo, I'm missing 0,17 TB, and I can accept that it's being used by system, metadata or anything else, I just want to see that number reported by any tool. So far, metadata seems to be 0,002TB. I went through all the folders found in root, eg /var /usr /etc and so on, and all these do not even take 1GB. So that's still almost 200GB missing somewhere!
- mdgm-ntgrNETGEAR Employee RetiredI've got some feedback from some colleagues.
You may find this explanation useful: http://www.spinics.net/lists/linux-btrfs/msg39960.html
df and du are using different methods to calculate how much space is used.
btrfs df is using metadata to calculate whereas df is doing a raw lookup. btrfs df can take into consideration mounted snapshots and home shares. The snapshots will take up some space and du will not show this.
du isn't a good tool to use with btrfs to see how full the filesystem is.
df doesn't know about compression on btrfs level or an unbalanced filesystem so it's not accurate. - StephenBGuru - Experienced UserThanks for posting the link; I was looking for something similar but didn't see it.
-du will tell you how much space is used by the files themselves (assuming the volume is not compressed).
-If there are no snapshots (or other use of CoW), then the difference between btrfs df and du should be the total currently unusable space (metadata, reserved by the file system, etc). However, the breakdown isn't complete enough to tell you where all the unusable space is.
-The space reporting from Windows is ultimately coming from SAMBA, and we know from other threads that is not accurate (tweaked to get optimal performance, but not-quite-correct results).
The net is that you can drive yourself crazy trying to tie all these numbers together, or you can just the imprecision. - mrQQApprenticeBut the difference is huge, it's more than 10% of filesystem which is hidden.
0 Snapshots.
2GB metadata.
1GB system.
175GB or so SOMEWHERE.
So far all the answers are "used by this or that", but what exactly is using it? Snapshots and metadata is NOT what is using the space. So what else...?? - mdgm-ntgrNETGEAR Employee Retireddf and du are very inaccurate. You shouldn't rely on those when using BTRFS.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!