tune2fs Command in Linux

Do you know that 5% of the space is reserved in your filesystem?

The logic of keeping the reserved 5% secret is so that the standard user does not take the unavailable (reserved) space into consideration. You can see the total space with tune2fs (run as root). For example:

# df /tmp

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sdd1 404727 369777 18244 96% /tmp

# tune2fs -l /dev/sdd1

tune2fs 1.32 (09-Nov-2002)

Filesystem volume name:

Last mounted on:

Filesystem UUID: 6c114425-117e-4026-90df-4068ac4b7212

Filesystem magic number: 0xEF53

Filesystem revision #: 1 (dynamic)

Filesystem features: has_journal filetype needs_recovery sparse_super

Default mount options: (none)

Filesystem state: clean

Errors behavior: Continue

Filesystem OS type: Linux

Inode count: 102408

Block count: 417658

Reserved block count: 16706

Free blocks: 34950

Free inodes: 97512

First block: 1

Block size: 1024

Fragment size: 1024

Blocks per group: 8192

Fragments per group: 8192

Inodes per group: 2008

Inode blocks per group: 251

Last mount time: Tue Dec 9 05:03:43 2003

Last write time: Tue Dec 9 05:03:43 2003

Mount count: 13

Maximum mount count: 29

Last checked: Sat Nov 29 05:23:33 2003

Check interval: 15552000 (6 months)

Next check after: Thu May 27 06:23:33 2004

Reserved blocks uid: 0 (user root)

Reserved blocks gid: 0 (group root)

First inode: 11

Inode size: 128

Journal UUID:

Journal inode: 81

Journal device: 0x0000

First orphan inode: 19

Note that tune2fs reports 417658 blocks with 34950 free blocks of which 16706 are reserved. 34950 - 16706 = 18244 which is the amount free reported by df.

Fix to this problem:

#tune2fs -r 0 /dev/file_system_name

NOTE: This command works on Linux Ext3/ext2 filesystems as tune2fs is a Linux utility to tune ext3/ext2 filesystem.

Benefits : Expected benefits can be an tuned filesystem and also a filesystem that reports correct usage stats.

Post a Comment