About Us

RSInfoMinds, a web based IT Training and Consultancy firm. It is established with high dreams in training people in IT Infrastructure Field. We provide Online and Class Room training in various fields of IT Infrastructure Management.

Join Us: http://www.facebook.com/RSInfoMinds
Mail Us: rsinfominds@gmail.com
Twitter: @RSInfoMinds

We are specialized in the below courses:

Redhat Linux Admin Redhat Linux Cluster
Redhat Virutualization IBM AIX Admin
IBM AIX Virtualization IBM AIX Cluster
HP Unix Admin HP Unix Cluster
HP Unix Virtualization Shell Scripting
Veritas Volume Manager Veritas Cluster
Oracle Core DBA VMWare


We provide training in such a way, So that you get in depth knowledge on the Courses you look for.

And we ensure you are very confident from each and every Techincal aspect that the IT Industry needs and expects from you.

We also conduct Workshops on the latest technology and the real time faculties sharing their work experiences to make you the best.

Saturday, 5 July 2014

fsck - check and repair a Linux file system


       The exit code returned by fsck is the sum of the following conditions:
            0    - No errors
            1    - File system errors corrected
            2    - System should be rebooted
            4    - File system errors left uncorrected
            8    - Operational error
            16   - Usage or syntax error
            32   - Fsck canceled by user request
            128  - Shared library error

Improve Faster IO for your filesystem by chaning the READ AHEAD Value

[root@test oracle]# df -Th /oracle
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/oracle-oracle_lv
              ext4   1008M   34M  924M   4% /oracle

[root@test oracle]# time dd if=/oracle/test of=/tmp/test count=500 bs=1M
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 6.2385 s, 84.0 MB/s

real    0m6.249s
user    0m0.001s
sys     0m1.886s
[root@test oracle]#

[root@test oracle]# blockdev --report /dev/sdb
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0      5368709120   /dev/sdb
[root@test oracle]#


I changed the read ahead value from 256 to 1024:

[root@test ~]#  blockdev --setra 1024 /dev/sdb
[root@test ~]# blockdev --getra /dev/sdb
1024
[root@test ~]# blockdev --report /dev/sdb
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw  1024   512  4096          0      5368709120   /dev/sdb
[root@test ~]#

[root@test oracle]# time dd if=/oracle/test of=/tmp/test count=500 bs=1M
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 3.79428 s, 138 MB/s

real    0m3.819s
user    0m0.003s
sys     0m1.589s
[root@test oracle]#


The read performace has improved from 6.2 Sec to 3.8 Sec. Faster IO.

Currently set to and Block device in lvdisplay ?

[root@test ~]# lvdisplay /dev/hits/hits1
  --- Logical volume ---
  LV Name                /dev/hits/hits1
  VG Name                hits
  LV UUID                W7uUkN-WAIf-MrY7-u7oE-x9uy-AegG-WYATjI
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

[root@test ~]#

Most of us would wonder few things with the output of # lvdisplay especially the bottom two lines.
currently set to and Block device.

Block device:

Block Devices refers to the DM (Device Multipath) Associated with the logical volume.

[root@test ~]# dmsetup ls --tree
hits-hits1 (253:0)
 └─ (8:16)

[root@test dev]# ls -l | grep -i "253"
brw-rw----. 1 root disk    253,   0 Jul  4 17:50 dm-0
[root@test dev]#

dm-0 is the device multipath associated with the logical volume hits1.



How to check the Block Size and Sector Size of HDD in Linux ?

[root@test ~]# blockdev --report /dev/sdb
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0      5368709120   /dev/sdb
[root@test ~]#


RA : Read Ahead.
SSZ : Sector Size.
BSZ : Block Size.
Size : Size of the disk.

Available commands:
        --getsz                        get size in 512-byte sectors
        --setro                        set read-only
        --setrw                        set read-write
        --getro                        get read-only
        --getss                        get logical block (sector) size
        --getpbsz                      get physical block (sector) size
        --getiomin                     get minimum I/O size
        --getioopt                     get optimal I/O size
        --getalignoff                  get alignment offset
        --getmaxsect                   get max sectors per request
        --getbsz                       get blocksize
        --setbsz BLOCKSIZE             set blocksize
        --getsize                      get 32-bit sector count
        --getsize64                    get size in bytes
        --setra READAHEAD              set readahead
        --getra                        get readahead
        --setfra FSREADAHEAD           set filesystem readahead
        --getfra                       get filesystem readahead
        --flushbufs                    flush buffers
        --rereadpt                     reread partition table