Operating System - HP-UX
1748265 Members
3743 Online
108760 Solutions
New Discussion юеВ

How to remove disk from volume group without loosing data

 
SOLVED
Go to solution
Nigel Pykett
Occasional Visitor

How to remove disk from volume group without loosing data

I need to replace our current 72GB hard disk with a new 320GB disk and would like to know what steps to take to ensure data is not lost. I am unable to shut the server down. We are running online JFS on OS HP-UX 11.11.
The only data is Ignite images on its own volume group (VG01) and on its own physical disk.
3 REPLIES 3
Manix
Honored Contributor

Re: How to remove disk from volume group without loosing data

Please check that the disk is hot swappable or not

#Use pvchange ├в a N /dev/dsk/cxtxdx before removing the disk is if doesn`t work use pvchange ├в a n /dev/dsk/cxtxdx , this will disable the pv paths /path.

#ioscan ├в fnC disk
To make sure new disk is visible & CLAIMED

#Add the new disk and use command - pvcreate /dev/rdsk/cxtxdx on the new disk

#vgcfgrestore ├в n vg00 /dev/rdsk/cxtxdx

# Now restore the lvols /data using mirrors
lv is they exists or any backup utility
you have. ?

Thanks
Manix


HP-UX been always lovable - Mani Kalra
Matti_Kurkela
Honored Contributor
Solution

Re: How to remove disk from volume group without loosing data

In other words, you must copy or move the data out of the current disk before removing the current disk.

The important question is, what are the current parameters for your vg01? Run "vgdisplay vg01" to check.

- Does the "Max PV" parameter allow adding a second PV to this VG?

If not, you cannot add new disks to this VG and you must instead create a new VG and copy the data to it. This time, choose the parameters for the new VG so that you have some room for growth, e.g. "vgcreate -s 128 -e 16384 ..." allows adding PVs of up to 2 TB size, which is the maximum allowed by LVM in HP-UX 11.11 and 11.23. (Note: verify you have PHKL_30622 or superseding patch installed, otherwise max PV size will be limited to 256 GB)

- Multiply the value of "Max PE per PV" parameter by the PE size. Is the value equal or greater than the size of your new disk?

If the value is smaller than your new disk, you can go ahead but only part of the capacity of your new disk can be used. It might be better to create a new VG and copy the data in this case.

If you need to create a new VG, you'll have to unmount the old filesystem temporarily, but you don't have to shutdown the server.

If you can add the disk to your existing VG, you can move the data to the new disk without even unmounting the filesystem.

If you have MirrorDisk, you can do this by adding the new disk to the VG, mirroring the data to the new disk, and then removing the old half of the mirror.

Procedure:

ioscan -fnCdisk
insf
pvcreate /dev/rdsk/
vgextend vg01 /dev/dsk/
lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/
lvreduce -m 0 /dev/vg01/lvol1 /dev/dsk/
vgreduce vg01 /dev/dsk/
rmsf -a /dev/dsk/
rmsf -a /dev/rdsk/


If you don't have MirrorDisk, you can use pvmove instead of the lvextend/lvreduce steps. Otherwise the procedure is the same as above.

If you need to create a new VG, the procedure is as follows:

Part 1: creating the new VG:


ioscan -fnCdisk
insf
pvcreate /dev/rdsk/
mkdir /dev/vgignite
ll /dev/vg*/group
mknod /dev/vgignite/group c 64 0xNN0000
(choose a value for NN that is not yet used by other VGs)
vgcreate -s 128 -e 16384 -p 40 vgignite /dev/dsk/
vgchange -a y vgignite
lvcreate -L vgignite
mkfs -F vxfs -o largefiles /dev/vgignite/rlvol1

Part 2: migrating the data:

mkdir /temporary_mountpoint
mount /dev/vgignite/lvol1 /temporary_mountpoint
cd
tar cf - . | ( cd /temporary_mountpoint; tar xf -)
umount /dev/vgignite/lvol1
rmdir /temporary_mountpoint
umount

mount

Part 3: removing the old VG

vgchange -a n vg01
vgexport -v -s -m vg01.map vg01
rmsf -a /dev/dsk/
rmsf -a /dev/rdsk/


MK
MK
Nigel Pykett
Occasional Visitor

Re: How to remove disk from volume group without loosing data

Thanks for the advice. I initially had problems removing the old volume group in SAM but following the advice given,I issued the command vgexport -v to remove the volume group and created a new one within SAM. I will now restore the data from tape to the new disk.