daknetworks.com

You are here: Blog Testing HD with Smartctl & Finding the Filesystem

Testing HD with Smartctl & Finding the Filesystem

Testing HD with Smartctl & Finding the Filesystem

Hmmm. Something is wrong with SDA. Let's test it:

1.smartctl -t short /dev/sda

And look at the results:

1.smartctl -a /dev/sda

The last 5 result log shows:
Error: UNC 8 sectors at LBA = 0x00384622 = 3687970

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 10% 44084 976766499

So we have to find the filesystem. Usually it would be:

1.# fdisk -lu /dev/sda

I get:

1.Disk /dev/sda: 500.1 GB, 500107862016 bytes
2.255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
3.Units = sectors of 1 * 512 = 512 bytes
4.Device Boot Start End Blocks Id System
5./dev/sda1 * 1 208769 104384+ fd Linux raid autodetect
6.Partition 1 does not end on cylinder boundary.
7./dev/sda2 208770 976768063 488279647 fd Linux raid autodetect

Using:
((976766499- 208770) * 512) / 4096

We get:
122069716 LBA block.

But wait, the filesystem isn't on sda, it's on /dev/main/root. Here's how:

1.# cat /etc/fstab
1./dev/main/root / ext3 usrquota,grpquota 1 1
2./dev/md1 /boot ext3 defaults 1 2
3./dev/main/swap swap swap defaults 0 0

So we know files system is mounted at /dev/main/root and it is ext3 type.

We can find the BLOCK SIZE by:

1.# tune2fs -l /dev/main/root | grep Block

I get:

1.Block count:              121561088
2.Block size:               4096
3.Blocks per group:         32768

We're still at 122069716 LBA block.
Or specifically 122069716.125 or the second of 8 sectors in this block.

We can test the block by:

1.# debugfs
2.debugfs 1.39 (29-May-2006)
3.debugfs:  open /dev/main/root
4.debugfs:  testb 122069716
5.Illegal block number passed to ext2fs_test_block_bitmap #122069716 for block bitmap for /dev/main/root
6.Block 122069716 not in use
7.debugfs:  quit

In short, it looks like this:

==================================================================
sda1  sdb1
    |
     md1

        sdb1 sdb2
            |
             md2
            |
        pv (md2)
            |
        vg (main)
    /            \
lv (main/root)        lv (main/swap)

Contact Dak Networks

We are not taking on new clients at this time.