mgrddsj
February 19, 2020, 10:56am
1
Hi, I bought a hard drive and formatted it to Btrfs in order to make it a NAS server.
Btrfs has this nice feature to automatically defrag the hard drive, and it can be turned on in the mounting option.
(See #2 in https://www.thegeekdiary.com/how-to-tune-btrfs-filesystem-for-better-performance/ )
My question is, is this option enabled by default in dietpi-drive_manager? Or do I have to manually mount the drive to enable that option?
Hi,
I donāt think it will be added by default.
However you could use Drive Manager to mount your hdd and check mount options afterwards on /etc/fstab and try to add your option if needed.
Indeed not added by default currently, also not applicable on non-spinning drives, but good to know this exists. Edit /etc/fstab for now, but note that or is overwritten on every drive manager run.
Iāll add the option to v6.29, either as default on spinning drives or optional to toggle in UI.
mgrddsj
February 23, 2020, 10:01am
4
Indeed not added by default currently, also not applicable on non-spinning drives, but good to know this exists. Edit /etc/fstab for now, but note that or is overwritten on every drive manager run.
Iāll add the option to v6.29, either as default on spinning drives or optional to toggle in UI.
Thank you very much for replying!
Iām so excited to see it in future updates!
I read a bid through some man pages and actually autodefrag on BTRFS seems to be generally not recommended currently due to CPU usage and caching that is done and especially with large files. Iāll definitely add it as non-default option only with link to related man pages and recommendations.
Do you face any issues that you want this option?
mgrddsj
February 24, 2020, 9:23am
6
I read a bid through some man pages and actually autodefrag on BTRFS seems to be generally not recommended currently due to CPU usage and caching that is done and especially with large files. Iāll definitely add it as non-default option only with link to related man pages and recommendations.
Do you face any issues that you want this option?
I didnāt face any issues yet, but Iām dealing with a HDD and thought defrag may make it perform better.
WarHawk
February 24, 2020, 10:47am
7
Will the command line defragment it?
https://docs.oracle.com/en/operating-systems/oracle-linux/7/admin/ol7-use-case1-btrfs.html
I guess it would be the mount point
btrfs filesystem defragment filesystem_name
Also read up on itā¦until the drive/drives get really full does it really start causing fragmentation
https://serverfault.com/questions/519852/does-btrfs-balance-also-defragment-files
I ran the command on my Orange Pi PC running openmediavault with a 1TB laptop drive
btrfs balance start /srv/drive~~~~
Just make sure you run it on a mounted btrfs filesystem
Here are the āgotchasā on a btrfs system
https://btrfs.wiki.kernel.org/index.php/Gotchas#Fragmentation
https://btrfs.wiki.kernel.org/index.php/UseCases#How_do_I_defragment_many_files.3F
mgrddsj
February 26, 2020, 2:15pm
8
Yeah it seems like that commands works. Good enough for me. And according to those āgotchasā, I guess Iāll do it manually when necessary. Thanks for the reply and suggestions!