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
ittechlabLinux SupportAsked:
Who is Participating?
 
gheistConnect With a Mentor Commented:
Look in each group for for "block size" multiplied by structures used for filesystem metadata

e.g:
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)

4K*1538=6M
and so count each and every group
0
 
käµfm³d 👽Commented:
The overhead of maintaining a file system, I suppose. The names of each file and directory have to be stored somewhere  = )
0
 
ittechlabLinux SupportAuthor Commented:
I understand that but I am looking for the numbers. is there anyway you can show me where all this spaces are taken?
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
tfewsterCommented:
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.
0
 
Duncan RoeSoftware DeveloperCommented:
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).
0
 
gheistCommented:
Run dumpe2fs /dev/....
That will explain in a very verbose format how filesystem is laid out
0
 
ittechlabLinux SupportAuthor Commented:
[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
0
 
ittechlabLinux SupportAuthor Commented:
[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
0
 
gheistCommented:
Journal size 128M
Add all the reserved blocks from all inode groups and you are threre
0
 
ittechlabLinux SupportAuthor Commented:
can you give me other numbers other than 128mb
0
 
ittechlabLinux SupportAuthor Commented:
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)
0
 
gheistCommented:
112-625 to be more accurate...
0
 
ittechlabLinux SupportAuthor Commented:
I am not clear . can you please explain me with all the numbers how its is calculated.
0
 
gheistCommented:
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....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.