Operating System - Linux
1829735 Members
1782 Online
109992 Solutions
New Discussion

Reclaim a disk from the Volume Group

 
Sahaj
Visitor

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/sdg1 (This will add /dev/sdg in rootvg)

3. pvmove /dev/sdf1 /dev/sdg1

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.

4 REPLIES 4
sbahra
Occasional Contributor

Re: Reclaim a disk from the Volume Group

Any Linux Guru around to answer?

Matti_Kurkela
Honored Contributor

Re: Reclaim a disk from the Volume Group

This action plan looks OK to me.

 

"lvlnboot" is a HP-UX command: there is no equivalent in Linux since it is not needed.

 

The HP-UX PA-RISC bootloader needs to be able to find the /stand filesystem, the root filesystem and the primary swap/dump area without really understanding the LVM data structures: the lvlnboot command saves information about these filesystems in a form that is easier to use in the very small bootloader.

 

In Linux, the bootloader only needs to find two files: the kernel (vmlinuz) and the initrd/initramfs file. Once these are successfully loaded, the initrd environment will contain enough tools for full LVM functionality, so HP-UX-like boot-time special information is not required.

MK
sbahra
Occasional Contributor

Re: Reclaim a disk from the Volume Group

Thanks Matti.

 

Any idea what are the below messages in pvs command?

 

Found duplicate PV ztJsdhgGjliHIjNc8roRb0HmOqzq5jt9: using /dev/sdc1 not /dev/sda1
Found duplicate PV J8TlqfqSR3aeY2gJzkI3SOHbrlv9DoW8: using /dev/sdd1 not /dev/sdb1

Matti_Kurkela
Honored Contributor

Re: Reclaim a disk from the Volume Group

> Found duplicate PV ztJsdhgGjliHIjNc8roRb0HmOqzq5jt9: using /dev/sdc1 not /dev/sda1
> Found duplicate PV J8TlqfqSR3aeY2gJzkI3SOHbrlv9DoW8: using /dev/sdd1 not /dev/sdb1

 

You're using a multipathed storage device and you either don't have dm-multipath or any other multipath solution installed, or don't have configured LVM to use it. This means your system is using only one FC/iSCSI/whatever link to access each LUN, instead of load-balancing the traffic between the links. Also, if the active link fails, the system won't automatically switch to the other link.

 

(In HP-UX 11.23 and older, the basic support of alternate paths is integrated to LVM; HP-UX 11.31 handles multipathed disks automatically with agile devices. In Linux, multipathing is a separate optional layer in the "stack" of storage drivers: you must enable it, and tell LVM to prefer the multipathed devices over the regular single-path /dev/sd* devices.)

 

Make sure you have dm-multipath installed and that you have activated it.  RedHat has good guides for dm-multipath (for RHEL 6.x and 5.x, respectively):

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/DM_Multipath/index.html

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/DM_Multipath/index.html

 

However, if you're using RHEL, there are some more things you should know. Unfortunately they are only described in the RedHat Knowledge Base, which requires a valid RedHat subscription:

 

https://access.redhat.com/knowledge/solutions/2989

https://access.redhat.com/knowledge/solutions/17643

 

You seem to have only a single volume group named "rootvg", and it seems to contain both a local SmartArray disk partition and some SAN LUNs. This may cause you some extra difficulties implementing dm-multipath, if the rootvg contains your root filesystem: such a situation would require the activation of dm-multipath before mounting the root filesystem, and this is not the default behavior in RHEL 5 and older. (This is one of the reasons why the recommended practice is to make one VG from the local system disk, and one or more VGs for SAN LUNs as required by your applications and/or data storage requirements.)

 

Installing a RHEL 5 system to use dm-multipath for root filesystem would require a special "mpath" installation option:

https://access.redhat.com/knowledge/solutions/17472

MK