Operating System - HP-UX
1819803 Members
3025 Online
109607 Solutions
New Discussion юеВ

How to check the harddisk bad sector

 
SOLVED
Go to solution
Chui Kock You_1
Frequent Advisor

How to check the harddisk bad sector

Hi,

What is the command line to check the hdd whether in good condition or not. Got any bad sector or not. The server is L2000 running on hpux 11i version 1

Regards
Chui
12 REPLIES 12
Ivan Krastev
Honored Contributor

Re: How to check the harddisk bad sector

Try to read data from the disk with dd.

regards,
ivan
Torsten.
Acclaimed Contributor
Solution

Re: How to check the harddisk bad sector

This will help you:

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad_WP.pdf

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
SKR_1
Trusted Contributor

Re: How to check the harddisk bad sector

Use below command

dd if=/dev/rdsk/cxtxdx of=/dev/null bs=2048

Thanks

SKR
Asif Sharif
Honored Contributor

Re: How to check the harddisk bad sector

Hi Chui,
see the below thread.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1061965

Regards,
Asif Sharif
Regards,
Asif Sharif
Steven E. Protter
Exalted Contributor

Re: How to check the harddisk bad sector

Shalom,

The bad disk doc is top notch.

I'd do this:
dd if=/dev/dsk/blahblah of=/dev/null count=10000

Raise the count base don disk size.

This will find a bad sector.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sandeep_Chaudhary
Trusted Contributor

Re: How to check the harddisk bad sector

u can use dd command

Exit values are:

0 Successful completion.
>0 Error condition occurred.

DIAGNOSTICS
Upon completion, dd reports the number of input and output records:

f+p records in Number of full and partial blocks read.
f+p records out Number of full and partial blocks
written.

When conv=block is specified and there is at least one truncated
block, the number of truncated records is also reported:

n truncated records

EXAMPLES
Read an EBCDIC tape blocked ten 80-byte EBCDIC card images per block
into an ASCII file named x:

dd if=/dev/rdsk/c0t0d0 of=/dev/null count=1000

unix # dd if=/dev/rdsk/c3t15d0 of=/dev/null count=1024
1024+0 records in
1024+0 records outhis disk does not have bad sector as records in and out are matching


means t

Steven Schweda
Honored Contributor

Re: How to check the harddisk bad sector

My favorite method is to attach the disk to
a Solaris system, and use the "format"
program there. It can do some fairly
low-level work with defect lists, and it can
easily do some multi-pass, multi-pattern
write+read testing.
Adam W.
Valued Contributor

Re: How to check the harddisk bad sector

I use ioscan -fCdisk, to ensure disk is claimed and identified correctly, so then I run, diskinfo /dev/rdsk/cxtxdx, again to see if the disk is identified correctly, so for further investigation I normally run dd if=/dev/rdsk/c0t4d0 of=/dev/null bs=1024k count=64, and a dd if=/dev/rdsk/c0t4d0 of=/dev/null bs=1024k count=128. Now, the 64 and the 128 SHOULD both came back with 64 records in/out and 128 records in/out, if you have a good disk.
There are two types of people in the world, Marines and those who wish they were.
Chui Kock You_1
Frequent Advisor

Re: How to check the harddisk bad sector

Hi,

If i used the command dd if=/dev/rdsk/c0t4d0 of=/dev/null bs=1024k count=128 will it corrupt my existing data or not.

Regards
Chui
Vivek Bhatia
Trusted Contributor

Re: How to check the harddisk bad sector

Hi,

Use the following manual for checking the disk integrity of the disk.

www.docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf

This is a Very helpful document.DO have a look

Regards
Vivek Bhatia
likid0
Honored Contributor

Re: How to check the harddisk bad sector

Nope, your data won't be harmed, beacuse you are only reading from the disk(if=) and writing to /dev/null (of=/dev/null).

You can execute it without problem.

Windows?, no thanks
Steven Schweda
Honored Contributor

Re: How to check the harddisk bad sector

> You can execute it without problem.

One of the nice features in the Solaris
"format" program is its ability to do surface
analysis using this sequence:
save - write - read+verify - restore.
It lets you do write+read testing without
losing the data (unless the disk is bad). It
also has data-destroying options:

format> a

ANALYZE MENU:
read - read only test (doesn't harm SunOS)
refresh - read then write (doesn't harm data)
test - pattern testing (doesn't harm data)
write - write then read (corrupts data)
compare - write, read, compare (corrupts data)
purge - write, read, write (corrupts data)
[...]