1

I deleted a big extended partition containing an ntfs logical partition with high percentage of occupied space and from that extended partition I made a new, smaller extended part. In it I created an ext4 logical partition .

The newly created ext4 logical partition however comes with 1.75 GB already occupied. I have tried deleting and recreating the partition but the occupied space just keeps coming back. I did the following to search for clues but no joy.

sudo du -h -s /media/hrmount/
20K /media/hrmount/

and

sudo du -h -a /media/hrmount
16K /media/hrmount/lost+found
20K /media/hrmount/

and

sudo du -h -a /media/hrmount/lost+found/
16K /media/hrmount/lost+found/

the commands might seem redundant but I'm just blindly trying to figure this out.

I also ran :

fsck -V /dev/sdb5
fsck from util-linux 2.20.1
[/sbin/fsck.ext4 (1) -- /media/hrmount] fsck.ext4 /dev/sdb5 
e2fsck 1.42 (29-Nov-2011)
/dev/sdb5: clean, 11/6553600 files, 459349/26214400 blocks

and the relevant output from df -h

/dev/sdb5       100G  1.7G   94G   2% /media/hrmount

I am quite sure that I will get rid of that occupied space by formatting the partition but what i want to know is what is causing that occupied space in also what it actually contains. Please help me find more clues to solve this puzzle. Thank you.

2

The used space reported by df is reserved space. This reserved space is used by ext filesystems to prevent data fragmentation as well as to allow critical applications such as syslog to continue functioning when the disk is "full". You can view information about the reserved space using the tune2fs command:

# tune2fs -l /dev/mapper/newvg-root 
tune2fs 1.42.5 (29-Jul-2012)
Filesystem volume name:   <none>
Last mounted on:          /mnt/oldroot
Filesystem UUID:          d41eefc5-60d6-4e18-98e8-d08d9111fbe0
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash 
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              3932160
Block count:              15728640
Reserved block count:     786304
Free blocks:              11086596
Free inodes:              3312928
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1020
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Tue Feb  8 16:28:29 2011
Last mount time:          Mon Dec  9 23:28:11 2013
Last write time:          Mon Dec  9 23:48:24 2013
Mount count:              19
Maximum mount count:      20
Last checked:             Tue Sep  3 23:00:06 2013
Check interval:           15552000 (6 months)
Next check after:         Sun Mar  2 22:00:06 2014
Lifetime writes:          375 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      80cf2748-584a-4fe8-ab8c-6abff528c2c2
Journal backup:           inode blocks

Here you can see that 786304 blocks are reserved and the block size is 4096. This means that 3220701184 bytes or 3GB is reserved. You can adjust the percentage of reserved blocks using the tune2fs commands (but is not recommended):

tune2fs -m 1 /dev/sdb5
  • From what I can make out of your answer then even if I format /dev/sdb5 i will still end up with a 2% occupancy by default . Is that correct? – bloys Jan 28 '15 at 3:29
  • @bloys Yes, unless you use -m 0 when creating it. Typically the default is 5%, I am not sure why it's defaulting to 2% for you. – jordanm Jan 28 '15 at 3:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.