NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Platypus69
Dec 24, 2020Luminary
Should I ever run a Defrag operation if I only every insert/append to NAS (with no Snapshots enabled
I'm back... :) Just making sure my "theory is correct", as I am not sure of the nuances with BTRFS. Do I ever need to run a Defrag operation for the use case below? All I had scheduled wa...
rn_enthusiast
Dec 24, 2020Virtuoso
StephenB wrote:
rn_enthusiast wrote:For me, it is the same as with balance. I run it only if I need to but then again, I would know if/when I need to.
Part of the puzzle here is that with BTRFS there is a big difference between free space and unallocated space. BTRFS needs enough unallocated space in order to work correctly. If it runs totally out of unallocated space, a balance might not be able to fix it.
Unfortunately, the admin UI doesn't report the amount of unallocated space - so you either need to monitor it with SSH commands, or you need to use free space as a rough proxy for unallocated space. And that is rough - what started this discussion was a volume that had ~700 GiB of free space, but no unallocated space.
I think for almost all users here, the best approach is to be generous on the amount of free space you have, and run periodic balances to make sure the system maintains enough unallocated space. Most posters don't have the linux skills and BTRFS knowledge needed to assess the health of the file system with ssh (and resolve any issues), and many of the rest simply aren't going to monitor the file system that closely (until something goes wrong).
I totally agree with everything you said. It is a good thing that the NAS allows you to "maintain" the filesystem without having to acquire deeper knowledge around it. I have a little self-made script that will pull filesystem stats every couple of weeks and dump that into a file. Admittedly, I look at the file probably every 3 months cause mostly I just forget about it :) But then again, if an issue does arise I am likely able to fix it anyway. For others it seems more reasonable with a "proactive" approach, indeed.
Sandshark
Dec 24, 2020Sensei - Experienced User
rn_enthusiast wrote:
I have a little self-made script that will pull filesystem stats every couple of weeks and dump that into a file. Admittedly, I look at the file probably every 3 months cause mostly I just forget about it :) But then again, if an issue does arise I am likely able to fix it anyway. For others it seems more reasonable with a "proactive" approach, indeed.
I do something similar every day so it's fresh when I look at it. It over-writes the old file, and it takes insignificant CPU time, so it does no harm to run more often. On a system with drive spin-down enabled, it would wake them up, so that is a consideration. Scheduling it in the same time frame as backup jobs would insure the drives are already awake. On my backup systems which only power on for backups, they even RSYNC the report to my main NAS so I don't have to power them on to check their status.
- StephenBDec 24, 2020Guru - Experienced User
Sandshark wrote:
rn_enthusiast wrote:I have a little self-made script that will pull filesystem stats every couple of weeks and dump that into a file.
I do something similar every day so it's fresh when I look at it.
It might be worth chatting about this on another thread. I've been thinking about doing something similar - setting up a cron job that runs rnutil to put the log zip file in a share, and then rsync that from my various backup NAS to the main one. I'd also want to some retention control for the logs on the backup NAS (which all run on a power schedule, so I don't actually log into them very often).
I'm also thinking that a script that backed up the OS partition to the data volume could be useful. Mount it to /mnt, zip the mount point to the data volume share, and then umount.
Of course these could also be managed with an app, though that would be a bit more work.
- SandsharkDec 24, 2020Sensei - Experienced User
StephenB wrote:It might be worth chatting about this on another thread. I've been thinking about doing something similar - setting up a cron job that runs
Started: Script-for-making-remote-NAS-diagnostics-available-locally .
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!