1834272 Members
96529 Online
110066 Solutions
New Discussion

Replacing boot disk vg00

 
SOLVED
Go to solution
David Owens_1
Advisor

Replacing boot disk vg00

I have a D330 server with (5) internal disks. One disk contains the operating system and vg00. The other four disks have another volume group (vg01) that contains all data files. If I were to replace and rebuild the system disk (vg00), what is the simplest way to avoid rebuilding and restoring vg01? Do I need to do a vgcfgbackup and vgcfgrestore or do I just need to retore the /etc/lvmtab, /etc/lvmconf/*, /etc/fstab files?


David Owens
Ingersoll-Rand
9 REPLIES 9
Roger Baptiste
Honored Contributor
Solution

Re: Replacing boot disk vg00



Since you are not touching the disks of vg01,
simply do a
#
ll /dev/vg01/group >/tmp/vg01info
vgexport p -v -m /tmp/vg01.map /dev/vg01
save the vg01.map on tape or some other system.

After building the new boot disk, do
mkdir /dev/vg01 ; mknod /dev/vg01/group c 64 0x??0000
vgimport -v -m vg01.map /dev/vg01

That's it. vgimport will automatically
update the lvmtab file and lvmconf directory.

Ofcourse, you would need the fstab file for
filesystem mount details.

HTH
raj
Take it easy.
Animesh Chakraborty
Honored Contributor

Re: Replacing boot disk vg00

Hi,
The best way will be VG export then import.
Do a vg export with map file
#vgexport -v -m /tmp/vg01.map /dev/vg01
#vgimport -v -m /tmp/vg01.map /dev/vg01 /dev/dsk/cxtxdx ....
(note down the current cxtxdx mane from lvmtab for vg01)

Regards
Animesh
Did you take a backup?
Michael Tully
Honored Contributor

Re: Replacing boot disk vg00

Hi,

There are two ways that this can achieved. The first is to 'vgexport' the mapfile from the existing vg01 and backup this up to another server. Take an ignite backup to local tape drive. Switch off system, insert new drive and restore off the ignite tape. Once the system is up 'vgimport' the mapfile of your vg01 and everything should magically appear. (Make sure you have a full system backup in any case!)

Second is seeing your drives bays are pretty much full how can you build a system disk without taking out one or more disks to do the job? Have you got another system that you can build this disk and simply plug the new disk in with the system on it. You could do with this with an ignite tape built onto another server and just import the the other volume group from the mapfiles.

I'd certainly go with the first option.

-Michael
Anyone for a Mutiny ?
David Allen
Frequent Advisor

Re: Replacing boot disk vg00

Hi David,

The vgcfgbackup command is used to backup LVM information, which can then be used to restore (vgcfgrestore) back to a physical volume after a disk failure. In your case, if vg01 consists of 4 physical volumes and one of them fails, you would replace the failed disk and then restore the LVM information using the vgcfgrestore command (plus a few other commands in between). NOTE: Whenever you run LVM commands, vgcfgbackup is run, so you should have a good backup available all the time.

The procedure you will need to use, is to run the vgexport and vgimport commands to export the LVM information to a map_file, which can then be imported back to the new O/S.

Firstly, take note of the group file in the /dev/vg01 directory as you will need to recreate this on the new O/S. Run "ioscan -fnC disk" to get the names of the disk device files that make up vg01.

As with any major change to a system, backup your data and since you are about to trash your O/S environment, create an Ignite-UX recovery tape. If you have to back out of your change then you can use the Ignite tape to boot from and restore your original O/S.

If you don't have Ignite-UX installed, try the site below. The command for creating a recovery tape is make_tape_recovery.
http://www.software.hp.com/products/IUX/index.html

Now you are ready to export the volume group.

1. Unmount the filesystems and deactivate the volume group.
umount /whatever_your_filesystems_are_called
vgchange -a n /dev/vg01

2. Remove the volume group from /etc/lvmtab and remove the device files using vgexport. Run it first with the -p to preview what vgexport will do, once satisfied run it without the -p.
vgexport -p -v -m /tmp/vg01_map /dev/vg01
vgexport -v -m /tmp/vg01_map /dev/vg01

Backup the mapfile to tape or ftp to another system.

3. Rebuild your O/S, with patches, etc. Restore the mapfile back to the /tmp directory (or anywhere you feel like).

4. Run the ioscan command again to check the device files.

5. Recreate vg01's device files.
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x??0000
(The ?? will probably be 01, which corresponds with the volume group number for vg01)

6. Import the mapfile. (You can use the -p option again to preview)
vgimport -v -m /tmp/vg01_map /dev/vg01 /dev/dsk/c?t?d? /dev/dsk/c?t?d? /dev/dsk/c?t?d? /dev/dsk/c?t?d?

(specify all the physical volumes in vg01, ie /dev/dsk/c?t?d?)

6. Activate the vg01
vgchange -a y /dev/vg01

Hope this helps.

Regards,
Dave


Michael Tully
Honored Contributor

Re: Replacing boot disk vg00

Hi,

I neglected to post how to do a make recovery tape (ignite).

On HPUX11

# /opt/ignite/bin/make_tape_recovery -x inc_entire=vg00 -I -a -a /dev/rmt/0mn

on HPUX 10.20

# /opt/ignite/bin/make_recovery -ACvd /dev/rmt/0mn

-Michael
Anyone for a Mutiny ?
James R. Ferguson
Acclaimed Contributor

Re: Replacing boot disk vg00

Hi:

With regard to Ignite, 'make_tape_recovery' *does run* on either 10.20 or 11.x. 'make_tape_recovery' is designed to *replace* the older 'make_recovery'.

The issue with Ignite and the OS version is not the difference between 'make_recovery' and 'make_tape_recovery', but with the Ignite version required.

Ignite-UX version A.x can install multiple versions of HP-UX 10.x from a single Ignite-UX server. The Ignite-UX server may be any HP-UX computer running either 10.01, 10.10 or 10.20.

Ignite-UX version B.3.4 and later requires a server running HP-UX 11.0 or 11i (32 or 64 bit). Ignite-UX version B.x can install HP-UX 10.20, 11.0 and 11i from this single server.

Regards!

...JRF...
John Bolene
Honored Contributor

Re: Replacing boot disk vg00

This happened to me, and I only had to have the disk replaced and then load the ignite make_tape_recovery tape. vg01 came up just fine after the vg00 recovery tape loaded.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Sanjay_6
Honored Contributor

Re: Replacing boot disk vg00

Hi David,

Though you can be sure that you won't loose any data, it is advisable to take a complete backup of vg01, just in case.

Take a export of map file for this VG,

vgexport -p -s -m /tmp/vg_name.map /dev/vg_name
vgcfgbackup -f /tmp/vg_name.cfg /dev/vg_name
cp /etc/lvmpvg /tmp/lvmpvg.vg_name
cp /etc/fstab /tmp/fstab.old

Take a backup of these files and reload the OS. Once done, restore the three files you had backed up,

mkdir /dev/vg_name
mknod /dev/vg_name/group c 64 0x0n0000
(n = 1,2,3,...)
vgimport -s -m /tmp/vg_name.map /dev/vg_name
cp /tmp/lvmpvg /etc/lvmpvg

vgchange -a n /dev/vg_name
vgchange -a y /dev/vg_name

Test the filesystems getting mounted from this vg,

mount -F vxfs /dev/vg_name/lv_name /tmp_mnt

Hope this helps.

Regds
David Owens_1
Advisor

Re: Replacing boot disk vg00

Thanks everyone for your help. I replaced and rebuilt my boot disk. The vgexport and vgimport worked to perfection. Everyone gets a 10.

A couple things to note.

1). If you use your old /etc/fstab file, make sure the mount points for vg00 match the new configuration. To make it simple, I just cut and paste my vg01 and vg02 targets into the /etc/fstab file.

2. When using a make_recovery tape, create multiple copies as you would a normal backup scheme. I learned the hard way. I could not be sure that the recovery tape wasn't as corrupt as the root file system.


Thanks again,
David Owens
Ingersoll-Rand