Operating System - HP-UX
1837197 Members
2331 Online
110115 Solutions
New Discussion

replacing bad drive for vg00

 
SOLVED
Go to solution
Paul Sperry
Honored Contributor

replacing bad drive for vg00

Hard drive for vg00 (/ /stand /var /usr /home /tmp etc) is going bad.
Itâ s a 18GB drive and I will be replacing it with a 36GB drive.
My plan is to have both drives installed and on the new drive
setting up volumes like /root /stand2 /var2 /usr2 /home2 etc..
Then use cpio to copy the filesystem from bad drive to new one.
cd /
find . â print | cpio â pcxvdmu /root

on the new drive
edit fstab comment out /and change /root to /
comment out /stand change /stand2 to /stand
comment out /var change /var2 to /var
etcâ ¦.
shutdown
Remove bad drive, Change scsi ID of new drive to 6
startup.
Any reasons this would not work?
I do have backups via legato networker.

System is a
C3000
5 REPLIES 5
Paul Sperry
Honored Contributor

Re: replacing bad drive for vg00

That should be

find . -print | cpio -pcxvdmu /root

I guess word does not paste well here at the forms.
Paul Sperry
Honored Contributor

Re: replacing bad drive for vg00

OS is hp-ux 11i
A. Clay Stephenson
Acclaimed Contributor

Re: replacing bad drive for vg00

I assume that you would actually like to be able to boot from the new drive. In that case, you need to do a few things like mkboot and lvlnboot. The problem is that these areas are not housed in a filesystem; moreover, you are not taking care of primary swap with your method.

The very first thing is to make absolutely certain that you do a pvcreate -B to reserve boot areas on the disk.

You might actually find it easier to cold install onto the new disk and then copy files from the old to the new. I really don't like copying from a bad disk because you are inviting more problems.

By far the best approach is to do a make_tape_recovery (or make _net_recovery) and resore from it using Ignite.
If it ain't broke, I can fix that.
Paul Sperry
Honored Contributor

Re: replacing bad drive for vg00

Thanks Clay.

Your right I over looked a few things.
I will download ignite adn give it a go.
KapilRaj
Honored Contributor
Solution

Re: replacing bad drive for vg00

1. Install the new disk
2. Boot into LVM Maint mode
3. pvcreate -f -B /dev/rdsk/c?t?d?
4. mkdir /dev/rootvg
5. mknod /dev/rootvg/group c 64 0x020000
6. vgcreate /dev/rootvg /dev/dsk/c?t?d?
7. vgchange -a y /dev/rootvg
8. mkboot /dev/rdsk/c?t?d?
9. mkboot -a "hpux" /dev/rdsk/c?t?d?
10. lvcreate -L XXX -C y -r n -n lvol1 /dev/rootvg #Stand
11. lvcreate -L XXX -C y -r n -n lvol2 /dev/rootvg #Swap / Dump
12. lvcreate -L XXX -C y -r n -n lvol3 /dev/rootvg #Root
13. ......
.... # All the logical volumes in vg00 may not use -C y -r n options.
14. newfs on all the lvols and mount them with a prefix of new
i.e. New root to be mounted on /newroot ; new usr as /usr_new
15. vgchange -a y /dev/vg00
16. mount -a
17. For every file system do the following
18. cd $OLDMOUNT; find . -xdev -depth -print |cpio -pxdm $NEWMOUNT
...
.. # All the fs's

19. lvlnboot -r /dev/rootvg/lvol3
20. lvlnboot -b /dev/rootvg/lvol1
21. lvlnboot -d /dev/rootvg/lvol2
22. lvlnboot -s /dev/rootvg/lovl2
23. lvlnboot -R /dev/rootvg
24. Edit /newroot/etc/fstab # And change the logical volume names accordingly.
25. lvlnboot -v
26. Shutdown the node and remove the old drive and boot thru the new one.
27. Once node comes up run a vgscan to update lvmtab

You are done !!!

Regds,

Kap
Nothing is impossible