Operating System - HP-UX
1823057 Members
3129 Online
109645 Solutions
New Discussion юеВ

Using dd command for wiping disks

 
Joanne Joki_1
Occasional Contributor

Using dd command for wiping disks

We are trying to decommssin our K200. When we enter the following command:

dd if=/dev/zero of=/dev/rdsk/(somedisk) bs=1024

the system goes off and appears to be wiping the disks (the light is on and stays on) but it NEVER returns to prompt. What are we doing wrong?

8 REPLIES 8
harry d brown jr
Honored Contributor

Re: Using dd command for wiping disks

here are some hints:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xa5c60bce6f33d6118fff0090279cd0f9,00.html

I usually use a "count"

live free or die
harry
Live Free or Die
T G Manikandan
Honored Contributor

Re: Using dd command for wiping disks

Pete Randall
Outstanding Contributor

Re: Using dd command for wiping disks

Joanne,

Your block size is only 1024 bytes. That's going to take forever. Try 1024k instead.

Pete

Pete
Cheryl Griffin
Honored Contributor

Re: Using dd command for wiping disks

The speed also depends on the size of disk. How large are the disks? Increasing bs as mentioned before will help.

Verify your /dev/zero file has the correct major/minor number. Otherwise nulls may be written instead of zeros.

At 10.20 (minor was 3)
# mknod /dev/zero c 3 0x000003

At 11.00 (minor has to be 4)
# mknod /dev/zero c 3 4 /dev/zero
# ll /dev/zero
crw-rw-rw- 1 bin sys 3 0x000004 Aug 2 2002 /dev/zero

At 11i, insf should create this file automatically, if it doesn't already exist.

Best Wishes,
Cheryl
"Downtime is a Crime."
Stefan Farrelly
Honored Contributor

Re: Using dd command for wiping disks

There was a long discussion about this a while ago. Heres the link.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x24b53a7b3682d611abdb0090277a778c,00.html

The best way is to not only use /dev/zero but /dev/one, two... etc. There is a perl script on the above link to do random writes of 1's, 2's etc.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Hai Nguyen_1
Honored Contributor

Re: Using dd command for wiping disks

Joanne,

Pete is correct. I myself always use bs=4096k.

Hai
Sanjay_6
Honored Contributor

Re: Using dd command for wiping disks

Hi,

Either increase the block size or stay patient. It takes some time to do the dd, depending on the size of the disk. try,

dd if=/dev/null of=/dev/rdsk/cxtydz bs=1024k

Hope this helps.

Regds
Joanne Joki_1
Occasional Contributor

Re: Using dd command for wiping disks

thanks, all. The size of some of the disks are 2gig and some are 4gig. I will try increasing the block size and see if this helps. The minor number was set to three per the instructions I got from HP -- is this going to be a major problem?