LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Reclaim a disk from the Volume Group (https://www.linuxquestions.org/questions/linux-newbie-8/reclaim-a-disk-from-the-volume-group-935613/)

sblinux 03-21-2012 01:53 AM

Reclaim a disk from the Volume Group
 
Problem Description: rootvg was extended with a 500GB lun. Although we had allocated only 100GB from it to one of logical volumes. Now we would like to reclaim this 500 GB lun and assign another 100G which could be used for extending the partition.

[root@xyz123 ~]# pvs -o+pv_used
Found duplicate PV ztJsdhgGjliHIjNc8roRb0HmOqzq5jt9: using /dev/sdc1 not /dev/sda1
Found duplicate PV J8TlqfqSR3aeY2gJzkI3SOHbrlv9DoW8: using /dev/sdd1 not /dev/sdb1
PV VG Fmt Attr PSize PFree Used
/dev/cciss/c0d0p2 rootvg lvm2 a- 136.56G 0 136.56G
/dev/sdc1 rootvg lvm2 a- 99.97G 0 99.97G
/dev/sdd1 rootvg lvm2 a- 99.97G 0 99.97G
/dev/sdf1 rootvg lvm2 a- 499.97G 426.53G 73.44G


We would like to reclaim /dev/sdf1

My Action plan is as follows:

1. pvcreate /dev/sdg (To add another 100GB disk)

2. vgextend rootvg /dev/sdg (This will add /dev/sdg in rootvg)

3. pvmove /dev/sdf1 /dev/sdg

4. vgreduce rootvg /dev/sdf1 (to remove the physical volume from the volume group.)


In some posts i have seen someone recommending lvlnboot if we are moving a disk from rootvg. Can someone please look into the action plan and recommend anything needs to be corrected or added in it.

chrism01 03-21-2012 07:58 PM

I think you're going to need pvresize + shrink option http://linux.die.net/man/8/pvresize first.
Here http://linux.die.net/man/8/pvmove it says
Quote:

pvmove allows you to move the allocated physical extents
which I'm pretty sure means all of the allocated extents, used or not ... and sdf1 is 500GB.
These links may also be useful if you haven't already got them
http://tldp.org/HOWTO/LVM-HOWTO/
http://sunoano.name/ws/public_xhtml/lvm.html

However(!) I've never done what you are trying to do, so you may want to wait for someone else to comment before doing anything.
Ideally of course, find spare box that you can play with, create tiny PVs to test and see what happens without a pvresize.

Good luck :)


All times are GMT -5. The time now is 10:51 PM.