Unix HP-UX How to check bad disk

** Myself
Check bad sector

more /var/adm/syslog/syslog.log
And most important: make sure the online diagnostics are loaded and running. They will monitor disk error messages and can be configured to notify you when there are error messages. The file: /var/adm/syslog/syslog.log will also have disk errors logged.

ioscan –fCdisk
Use the ioscan command to check the S/W state of the disk. Only disks in state CLAIMED are currently accessible by the system. Disks in other states such as NO_HW or disks that are completely missing from the ioscan output are suspicious. If the disk is marked as CLAIMED, then its controller is responding. For example: # ioscan –fCdisk
Class I H/W Path Driver S/W State H/W Type Description
======
disk 0 8/4.5.0 sdisk CLAIMED DEVICE SEAGATE ST34572WC
disk 1 8/4.8.0 sdisk UNCLAIMED UNKNOWN SEAGATE ST34572WC
disk 2 8/16/5.2.0 sdisk CLAIMED DEVICE TOSHIBA CD-ROM XM-5401TA
In this example the disk at hardware path 8/4.8.0 is not accessible. If the disk has multiple hardware paths, be sure to check all the paths.


diskinfo –v /dev/rdsk/cXtYdZ
The diskinfo for this disk showing 0 bytes , it is probably bad.

dd if=dev/rdsk/cXtYdZ of=/dev/null bs=1024k
if this exits without I/O error, the disk is assumed OK
For example, the following shows a successful read of the first 64 megabytes of the disk:
dd if=/dev/rdsk/c0t5d0 of=/dev/null bs=1024k count=64
64+0 records in
64+0 records out
The following shows an unsuccessful read of the whole disk:
dd if=/dev/rdsk/c1t3d0 of=/dev/null bs=1024k
dd read error: I/O error
0+0 records in
0+0 records out



Check LVM Errors
Sometimes LVM commands, such as vgdisplay, return an error suggesting that a disk has problems. For example:
# vgdisplay –v | more

--- Physical volumes ---
PV Name /dev/dsk/c0t3d0
PV Status unavailable
Total PE 1023
Free PE 173

The physical volume status of unavailable indicates that LVM is having problems with the disk. You can get the same status information from pvdisplay.
The next two examples are warnings from vgdisplay and vgchange indicating that LVM has no contact with a disk:
# vgdisplay -v vg vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c0t3d0": The specified path does not correspond to physical volume attached to this volume group vgdisplay: Warning: couldn't query all of the physical volumes.
# vgchange -a y /dev/vg01 vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c0t3d0": A component of the path of the physical volume does not exist. Volume group "/dev/vg01" has been successfully changed.
Another sign that you might have a disk problem is seeing stale extents in the output from lvdisplay. If you have stale extents on a logical volume even after running the vgsync or lvsync commands, you might have an issue with an I/O path or one of the disks used by the logical volume, but not necessarily the disk showing stale extents. For example:
# lvdisplay –v /dev/vg01/lvol3 | more

LV Status available/stale

--- Logical extents --- LE PV1 PE1 Status 1 PV2 PE2 Status 2 0000 /dev/dsk/c0t3d0 0000 current /dev/dsk/c1t3d0 0100 current 0001 /dev/dsk/c0t3d0 0001 current /dev/dsk/c1t3d0 0101 current 0002 /dev/dsk/c0t3d0 0002 current /dev/dsk/c1t3d0 0102 stale 0003 /dev/dsk/c0t3d0 0003 current /dev/dsk/c1t3d0 0103 stale …
All LVM error messages tell you which device file is associated with the problematic disk


Check File system corrupt(no disk problem)
umount /fs
fsck -F vxfs -y -o full,nolog /dev/vg01/rlvol1
mount /dev/vg01/rlvol1

check file system consistency check and interactive repair and not fix any errors found

1 comments:

durga@ unix and linux command forum said...

Thanks for this nice article on bad disk checking. It helped me a lot.

linux scan disk drive for errors

Loading