Operating System - HP-UX
1833325 Members
3072 Online
110051 Solutions
New Discussion

Re: Erasing the root disk..

 
SOLVED
Go to solution
Chris Fadrowski
Super Advisor

Erasing the root disk..

I am getting rid of an HPUX server. I would like to know how to completely format the root drive.

situation;

i have two 18 gb drives mirrored.
Need to format them so no data exists
server will be sold to a reseller.

Mediainit? or DD? please help.
16 REPLIES 16
Peter Godron
Honored Contributor

Re: Erasing the root disk..

Chris,
I'd go for dd as mediainit has been slow for me. dd if=/dev/zero of=/dev/dsk/cXXdXXtX
This should to the trick for normal standard data sensitivity.

Pete Randall
Outstanding Contributor

Re: Erasing the root disk..

Popular options include re-installing the OS, running dd against it, running pvcreate -f, or mediainit. Any of the above will work, it just depends on how sensitive the data is on the disk and how cautious you need/want to be.

To my way of thinking, there shouldn't be any sensitive data on the root disk anyway.


Pete

Pete
Gavin Clarke
Trusted Contributor

Re: Erasing the root disk..

Here is a similar post (from a search):

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=964689

It seems to me that dd is the favourite, being faster but still good enough.

I thought pvcreate would make data irretrievable, the post above says otherwise.

Cheers.
Chris Fadrowski
Super Advisor

Re: Erasing the root disk..

I wasn't sure DD would work on the "root" disks. I did try that yesterday and it never finished. I let it run for over 26 hours.
Pete Randall
Outstanding Contributor
Solution

Re: Erasing the root disk..

I would think dd would work up until it overwrites the dd binary itself. After that, I'm not sure what would happen. Did you specify a blocksize:

dd if=/dev/zero of=/dev/rdsk/c0t6d0 bs=1024k

It's true that pvcreate won't actually destroy any data on the disk but it makes it darn hard for anyone to recover unless they knew the layout of the disk to start with. Even destructive methods like dd and mediainit leave data behind that the determined snoop can get at.


Pete

Pete
Gavin Clarke
Trusted Contributor

Re: Erasing the root disk..

Seems like re-installing the OS is the best way now then.

I do agree with Pete that there is/should be very little to get rid of on the root disks, still better to be safe I guess.

What was the block size you used?
Chris Fadrowski
Super Advisor

Re: Erasing the root disk..

I used bs=512

It never finished. I just killed it, and i can still see all files on vg00 like it did nothing.
Gavin Clarke
Trusted Contributor

Re: Erasing the root disk..

That post suggests bs=1024k, which is quite alot different I think.

The kernel is running in memory so I would think it should be able to overwrite it's own files before it died.
Pete Randall
Outstanding Contributor

Re: Erasing the root disk..

Chris,

512 is the default and writes out 512 byte blocks - it will definitely take forever. Try it with 1024k.


Pete

Pete
Gavin Clarke
Trusted Contributor

Re: Erasing the root disk..

Pete, sorry for the duplication, I didn't see your post before I submitted mine.

Cheers.
Geoff Wild
Honored Contributor

Re: Erasing the root disk..

Even doing a rm -rf / will render the OS inoperable...

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.
Cem Tugrul
Esteemed Contributor

Re: Erasing the root disk..

Chris,
if i were you i would prefer re-install OS
Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
Chris Fadrowski
Super Advisor

Re: Erasing the root disk..

the DD doesn't seem to work.

i will most likely try to reinstall the OS.
James R. Ferguson
Acclaimed Contributor

Re: Erasing the root disk..

Hi Chris:

As msntioned, vg00 probably has only a few "significant" files on it that you don't want seen.

Consider removing or modifiy those. For example, you could eliminate all account information and $HOME directories; reduce the '/etc/hosts' file to a minimum; and remove network information from '/etc/rc.config.d/netconf', etc.

Short of physically destroying the disk, you would need to overwrite it 10-20 times to truly make it unreadable.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: Erasing the root disk..

My preferred method for this is to use 'dd' to wipe the data disks on the system.

Then I do a BASE HP-UX install to one of the data disks, without doing any additoinal software, customizations, etc., and then use dd from that install to wipe the original OS disks.

Doug Burton
Respected Contributor

Re: Erasing the root disk..

You stated that dd didn't work. Did you have /dev/zero? Some of the older-ish boxes don't seem to have it. If you don't have it do the following...

Do we have /dev/zero? ll /dev/zero
If not then create one:

For 11.xx:
mknod /dev/zero c 3 0x000004 ; chown bin:bin /dev/zero ; chmod 666 /dev/zero

For 10.20:
mknod /dev/zero c 3 0x000003 ; chown bin:bin /dev/zero ; chmod 666 /dev/zero

Then wipe all the drives:

for x in `ls /dev/rdsk`
do
dd if=/dev/zero of=/dev/rdsk/${x} bs=1024k &
done