Link to home
Start Free TrialLog in
Avatar of ittechlab
ittechlabFlag for Canada

asked on

Linux

I just created new LV of 20G. Can some one explain what is this 173M used for? I don't have single file or directory in /mnt/test. I am trying to justify the numbers here. where is this 173M is used and want to see the output.  trying to find the math here.

[root@localhost ~]# df -h /mnt/test
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-test
                       20G  173M   20G   1% /mnt/test
Avatar of kaufmed
kaufmed
Flag of United States of America image

The overhead of maintaining a file system, I suppose. The names of each file and directory have to be stored somewhere  = )
Avatar of ittechlab

ASKER

I understand that but I am looking for the numbers. is there anyway you can show me where all this spaces are taken?
It would help if you posted the filesystem type and the command you used to create the filesystem. There's a discussion on why some filesystems reserve space here:
http://unix.stackexchange.com/questions/7950/reserved-space-for-root-on-a-filesystem-why
- e.g. ext[234] filesystems reserve 5% of space by default, to prevent ordinary users filling them and to allow defragmentation. Assuming ext[234]. check with `tune2fs -l /dev/mapper/VolGroup-test`

Depending on how the filesystem will be used, you can remove the space reservation with `tune2fs`, e.g. `tune2fs -m 0 /dev/mapper/VolGroup-test`. Though I would only do that if you expect the filesystem to only be used for "fixed size" files, e.g. Database tables or software binaries, and not if you expect large numbers of files that might grow.
The 173M is not reserved - it is used. Even though you have no directories, there is always an underlying flat file system made up of inodes. The inode tables account for the used space (along with several copies of the superblock).
Run dumpe2fs /dev/....
That will explain in a very verbose format how filesystem is laid out
[root@localhost ~]# tune2fs -l /dev/mapper/VolGroup-test
tune2fs 1.41.12 (17-May-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          6cc2ab12-3c18-480f-9828-19b9e1893393
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              1310720
Block count:              5242880
Reserved block count:     0
Free blocks:              5116558
Free inodes:              1310709
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1022
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Filesystem created:       Mon Dec 30 12:21:13 2013
Last mount time:          Thu Jan  2 15:10:39 2014
Last write time:          Thu Jan  2 15:10:39 2014
Mount count:              3
Maximum mount count:      24
Last checked:             Mon Dec 30 12:21:13 2013
Check interval:           15552000 (6 months)
Next check after:         Sat Jun 28 13:21:13 2014
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:      22f58acd-0938-45a3-a815-2953f31a3b85
Journal backup:           inode blocks
[root@localhost ~]# dumpe2fs /dev/mapper/VolGroup-test
dumpe2fs 1.41.12 (17-May-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          6cc2ab12-3c18-480f-9828-19b9e1893393
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              1310720
Block count:              5242880
Reserved block count:     0
Free blocks:              5116558
Free inodes:              1310709
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1022
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Filesystem created:       Mon Dec 30 12:21:13 2013
Last mount time:          Thu Jan  2 15:10:39 2014
Last write time:          Thu Jan  2 15:10:39 2014
Mount count:              3
Maximum mount count:      24
Last checked:             Mon Dec 30 12:21:13 2013
Check interval:           15552000 (6 months)
Next check after:         Sat Jun 28 13:21:13 2014
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:      22f58acd-0938-45a3-a815-2953f31a3b85
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke
Journal size:             128M
Journal length:           32768
Journal sequence:         0x00000008
Journal start:            0


Group 0: (Blocks 0-32767)
  Primary superblock at 0, Group descriptors at 1-2
  Reserved GDT blocks at 3-1024
  Block bitmap at 1025 (+1025), Inode bitmap at 1026 (+1026)
  Inode table at 1027-1538 (+1027)
  31223 free blocks, 8181 free inodes, 2 directories
  Free blocks: 1545-32767
  Free inodes: 12-8192

...................................continued

Group 159: (Blocks 5210112-5242879)
  Block bitmap at 5210112 (+0), Inode bitmap at 5210113 (+1)
  Inode table at 5210114-5210625 (+2)
  32254 free blocks, 8192 free inodes, 0 directories
  Free blocks: 5210626-5242879
  Free inodes: 1302529-1310720
Journal size 128M
Add all the reserved blocks from all inode groups and you are threre
can you give me other numbers other than 128mb
ASKER CERTIFIED SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
does it mean each block group is taking 6M and I have 160 block groups. (0-159). can i multiply as follows.

4K * 5210625 = ???

looks like on the Group 159 i have  Inode table at 5210114-5210625 (+2)
112-625 to be more accurate...
I am not clear . can you please explain me with all the numbers how its is calculated.
hmmm
i just pointed out that block bitmap/inode bitmap des not sound like "data"


What is "IT" you are trying to reach?

How is it done? Basically "mount" calls kernel to mount a filesystem and late reads superblocks of all inode groups and counts free and used space....