1844867 Members
2282 Online
110233 Solutions
New Discussion

Format command?

 
SOLVED
Go to solution
Tom Spence_1
Regular Advisor

Format command?

Hi,

I am using HP 877 10.20...

What command do I use for erase/format all hard drives?

Thanks!
Thinking Snow!
16 REPLIES 16
John Carr_2
Honored Contributor

Re: Format command?

Hi

to remove all the files from a disk

cd /disk_mount_point

rm -r *

there is generally no need to format HP disks is there any particular reason for wanting to do this ?

John.
Graham Cameron_1
Honored Contributor
Solution

Re: Format command?

I think you want mediainit.

See "man mediainit".

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Mark Grant
Honored Contributor

Re: Format command?

if you really need to delete information, you could "dd if=/dev/zero of=" until it falls over. This should work though I've never tried it.

Never preceed any demonstration with anything more predictive than "watch this"
Pete Randall
Outstanding Contributor

Re: Format command?

I've read repeated reports of disk usability issues after mediainit. I would suggest that you stick to the dd command offered by Mark. If you're trying to wipe drives before resale of the machine, you can load a fresh copy of HP-UX on the root drive and wipe all the others with dd.

If your trying to clear drives for your own reuse, you're going about it the wrong way entirely.


Pete

Pete
Tom Spence_1
Regular Advisor

Re: Format command?

Okay, great...

Surely, I am using ioscan -funC disk first.

Now, tell me how can I wipe it out by using dd command?

Like this: dd if=/dev/zero of=/dev/rdsk/xx

Right?
Thinking Snow!
Pete Randall
Outstanding Contributor

Re: Format command?

Tom,

Exactly!

But, I still ask what you are trying to accomplish.


Pete

Pete
Massimo Bianchi
Honored Contributor

Re: Format command?

Just in case you do not have /dev/zero:

IGOR >> ll /dev/zero
crw-rw-rw- 1 bin sys 3 0x000004 May 17 2002 /dev/zero

John Carr_2
Honored Contributor

Re: Format command?

If you are going to rebuild this system and reinstall the o/s the new installation will zap all the disks and existing files.

why are you needing to do this ?

John.
Tom Spence_1
Regular Advisor

Re: Format command?

We are no longer to use the HP 877!!! So we need to format/erase all disks before throw all HP server/storages away...
Thinking Snow!
John Carr_2
Honored Contributor

Re: Format command?

If you are throwing the disks away a hammer may be the best tool for piece of mind :-)

John.
Tom Spence_1
Regular Advisor

Re: Format command?

LOL...

True but I am working for the Pentagon so I HAVE to format/erase all disks NO MATTER WHAT!

All I do is:

ioscan -funC disk
dd if=/dev/zero of=/dev/rdsk/xxxx

Hope it works... Smile.

Tom
Thinking Snow!
Pete Randall
Outstanding Contributor

Re: Format command?

Tom,

If you are throwing it away and there is no need for *anyone* to be able to access the disks then mediainit is fine. I don't know as I see any real advantage over using the dd command, though. In fact, I think dd might be faster. I would suggest:

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

for all non root drives, and rm -rf /* for the root drive.

Have fun!


Pete

Pete
Pete Randall
Outstanding Contributor

Re: Format command?

Or, and I mean this seriously, a large magnet will do wonders (of the disastrous type).


Pete

Pete
Tom Spence_1
Regular Advisor

Re: Format command?

Yes, we might have to degauss at other office... But how easy for me to take hard drive off, just pull? If screw then waste my time... Any suggest?
Thinking Snow!
Pete Randall
Outstanding Contributor

Re: Format command?

Tom,

I'm not familiar with your 877, but I'm guessing you would have to open the case to access the hard drive and then pass the magnet over it, though you might be able to do it through the case - you could try waving the magnet at it and then see if it boots.

Otherwise, I would go back to my earlier suggestion: use "dd" on the non-root drives and "rm -rf" or "dd" on the root drive. Either way, the drive is going to be pretty well trashed.


Pete

Pete
Mark Grant
Honored Contributor

Re: Format command?

How about blowing a handfull of iron fillings in there, you could take out the whole machine in one easy step!
Never preceed any demonstration with anything more predictive than "watch this"