Operating System - HP-UX
1846415 Members
3298 Online
110256 Solutions
New Discussion

Easiest way to "scrub" (erase/delete) all disk drives?

 
SOLVED
Go to solution
Jared Middleton
Frequent Advisor

Easiest way to "scrub" (erase/delete) all disk drives?

We've been successfully running Linux for a couple years now and are ready to dispose of two old refrigerator-sized HP 9000 servers:
HP-UX B.11.00 A 9000/820
HP-UX B.11.00 A 9000/887

Before shoving these boat anchors out the window into the dumpster, we'd like to sanitize the disks, at least minimally. The data is not top secret or anything, we just want to take reasonable measures. What's the easiest way to do this? Use a large magnet?

Since most of the drives are now worthless ancient 4GB units, I thought about removing them and letting the team taking satisfying whacks at them with a sledge hammer. But, there are quite a few unis, and someone would probably injure themself before the task was completed. :-)

There are a mix of mirrored and unmirrored drives configured with LVM. I've only did basic user/printer management on these machines (years ago) and the documentation is long gone. If there is a simple reformat command (or SAM menu) that will make the data unrecoverable), just say so.

Thanks in advance.
Jared
12 REPLIES 12
Geoff Wild
Honored Contributor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

Most secure way - sledge hammer.

From Unix - this works pretty well:

remove lvols
remove vg's

pvcreate -f the disks
Then create new vg
then create a lvol

Another way - but takes a long time, is to use ODE:

How to use ODE to wipe out a disk
Reboot the machine
Insert the support plus media cd
Stop the "boot primary path"

Then find the cdrom drive:

>search

>boot

At the ISL prompt:

ISL>ode

At the ODE prompt:

ODE>diskexpt

You will be prompted for a password, type in:
tpeusoot

Commands to use in DISKEXPT:

To see disks: dispmap
Select disk: testdisk #
Then enter:

wrtmt

For range, enter 0/ and the max number displayed
Select 3 for userdefined, then enter 0 to write all zero's

Wait.....a long time............

Do this for all disks.....




Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Victor BERRIDGE
Honored Contributor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

Hi,
You could also fill the disks with AAAs or BBBB etc... or you could use the mediainit command...

All the best
Victor
Jared Middleton
Frequent Advisor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

Hi Geoff,

Unfortuantely, I think someone trashed all the removeable media (install tapes, CDs, etc.) months ago.

What can I get away with without rebooting? Ideally, I'd like to: 1) overwrite the logical "/data" file system(s) with zeros -- note: I don't know much about LVM. 2) Do a simple basic format/erase of everything else (OS and Apps), 3) power-down. Done.

Jared
Jared Middleton
Frequent Advisor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

Hi Victor,
Yes, fill disk blocks with X is the desireable outcome - but using what, dd?

mediainit looks promising too... man page says "Initialization destroys all existing user data in the area being initialized." ooh ooh. For once in my life, I actually want the most destructive option!! muhahaha!

I'm pretty new to this low-level stuff. Just looking for the easiest way to destroy everything (even LVM/RAID) in one quick pass, without rebooting, if possible.

(Note: I'll come back and assign points once I've completed my path of destruction)

Jared
Geoff Wild
Honored Contributor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

Okay - how many volume groups are there?

vgdisplay -v

If just a vg for root (vg00) and /data, then do this.

Wipe out /data:

Get the lvols:

vgdisplay -v DATAVG |grep "LV Name"

Remove them:

lvremove /dev/DATAVG/lvolXX

Remove DATAVG:
vgdisplay -v DATAVG |grep "PV Name"
save those...need them later
vgchange -a n /dev/DATAVG
vgexport /dev/DATAVG
pvcreate -f /dev/rdsk/DEVSFROMABOVE
(for each dev that was in the old one)

mkdir /dev/vgjunk
mknod /dev/vgjunk/group c 64 0x0f0000

vgcreate -s 8 -p 128 /dev/vgjunk /dev/rdsk/DEVSFROMABOVE1 /dev/rdsk/DEVSFROMABOVE2
(for as many disks as there were)

vgchange -a y /dev/vgjunk

Make a lvol
lvcreate -L 2048 /dev/vgjunk
newfs /dev/vgjunk/rlvol1

(for the size after the -L, make it as big as the vgjunk)

When that is done, all your data is gone...

next thing - to make the system unusable - just do a:
cd /
rm -rf *

wait a while - then just power off the system - they will never boot again.


Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Massimo Bianchi
Honored Contributor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

Hi,
mediainit, in fact, will give you some unusuable disks.....



Othe way if to create a /dev/zero and issue some nice



nohup dd if=/dev/zero of=/your/rdsk/... &

(mknod /dev/zero c 3 0x000004)

for each disk.

or use a simple strong magnets :)

I have some nice ones, taken from old games ;)

Massimo





Massimo Bianchi
Honored Contributor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

Jared Middleton
Frequent Advisor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

OK, I created a /dev/zero...
# mknod /dev/zero c 3 0x000004

Do I need to undo/remove the logical volume stuff first, or can I just go ahead and dd zeros over each physical volume (see PV Name's below) as-is?

# vgdisplay -v | grep -i name
VG Name /dev/vg00
LV Name /dev/vg00/lvol1
LV Name /dev/vg00/lvol2
LV Name /dev/vg00/lvol3
LV Name /dev/vg00/lvol4
LV Name /dev/vg00/lvol6
LV Name /dev/vg00/lvol7
LV Name /dev/vg00/lvol8
PV Name /dev/dsk/c0t8d0
VG Name /dev/vg01
LV Name /dev/vg01/lvol1
PV Name /dev/dsk/c0t10d0
PV Name /dev/dsk/c5t6d0
VG Name /dev/vg04
LV Name /dev/vg04/lvol1
PV Name /dev/dsk/c0t11d0
PV Name /dev/dsk/c5t5d0
VG Name /dev/vg03
LV Name /dev/vg03/lvol1
PV Name /dev/dsk/c1t3d0
PV Name /dev/dsk/c2t5d0
VG Name /dev/vg05
LV Name /dev/vg05/lvol1
LV Name /dev/vg05/lvol2
PV Name /dev/dsk/c1t4d0
PV Name /dev/dsk/c5t4d0
VG Name /dev/vg06
LV Name /dev/vg06/lvol1
PV Name /dev/dsk/c1t6d0
VG Name /dev/vg02
LV Name /dev/vg02/lvol1
PV Name /dev/dsk/c2t4d0
VG Name /dev/vg07
LV Name /dev/vg07/lvol1
LV Name /dev/vg07/lvol2
PV Name /dev/dsk/c2t6d0
VG Name /dev/vg08
LV Name /dev/vg08/lvol1
LV Name /dev/vg08/lvol2
PV Name /dev/dsk/c5t2d0
PV Name /dev/dsk/c2t2d0
VG Name /dev/vg09
LV Name /dev/vg09/lvol1
LV Name /dev/vg09/lvol2
PV Name /dev/dsk/c2t3d0
PV Name /dev/dsk/c0t2d0
VG Name /dev/vg10
LV Name /dev/vg10/lvol1
LV Name /dev/vg10/lvol2
PV Name /dev/dsk/c0t3d0
PV Name /dev/dsk/c1t2d0
VG Name /dev/vg11
LV Name /dev/vg11/lvol1
LV Name /dev/vg11/lvol2
PV Name /dev/dsk/c1t5d0
PV Name /dev/dsk/c5t3d0
Geoff Wild
Honored Contributor
Solution

Re: Easiest way to "scrub" (erase/delete) all disk drives?

No need to remove lvols - if you are dd /dev/zero - just go ahead and do devs but vg00. Do that after the rest is complete (if you want to wipe out the OS that is).


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Sridhar Bhaskarla
Honored Contributor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

Hi Jared,

Install /dev/random from the following URL.

http://freshmeat.net/projects/hpux11-random/

And then do

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

Repeat it couple of times.

Advantage of using random generator against zeros, or pattern is that it would be difficult to identify what was random data and what was actual data. With zeroes and patterns, one can easily make out what's pattern and what's data.

Write a small script that does the dd's for you overnight.

Once you are done, then go for physical abuse.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Indira Aramandla
Honored Contributor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

Hi Jared,

I had recently decomissioned our K360 Server.
for which I sanitized all the disks using dd /dev/zero which produces an (virtual) endless stream of zero's.

If you do not have /dev/zero, then you can build one as for HP-UX 11

cd /dev
mknod zero c 3 0x000004
chown bin:sys zero
chmod 666 zero

Note: On 10.20, I think the correct minor device no. is 0x000003 but everything else is the same.

Now use dd as
dd if=/dev/zero if=/dev/dsk/cXtYdZ bs=1024K

Do this for all the external disks and then for the internal disks if you wanted the wipe off the OS any any other software installed on the internal disks.


Indira A
Never give up, Keep Trying
Richard Hood
Advisor

Re: Easiest way to "scrub" (erase/delete) all disk drives?

dd if=/dev/null of=/dev/dsk/c#t#d# bs=1024


that will do it....
If it ain't broke - Don't fix it