Reserved blocks in linux
Reserved blocks are disk blocks reserved by the kernel for processes owned by privileged users to prevent operating system from a crash due to unavailability of storage space for critical processes. The default percentage of reserved block is 5 % of the total size of file system and can be increased or decreased based upon the requirement.
Example : We have 40GB in root and the situation reached 100%, all the non-privileged users processes wouldn’t able to login or write (because it’s running under nobody’) and the privileged user (root) has reserved block of 5% which will able to troubleshoot the disk space issue.
Using tune2fs command we can check the information.
root@:~# tune2fs -l /dev/md9 | grep Reserved
tune2fs 1.42.5 (29-Jul-2012)
Reserved block count: 0
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
root@~# dumpe2fs /dev/md9
The uid and gid confirm the Unix userid and Unix groupid of the user who will be allowed to tap into the reserved space.
Default block size of file system
root@linux:~# tune2fs -l /dev/sda2 | grep Block
Block count: 241966592
Block size: 4096
Blocks per group: 32768
To incerease or decrease the block size use the below command.
# tune2fs -m 0 /dev/md9