1834608 Members
2659 Online
110069 Solutions
New Discussion

clean disc by dd?

 
SOLVED
Go to solution
Ceesjan van Hattum
Esteemed Contributor

clean disc by dd?

It sounds stupid, but i'm desperate to clean one of discs.
I always though a 'dd if=/dev/null of=/dev/rdsk/c1t1d0 bs=1025k' might work, but it does not. Even after the dd, the disk starts booting..
Please provide me a solution which is better than putting the disc on a fridge or in a microwave.

Ceesjan
12 REPLIES 12
Sajid_1
Honored Contributor

Re: clean disc by dd?

Justo Exposito
Esteemed Contributor

Re: clean disc by dd?

Hi Ceesjan,

Perhaps mediainit?

Regards and Congrats,

Justo.
Help is a Beatiful word
Chris Wilshaw
Honored Contributor

Re: clean disc by dd?

If it's the boot area you want to remove, you could try lifrm and rmboot
Trond Haugen
Honored Contributor
Solution

Re: clean disc by dd?

For most practical purposes a 'dd if=/stand/vmunix of=/dev/rdsk/c1t1d0' will do. It will overwrite any LIF/boot and LVM area. The disk will be unbootable, not belonging to any VG or host and at best it will be VERRY hard to retrieve any data from it.
If you want to overwrite the entire disk you should take the input from /dev/zero (0x000004).

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Stefan Farrelly
Honored Contributor

Re: clean disc by dd?

You want to use /dev/zero, not /dev/null. Just the first 50 blocks or so will do the job;
dd if=/dev/zero of=/dev/rdsk/cxxxx bs=1024k count=50
Im from Palmerston North, New Zealand, but somehow ended up in London...
MANOJ SRIVASTAVA
Honored Contributor

Re: clean disc by dd?

Hi

I think you can write some pattern like

dd if=/dev/zero of=/dev/rdsk/c1t1d0 bs=1024K ( not 1025K)


or you can try mediainit also.



Manoj Srivastava
Ceesjan van Hattum
Esteemed Contributor

Re: clean disc by dd?

Indeed, 1025 was 1024 (just a typo).
I look at the /dev/zero, but it not available on my system and ofcourse i could create myself with the help of the C-program in one of the other threads.
Nevertheless i like the if=/stand/vmunix variant. It is always at hand (otherwise you wouldn't have a prompt for typing commands) and it no need for count= option.

Thanks Team ITRC.
Ceesjan
James R. Ferguson
Acclaimed Contributor

Re: clean disc by dd?

Hi Ceesjan:

If you are running 11.11 you should already have /dev/zero. If not, do this to create it:

# mknod /dev/zero c 3 0x000003 #...on 10.20
# mknod /dev/zero c 3 0x000004 #...on 11.x

# chown bin:bin /dev/zero
# chmod 444 /dev/zero

Regards!

...JRF...

Frank Slootweg
Honored Contributor

Re: clean disc by dd?

Re: the references to mediainit.

Do *not* use mediainit for this purpose.

For details, see the recent thread "How/when (not) to use mediainit?" (<>).
John Dvorchak
Honored Contributor

Re: clean disc by dd?

I just went through this process a few times on systems that we were retireing and need to have the disks wiped. First vgreduce the disk out of the vg. Then you can run mdeiainit on it to write 0's and 1's all over it:

# mediainit /dev/rdsk/cxtxdx

man mediainit(1)
If it has wheels or a skirt, you can't afford it.
JIM WECHTER
Occasional Contributor

Re: clean disc by dd?

When I use the dd command as recommended using /dev/null, I get the following in return:

0+0 records in
0+0 records out

If I use /dev/zero I'm told the file zero does not exist. What is expected if the command works correctly?
John Payne_2
Honored Contributor

Re: clean disc by dd?

You need to create the /dev/zero node if you are on 10.20 or 11.0 See JRF's post to this thread.

John
Spoon!!!!