Operating System - HP-UX
1838407 Members
3215 Online
110125 Solutions
New Discussion

Quickest way to re-initialize a server

 
David Ritts
Occasional Contributor

Quickest way to re-initialize a server

Need to sell our HP 9000 servers running HP-UX 10.20 os. I am not a proficient Unix administrator, but I need to purge all files and configuration before selling. I can get rid of the files and directories outside of the system area, but not sure how to remove vg00 and system directories (os). Any help on de-constructing my system is appreciated.
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: Quickest way to re-initialize a server

Hi David:

If you can stand doing it [ because it seems like you *never* would want to miskey it! ;-) ], then as root, do:

# cd
# rm -fR *

...JRF...
John Bolene
Honored Contributor

Re: Quickest way to re-initialize a server

This answer was posted...but...
# cd
# rm -fR *

would you not want to
# cd /
# rm -fR *

The first cd changes to the home directory of root which may not be the root directory, it may only be /root.

Confusing, huh?



It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
MARTINACHE
Respected Contributor

Re: Quickest way to re-initialize a server

Hi,

You can do a fresh install in order to replace your current vg00.

Regards,

Patrice.
Patrice MARTINACHE
Jim Turner
HPE Pro

Re: Quickest way to re-initialize a server

If you want it squeeky clean before it rolls out the door, consider the following. Get your hands on an extra disk. Put the disk in the machine(s) you're selling, install a fresh copy of the OS to the temp disk, boot off of the temp disk, then mediainit the disk(s) that are leaving with the system. When you're done, remove the temp disk and waive "bye bye" to your spotless system(s).

Cheers,
Jim
Stephen Sanderson
New Member

Re: Quickest way to re-initialize a server

Hi David,

If your machine has removeable/hot swap disks, (eg a J7K with SCA disks) and your boot disk is one of them you can init all disks including the root without having to install extra disks or re-install an OS.

The following procedure has been fully verified under HPs-UX 11.00, but I see no reason it shouldn't work under 10.20. Sorry, I've only outlined the steps required, not the actual commands.

The steps are:

1 Disable any swap that is not on the root disk (may require several reboot depending upon how many swap areas you have.)
2 Shutdown to single user mode
3 Unmount all disks. You may need to run fuser to find & kill processes on some filesystems before you may unmount them.
4 Init all non-root disks.
5 Hot swap the root disk with another (now clean) disk.
6 Mediainit the "other" disk again & say bye bye root!
7 Then for fun, try running shutdown or anything else you fancy...

bfn,
SS :-)
Mike Shilladay
Esteemed Contributor

Re: Quickest way to re-initialize a server

Hi David,

If you are feeling adventurous then the might want to try booting a kernel from a recovery CD and then issuing a pvcreate -f on all the disk you want to destroy. This tends to work a bit quicker than mediainit and the rm commands. Having said that, it will only destroy the header on the disk, hence the speed advantage. The only way to be sure is to use the mediainit command.

Alturnatively, you could use the dd command and copy a blank disk to any disk you wish to blow away, e.g.

dd if= of=

Hope this helps,

Mike.
Thierry Poels_1
Honored Contributor

Re: Quickest way to re-initialize a server

hi,
a simple 'rm -rf' would be the easiest way to remove file (hmmm MARK as removed, actually), but it would be possible to undelete the files on disk.
If you want to be very sure every byte is removed from your disk you would need 'dd' as mentioned.
There are other threads for this question:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x99f9a12d6d27d5118fef0090279cd0f9,00.html

Remember to keep your system disk for last, or you'll be out of the game before you start playing ;-)
good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Magdi KAMAL
Respected Contributor

Re: Quickest way to re-initialize a server

Hi David,

I agree with the :
cd /
rm -fR
but not 100 %.

I mean, you have to :

1. All users have to logoff.
2. Stop all the applications process.
3. Stop all database listeners.
4. Stop all Database instances.
5. Stop all RDBMS.
6. Stop swagentd.
7. Stop telnetd.
8. Stop lpsched.
9. Stop dce daemons, rpcd, inetd

And then ,

cd /
rm -fR