Operating System - HP-UX
1838379 Members
2938 Online
110125 Solutions
New Discussion

swap out a physical disk under the hood of LVM

 
SOLVED
Go to solution
Adam Garsha
Valued Contributor

swap out a physical disk under the hood of LVM

I want to push a new physical disk into my LVM volume group and pull out an old one. The disks are of like size. The volume group has active logical volumes with mounted filesystems.

In Tru64, I would addvol/rmvol with no noted interruption to production services.

How do I do this in HP-UX? Base commands and order is what I am looking for.

Please also comment on how this may change if the volume group is part of a service guard package.

Much thanks!
3 REPLIES 3
Jakes Louw
Trusted Contributor
Solution

Re: swap out a physical disk under the hood of LVM

1) ioscan -fn
2) insf -e
3) pvcreate new_disk
4) vgextend VGNAME new_disk (also for the PVLINK disk ID, if applicable)
5) For each LVOL:
pvmove LVOL old_disk (will move all physical extents from old disk to available disk space)
6) pvdisplay -v old_disk (to see what still lives there). If not empty, repeat 5).If empty:
7) vgreduce VGNAME old_disk (gets old_disk off the VG): Make sure you do the PVLINK disk ID as well, if you have them!
8) vgexport to map file
9) on other cluster node/s, do vgimport using map file

Questions?
Trying is the first step to failure - Homer Simpson
Ninad_1
Honored Contributor

Re: swap out a physical disk under the hood of LVM

Use pvmove [ see man page of pvmove ]
to move all the physical extents one disk to another disk/PV in your VG.
Note: pvmove cannot be performed if the volume group is activated in shared mode.
If VG is part of a SG, but VG is not in shared mode - you need to make sure that the new disk is visible to the other nodes and if you are using infile with -f option while importing disks on to other nodes - please make the necessary modifiction [ replace the current disk name with the new one ] on the other nodes.

Regards,
Ninad
Adam Garsha
Valued Contributor

Re: swap out a physical disk under the hood of LVM

Thanks for quick responses!