Are You Using LVM? Get 5% Extra Disk Space with This Trick!
If you have noticed that when using LVM filesystem there is a gap between total drive size and used/free space, this article is for you!
As you can see in the example below, the "/mnt/Torrent" partition is 680GB in size and 50GB of storage space is used. So I have 630GB free space, right? No. By default, LVM will reclaim 5% of the space on each partition size in case you use it all. This is relevant when it comes to the system partition. However, if not, you can safely change this 5% value to 0%, gaining in this case 34GB of extra storage.
In this case the command is:tune2fs -m 0 /dev/mapper/volgrp01-Torrent
Be sure to run it as root. It will do the job in 1-2 seconds, it doesn't require any shutdown or reboot. That's it! No more steps.
However, if you want to change this for your system partition, you may want to set this value above 0 (the number after the -m parameter).
- For partition sizes smaller than 50GB, I would not change it
- Between 50GB - 100GB to 2% for partition sizes
- and above 100GB to 1%.
If you want to know more about this command, I've copied the relevant part of the tune2fs manual:
-m reserved-blocks-percentage
Set the percentage of the filesystem which may only be allocated by privileged processes. Reserving some number of filesystem blocks for use by privileged processes is done to avoid filesystem fragmentation, and to allow system daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. Normally, the default percentage of reserved blocks is 5%.
If you need more disk space and have enough RAM, check out my article on SWAP resizing.
If you found this article useful and would like to show your appreciation, please consider making a small donation via PayPal. Your support will allow me to continue creating valuable content and make my blog even better. Thank you for your contribution!
Comments