NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
rjbathgate
Sep 25, 2015Aspirant
Disk Space - Usage doesn't match actual
Hi, ReadyNAS 102, v 6.2.4 df -h returns: Filesystem: /dev/md127
Size: 1.9T
Used: 1.7T
Available: 186GB
Use %: 91%
Mounted on: /data (and also repeated for /home, /apps, /run/nfs4/data...
StephenB
Sep 25, 2015Guru - Experienced User
You should be using the btrfs commands for this type of analysis.
Generally the discrepancy comes from two basic sources.
One is that du doesn't account for btrfs metadata. With ext, metadata is saved in inodes, which are preallocated when the file system is created. BTRFS doesn't do that, and the amount of metadata space used is dynamic.
The other is that du ignores snapshots. Given the size of your discrepancy, I am guessing you have snapshots enabled. You should delete some of them from the web UI to free up space. One approach is to delete all the snapshots from shares that have a lot of churn (changed or deleted files - not adds or renames). Another is to delete the oldest snapshots from each share.
The way to clean up metadata is to schedule regular balance jobs (system->settings->maintenance). I run that quarterly, but if there a lot stuff changing on your NAS you might want to schedule it monthly.
rjbathgate
Sep 25, 2015Aspirant
Hi,
Thanks for your replies.
btrfs fi show /data
Label: '0e36d6d7:data' uuid: 4325b83e-28ce-4f63-9e46-a5b09379d96b
Total devices 1 FS bytes used 1.63TiB
devid 1 size 1.81TiB used 1.64TiB path /dev/md127
btrfs fi df /data
Data, single: total=1.64TiB, used=1.63TiB
System, DUP: total=8.00MiB, used=224.00KiB
System, single: total=4.00MiB, used=0.00B
Metadata, DUP: total=2.00GiB, used=1.29GiB
Metadata, single: total=8.00MiB, used=0.00BSo yes here we're seeing the full 1.7T usage.
The meta data is small enough so are we good to presume this is caused by snapshots?
Seems crazy that the snapshot system is choking the drive, essentially only allowing me to use half of the disk space as it then uses the same again for snapshots.
I currently don't have access to the GUI (remote ssh only) so is there a way I can clean things up through SSH?
Also when I've tried to clean up old snapshots through the GUi before it's an absolute pain as you have to go into each one and delete, wait, repeat, which can be very laborour if you're looking at days/weeks/months. And ideally I don't want to be having to clear through them periodically. Is there a way to a) reduce the frequency of snapshots and b) make it auto purge the oldest if disk space gets beyond, say 80%?
And, is there a way to do any of this via SSH, as I won't have access to the GUI for a few weeks, and by then it'll probably hit 100% at this rate.
Thanks heaps again,
Rob
- StephenBSep 25, 2015Guru - Experienced User
You need to use the GUI, since snapshot status is also maintained in the database. However, you can delete more than one at a time (in chrome, press the control key as you click).
The amount of space used for snapshots depends on what happens to the main share after you create them. At the moment they are created, they use no space. As files change in the main share, the original datablocks end up in the snapshots. There is a thread here that you might find helpful: https://community.netgear.com/t5/ReadyNAS-in-Business/ReadyNAS-312-Need-Help-Understanding-Snapshots/m-p/936581
Some shares simply shouldn't have snapshots enabled (for instance the folders Transmission uses for torrents).
If deleting snapshots doesn't solve your space problem, you should contact support. There have been some cases where old snapshots get "lost" by the GUI, and support needs to manually clean them. I believe in most cases they were created by an earlier firmware version, and not migrated properly.
rjbathgate wrote:
...Also when I've tried to clean up old snapshots through the GUi before it's an absolute pain as you have to go into each one and delete, wait, repeat, which can be very laborour if you're looking at days/weeks/months. And ideally I don't want to be having to clear through them periodically. Is there a way to a) reduce the frequency of snapshots and b) make it auto purge the oldest if disk space gets beyond, say 80%?
You can set the frequency of snapshots for each share in the GUI already. Automatically taken snapshots are also "thinned" so that as they get older only monthly snapshots are kept. I'd like to see an age threshold also (purge everything more then x months old), but so far Netgear hasn't provided that tool. So every month I have to go in manually and delete the oldest snapshot for each share.
The system is supposed auto-delete the oldest snapshots when the space usage exceeds 95%
- rjbathgateSep 25, 2015Aspirant
Ok thanks - I'll have to wait until I get back in front of the GUI and look at where I can disable snapshots from certain directories too.
Thanks for your help
- mdgm-ntgrSep 25, 2015NETGEAR Employee Retired
You can tunnel the port to access the UI via SSH. I do this kind of thing regularly.
In the Terminal (MAC/Linux) you could do e.g.
# ssh root@ip.address.of.nas -L 4443:localhost:443
You can also do it using e.g. PuTTY on Windows.
As for getting automatic snapshots to be pruned when usage exceeds 80% you can do this
# echo 20 > /data/._share/.snapshot_prune
Edit: auto-correct put a space in localhost that shouldn't be there.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!