Increase available disk space by decreasing the reserved blocks in extended filesytems ext2/3/4 using tune2fs
This  space by default is around 5% of the total. And considering the  amount  of hard-drive or partitions available these days, this reserved  memory  could be huge e.g. 5% of 500GB hard disk is 25GB, which is too  much  for critical cases. And this memory is only needed in the root(/)   partition and it doesn't make much sense to reserve blocks on /home   partitions or external storage devices, because privileged processes   don't usually write on home partition.
It should be noted  that this reserved space is also  used to reduce fragmentation. So, it  plays a major role in avoiding  fragmentation by preventing the disk to  be filled completely.
So,  if you think 5% of your partition/disk is more than enough for   reserved blocks then you can save some space by decreasing this amount.   You can do this by using the tune2fs utility.
[root]# tune2fs -m 3 /dev/sda1
The -m option is used to set the new percentage share, we used 3%. /dev/sda1 is my root(/) partition.
We  can set the value to 0 for home partition, assuming that you  haven't  configured any privileged process to write in /home directory. A  word of warning here, since these reserved blocks are also used to prevent fragmentation, leaving some amount is a good idea.
[root]# tune2fs -m 0 /dev/sda2
where /dev/sda2 is the home partition.
You can even check the current number of reserved blocks on a partition or disk using tune2fs.
[root]# tune2fs -l /dev/sda2 | grep -i reserve
Reserved block count: 1257387
Reserved GDT blocks: 1018
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
# tune2fs -l /dev/mapper/VolGroup00-LogVol00 | grep -i block
Block count: 8568832
Reserved block count: 428441
Free blocks: 2247916
First block: 0
Block size: 4096
Reserved GDT blocks: 1024
Blocks per group: 32768
Inode blocks per group: 512
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
Journal backup: inode blocks
[root@util100 ~]#
(428441 / 8568832) * 100 = 4.99
 
No comments:
Post a Comment