Solved

Linux

Posted on 2013-12-30
14
504 Views
Last Modified: 2014-01-30
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
0
Comment
Question by:ittechlab
14 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 39746828
The overhead of maintaining a file system, I suppose. The names of each file and directory have to be stored somewhere  = )
0
 

Author Comment

by:ittechlab
ID: 39746851
I understand that but I am looking for the numbers. is there anyway you can show me where all this spaces are taken?
0
 
LVL 20

Expert Comment

by:tfewster
ID: 39747225
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
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 39747681
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
 
LVL 61

Expert Comment

by:gheist
ID: 39750876
Run dumpe2fs /dev/....
That will explain in a very verbose format how filesystem is laid out
0
 

Author Comment

by:ittechlab
ID: 39752234
[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
 

Author Comment

by:ittechlab
ID: 39752245
[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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 61

Expert Comment

by:gheist
ID: 39752295
Journal size 128M
Add all the reserved blocks from all inode groups and you are threre
0
 

Author Comment

by:ittechlab
ID: 39752321
can you give me other numbers other than 128mb
0
 
LVL 61

Accepted Solution

by:
gheist earned 400 total points
ID: 39752348
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
 

Author Comment

by:ittechlab
ID: 39752702
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
 
LVL 61

Expert Comment

by:gheist
ID: 39752753
112-625 to be more accurate...
0
 

Author Comment

by:ittechlab
ID: 39793212
I am not clear . can you please explain me with all the numbers how its is calculated.
0
 
LVL 61

Expert Comment

by:gheist
ID: 39793486
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now