Reserved blocks in linux

Posted: 3p in Linux

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)

or

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

Advertisements
Comments
  1. Nick says:

    In the example, reserved block count says 0, how can we resize then?

  2. Nick says:

    The example says Reserved Block Limit is 0, how can we resize then? Example also don’t deal with resizing. Could you please brief ‘ tune2fs -m 0 /dev/md9’

    • Renjith Raju says:

      Hi Nick, Here I have decreased the reserved block size to 0, if you need to increase it you can do it tune2fs -m 5 /dev/md9 “Here you have increased 5% on md9. Note don’t decrease it on root partition.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s