Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

wrong jfs information (file system size)

Help
2010-09-22
2013-05-28
  • I have to try running nmon few version but jfs information still wrong. Please recommend how to solve it.

     
  • Hi,
    "wrong" is not a helpful comment.
    Can you share some details on what is wrong?

    Also which nmon release, which Linux version and release, please?

    Thanks Nigel

     
  • sorry for late response. I try nmon14a and 12a on RHEL 5.1-5.4 . Please let me know if you want additional information.

    best regards,
    Pao.

    example output from nmon command and press j

    │Filesystem            SizeMB  FreeMB %Used Type     MountPoint                                                                                            
    │mapper/rootvg-lvroot  1983.4   691.6  65.1 ext3     /                                                                                                     
    │/proc                                      proc     not a real filesystem                                                                                 
    │/sys                                       sysfs    not a real filesystem                                                                                 
    │/dev/pts                                   devpts   not a real filesystem                                                                                
    │mapper/rootvg-lvhome  1983.4   223.3  88.7 ext3     /home                                                                
    │/mapper/rootvg-lvtmp  1983.4  1701.0  14.2 ext3     /tmp                                                                                              
    │/mapper/rootvg-lvusr  1983.8   587.9  70.4 ext3     /usr                                                                                                  
    │/mapper/rootvg-lvvar  1983.4  1596.9  19.5 ext3     /var                                                                                                 
    │mapper/rootvg-gf3wlv  1983.4   363.6  81.7 ext3     /usr/java/glassfishv3w                                                                               
    │mapper/rootvg-gf3flv  1983.4   826.3  58.3 ext3     /usr/java/glassfishv3f                                                                               
    │/mapper/rootvg-lvopt  1983.4  1790.0   9.7 ext3     /opt                                                                                                   │
    │/mapper/rootvg-dpslv   247.9   226.5   8.6 ext3     /DPS                                                                                                   │
    │/dev/sda1              394.9   349.0  11.6 ext3     /boot                                                                                                 
    │/dev/shm                                   tmpfs    not a real filesystem                                                                                 
    │/proc/sys/fs/binfmt_misc                   binfmt_m not a real filesystem                                                                                 
    │/var/lib/nfs/rpc_pipefs                    rpc_pipe fstatfs returned zero blocks!!                                                                        
    │/mapper/rootvg-cmslv   495.8   473.7   4.5 ext3     /cms                                                                                                  
    │/mapper/rootvg-gf2lv  1983.4  1163.5  41.3 ext3     /usr/java/glassfish                                                                                   
    │er/rootvg-wconfirmlv   247.9   226.0   8.8 ext3     /webconfirm                                                                                           
    │r/rootvg-custodianlv   991.7   149.3  84.9 ext3     /SCBCustodianNetBank                                                                                  
    │apper/tempvg-lvAS400 10075.3  9658.8   4.1 ext3     /insurefile                                                                                           
    │mapper/rootvg-scislv  1983.4  1910.1   3.7 ext3     /scis

    example from df -m

    # df -m
    Filesystem           1M-blocks      Used Available Use% Mounted on
    /dev/mapper/rootvg-lvroot
                               496       323       148  69% /
    /dev/mapper/rootvg-lvhome
                               496       441        31  94% /home
    /dev/mapper/rootvg-lvtmp
                               496        71       400  16% /tmp
    /dev/mapper/rootvg-lvusr
                              1984      1396       486  75% /usr
    /dev/mapper/rootvg-lvvar
                               496        97       374  21% /var
    /dev/mapper/rootvg-gf3wlv
                               496       406        66  87% /usr/java/glassfishv3w
    /dev/mapper/rootvg-gf3flv
                               496       290       181  62% /usr/java/glassfishv3f
    /dev/mapper/rootvg-lvopt
                               496        49       422  11% /opt
    /dev/mapper/rootvg-dpslv
                                62         6        54  10% /DPS
    /dev/sda1                   99        12        83  13% /boot
    tmpfs                     1522         0      1522   0% /dev/shm
    /dev/mapper/rootvg-cmslv
                               124         6       113   5% /cms
    /dev/mapper/rootvg-gf2lv
                               496       205       266  44% /usr/java/glassfish
    /dev/mapper/rootvg-wconfirmlv
                                62         6        54  10% /webconfirm
    /dev/mapper/rootvg-custodianlv
                               248       211        25  90% /SCBCustodianNetBank
    /dev/mapper/tempvg-lvAS400
                             10076       417      9147   5% /insurefile
    /dev/mapper/rootvg-scislv
                               496        19       452   4% /scis

     
  • I have to try on nmon12a , nmon14 on RHEL5.1,5.2

    this is output from nmon12a when press j.  SizeMB is not correct.

    Filesystem            SizeMB  FreeMB %Used Type     MountPoint
    /dev/mapper/rootvg-lvroot  1983.4   691.6  65.1 ext3     /
    /proc                                      proc     not a real filesystem
    /sys                                       sysfs    not a real filesystem
    /dev/pts                                   devpts   not a real filesystem
    /dev/mapper/rootvg-lvhome  1983.4   222.0  88.8 ext3     /home
    /mapper/rootvg-lvtmp  1983.4  1511.0  23.8 ext3     /tmp
    /mapper/rootvg-lvusr  1983.8   587.9  70.4 ext3     /usr
    /dev/mapper/rootvg-lvvar  1983.4  1539.2  22.4 ext3     /var
    /dev/mapper/rootvg-gf3wlv  1983.4   312.0  84.3 ext3     /usr/java/glassfishv3w 
    /dev/mapper/rootvg-gf3flv  1983.4   819.2  58.7 ext3     /usr/java/glassfishv3f
    /dev/mapper/rootvg-lvopt  1983.4  1790.0   9.7 ext3     /opt
    /dev/mapper/rootvg-dpslv   247.9   226.5   8.6 ext3     /DPS
    /dev/sda1              394.9   349.0  11.6 ext3     /boot 
    /dev/shm                                   tmpfs    not a real filesystem
    /proc/sys/fs/binfmt_misc                   binfmt_m not a real filesystem
    /var/lib/nfs/rpc_pipefs                    rpc_pipe fstatfs returned zero blocks!!
    /dev/mapper/rootvg-cmslv   495.8   473.7   4.5 ext3     /cms
    /dev/mapper/rootvg-gf2lv  1983.4  1156.2  41.7 ext3     /usr/java/glassfish                                                                                   
    /dev/mapper/rootvg-wconfirmlv   247.9   226.0   8.8 ext3     /webconfirm                                                                                           
    /dev/mapper/rootvg-custodianlv   991.7   149.3  84.9 ext3  /SCBCustodianNetBank                                                                                  
    /dev/mapper/tempvg-lvAS400 10075.3  9658.8   4.1 ext3     /insurefile                                                                                           
    /dev/mapper/rootvg-scislv  1983.4  1910.1   3.7 ext3     /scis                                                                                                 
    /dev/mapper/rootvg-atomlv   247.9   226.7   8.5 ext3     /atom

    output form df -m command
    Filesystem           1M-blocks      Used Available Use% Mounted on
    /dev/mapper/rootvg-lvroot
                               496       323       148  69% /
    /dev/mapper/rootvg-lvhome
                               496       441        30  94% /home
    /dev/mapper/rootvg-lvtmp
                               496       108       363  23% /tmp
    /dev/mapper/rootvg-lvusr
                              1984      1396       486  75% /usr
    /dev/mapper/rootvg-lvvar
                               496       113       359  24% /var
    /dev/mapper/rootvg-gf3wlv
                               496       420        51  90% /usr/java/glassfishv3w
    /dev/mapper/rootvg-gf3flv
                               496       292       180  62% /usr/java/glassfishv3f
    /dev/mapper/rootvg-lvopt
                               496        49       422  11% /opt
    /dev/mapper/rootvg-dpslv
                                62         6        54  10% /DPS
    /dev/sda1                   99        12        83  13% /boot
    tmpfs                     1522         0      1522   0% /dev/shm
    /dev/mapper/rootvg-cmslv
                               124         6       113   5% /cms
    /dev/mapper/rootvg-gf2lv
                               496       207       264  44% /usr/java/glassfish
    /dev/mapper/rootvg-wconfirmlv
                                62         6        54  10% /webconfirm
    /dev/mapper/rootvg-custodianlv
                               248       211        25  90% /SCBCustodianNetBank
    /dev/mapper/tempvg-lvAS400
                             10076       417      9147   5% /insurefile
    /dev/mapper/rootvg-scislv
                               496        19       452   4% /scis
    /dev/mapper/rootvg-atomlv
                                62         6        54  10% /atom

     
  • Thanks for reporting this issue - first I thought it was a Linux bug or device driver error :-)

    I can see the problem now.
    The struct stat is being returned with the total and free block counts for the filesystems but the block size is now different for various filesystems.
    long    f_bsize;    /* optimal transfer block size */
    But the block size for reporting filesystems stats is ambiguous.
    For example, in RedHat 5.5 on Power / (root) has a block size of 4KB but /boot in 1KB.
    This means /boot counts at a factor of 4 off.

    The size field is documented as the "natural" size of the I/O but not clearly documented as the size the blocks are reported in.
    In the past ,that seems to have always been 4KB blocks.
    But it is being used in Linux for the block counts too …. now - life is too short to have a look at older Linux versions we have may have been lucky or it may have been a recent  "improvement".
    I am 99% this has changed at some point and I can't think why? or Why /boot should require 1KB I/O which seems like a backward step in the GB era.

    I don't have an "fancy" file systems i.e. just the defaults.
    I guess your SAN disks might be using other sizes too.

    Here is a small program that outputs what the structure hold (statfs.c):

    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <sys/stat.h>
    #include <sys/statfs.h>
    main(int argc, char **argv)
    {
    int fd;
    struct statfs statfs_buffer;
            printf("filesystem %s\n", argv[1]);
            fd = open(argv[1], O_RDONLY);
            if(fstatfs( fd, &statfs_buffer) != -1) {
                    printf("f_type  =%ld\n", (long)statfs_buffer.f_type  );
                    printf("f_bsize =%ld\n", (long)statfs_buffer.f_bsize );
                    printf("f_blocks=%ld\n", (long)statfs_buffer.f_blocks);
                    printf("f_bfree =%ld\n", (long)statfs_buffer.f_bfree);
                    printf("f_bavail=%ld\n", (long)statfs_buffer.f_bavail);
                    printf("f_files =%ld\n", (long)statfs_buffer.f_files);
                    printf("f_ffree =%ld\n", (long)statfs_buffer.f_ffree);
                    printf("f_namelen=%ld\n", (long)statfs_buffer.f_namelen);
            }
    }
    

    Compile with: make statfs
    Then use like:
    ./statfs /
    ./statfs /boot
    etc

    Can you try these on your various filesystem types and report back?

    Once I am sure we have the same numbers as df I can work a quick fix.

    Thanks Nigel Griffiths

     
  • Thanks for your response. I have to send output from statfs command for all file system.

    best regards,
    Pao.

    # df -m |awk '{print $5}' |grep ^\/ |xargs -i ./statfs {}
    filesystem /
    f_type  =61267
    f_bsize =1024
    f_blocks=507748
    f_bfree =177046
    f_bavail=150832
    f_files =131072
    f_ffree =126771
    f_namelen=255
    filesystem /home
    f_type  =61267
    f_bsize =1024
    f_blocks=507748
    f_bfree =57150
    f_bavail=30955
    f_files =131072
    f_ffree =128425
    f_namelen=255
    filesystem /tmp
    f_type  =61267
    f_bsize =1024
    f_blocks=507748
    f_bfree =360319
    f_bavail=334105
    f_files =131072
    f_ffree =130980
    f_namelen=255
    filesystem /usr
    f_type  =61267
    f_bsize =4096
    f_blocks=507860
    f_bfree =150513
    f_bavail=124299
    f_files =524288
    f_ffree =478392
    f_namelen=255
    filesystem /var
    f_type  =61267
    f_bsize =1024
    f_blocks=507748
    f_bfree =381695
    f_bavail=355481
    f_files =131072
    f_ffree =130476
    f_namelen=255
    filesystem /usr/java/glassfishv3w
    f_type  =61267
    f_bsize =1024
    f_blocks=507748
    f_bfree =71352
    f_bavail=45138
    f_files =131072
    f_ffree =111421
    f_namelen=255
    filesystem /usr/java/glassfishv3f
    f_type  =61267
    f_bsize =1024
    f_blocks=507748
    f_bfree =207865
    f_bavail=181651
    f_files =131072
    f_ffree =120999
    f_namelen=255
    filesystem /opt
    f_type  =61267
    f_bsize =1024
    f_blocks=507748
    f_bfree =458251
    f_bavail=432037
    f_files =131072
    f_ffree =130665
    f_namelen=255
    filesystem /DPS
    f_type  =61267
    f_bsize =1024
    f_blocks=63461
    f_bfree =57995
    f_bavail=54719
    f_files =16384
    f_ffree =16362
    f_namelen=255
    filesystem /cms
    f_type  =61267
    f_bsize =1024
    f_blocks=126931
    f_bfree =121264
    f_bavail=114711
    f_files =32768
    f_ffree =32755
    f_namelen=255
    filesystem /usr/java/glassfish
    f_type  =61267
    f_bsize =1024
    f_blocks=507748
    f_bfree =294635
    f_bavail=268440
    f_files =131072
    f_ffree =127004
    f_namelen=255
    filesystem /webconfirm
    f_type  =61267
    f_bsize =1024
    f_blocks=63461
    f_bfree =57848
    f_bavail=54572
    f_files =16384
    f_ffree =16302
    f_namelen=255
    filesystem /SCBCustodianNetBank
    f_type  =61267
    f_bsize =1024
    f_blocks=253871
    f_bfree =38215
    f_bavail=25108
    f_files =65536
    f_ffree =63453
    f_namelen=255
    filesystem /insurefile
    f_type  =61267
    f_bsize =4096
    f_blocks=2579278
    f_bfree =2472651
    f_bavail=2341631
    f_files =1310720
    f_ffree =1310708
    f_namelen=255
    filesystem /scis
    f_type  =61267
    f_bsize =1024
    f_blocks=507748
    f_bfree =488992
    f_bavail=462778
    f_files =131072
    f_ffree =131062
    f_namelen=255
    filesystem /atom
    f_type  =61267
    f_bsize =1024
    f_blocks=63461
    f_bfree =58027
    f_bavail=54751
    f_files =16384
    f_ffree =16370
    f_namelen=255

     
  • WOW!! that was quick.

    Normally, I have found the f_bsize line is 4096 and a rare 1024 but the vast bulk of yours are 1024.
    Except /usr and /insurefile which are 4096 - are these files systems of a particular type like ext3, ext4, XFS, JFS, ReiserFS ?

    That is pretty odd - I would like to know if you have an odd system - helps to see how "normal" this setup is.
    That is the distro, version and platform(x86, x86_64, i64, Power, mainframe)?
    Is this native or virtualised like Xen, VMware, VirtualBox or PowerVM?

    Thanks - I will go and write a fix.
    I assume you are willing to give it a try.

    Thanks again Nigel Griffiths

     
  • To answer one of my questions
    Just spotted ALL the file systems above are f_type 61267 = 0xEF53 in Hex, which is (from: man statfs) = EXT3
    Obvious really !!

    So why the mixture of block sizes?

    Something to do with the underlying media/disk type?
    Are your /usr and /insurefile on large disks ?

    /usr is large but /insurefile is smaller than other filesystems so its not file system size related.

    Mind you my RedHat on Power the /boot is small =1024 but / is = 4096 - both sharing two virtual SCSI disks of 32 GB.
    Perhaps there is no sane reason but accidental/heuristic guessing.
    See man mkfs.ext3 and the -b option and -T option!!

    Whatever the cause, we have to get nmon to handle it.

    thanks Nigel Griffiths

     
  • Release lmon14c.c to fix this problem - let me know how you get on.

     
  • Hello Nigel Griffiths

                    I have to use lmon14c.c and it fix my problem. thanks for your support.  I think block size is depend on /etc/mke2fs.conf it seem mkfs.ext3 tool is calculate from inode size. Do you have plan to add %Inode to nmon for linux?  I have plan to write script for monitor system and get information from output of nmon csv file.

    Best regards,
    Pao.

    # cat /etc/mke2fs.conf

    base_features = sparse_super,filetype,resize_inode,dir_index
    blocksize = 4096
    inode_ratio = 8192

    small = {
    blocksize = 1024
    inode_ratio = 4096
    }
    floppy = {
    blocksize = 1024
    }
    news = {
    inode_ratio = 4096
    }
    largefile = {
    inode_ratio = 1048576
    }
    largefile4 = {
    inode_ratio = 4194304
    }