Operating System - HP-UX
1833788 Members
2613 Online
110063 Solutions
New Discussion

Re: Moving disks from One volume group to another

 
SOLVED
Go to solution
Jesse Delk
Frequent Advisor

Moving disks from One volume group to another

I have two volume groups that are missed sized.

System as it stands now..
$ bdf
Filesystem kbytes used avai
/dev/vg20/lvu03 62771200 58389752 4347296
/dev/vg10/lvu01 162603008 82647000 79331368

I was told I may be able to move disks free of data from /dev/vg10/lvu01 to /dev/vg20/lvu03.

How would I tell what disk(s) are free of data and how to move the disk(s) from /dev/vg10/lvu01 to /dev/vg20/lvu03?...or how to free up a disk to be moved?

Probably one disk is all I would need to move.

Also can I do this online while the system is being used?
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor
Solution

Re: Moving disks from One volume group to another

Hi Jesse:

Use a compination of 'vgdisplay -v' 'lvdisplay -v' and 'pvdisplay -v' to determine where data exists on various physical volumes.

You can use 'pvmove' to move physical extents (even by logical volume using th e'-n' switch) from one physical disk to another.
This can be done while the disk is in use.

When you have finally freed a physical disk of all usage by a volume group, you can 'vgreduce' it from the volume group and then 'pvcreate' and 'vgextend' it into another volume group.

See the man pages for the aforementioned commands for details. Everything can be done while the system is fully active if you are careful. Be sure not to interrupt any 'pvmove'. An early termination of 'pvmove' can leave the volume in an unusable state.

Regards!

...JRF...

Jesse Delk
Frequent Advisor

Re: Moving disks from One volume group to another

I'm looking at vg10 where I'm wanting to remove a disk from. See below..

I'm not sure what I'm looking at... If I find a disk I can remove...how do I free it from the volume group?


# vgdisplay -v /dev/vg10
--- Volume groups ---
VG Name /dev/vg10
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 2
Open LV 2
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 26248
VGDA 4
PE Size (Mbytes) 8
Total PE 26244
Alloc PE 26243
Free PE 1
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg10/lvu01
LV Status available/syncd
LV Size (Mbytes) 158792
Current LE 19849
Allocated PE 19849
Used PV 2

LV Name /dev/vg10/lvu02
LV Status available/syncd
LV Size (Mbytes) 51152
Current LE 6394
Allocated PE 6394
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c4t0d1
PV Name /dev/dsk/c6t0d1 Alternate Link
PV Status available
Total PE 19846
Free PE 0
Autoswitch On

PV Name /dev/dsk/c4t0d2
PV Name /dev/dsk/c6t0d2 Alternate Link
PV Status available
Total PE 6398
Free PE 1
Autoswitch On
James R. Ferguson
Acclaimed Contributor

Re: Moving disks from One volume group to another

Hi (again) Jesse:

You can't get there. You have only one free physical extent left in this volume group and it's on '/dev/dsk/c4t0d2' whose alternate path is '/dev/dsk/c6t0d2'. Remmeber that these are the same physical disks.

If the filesystems within the logical volumes within this volume group are grossly oversized, then you could backup the filesystem data; 'lvreduce' the logical volume housing the filesystem; recreate the filesystem in the newly sized logical volume; reload the backed-up data; and THEN you would have some free physical extents with which to "play" as I first posted.

Regards!

...JRF...
Jesse Delk
Frequent Advisor

Re: Moving disks from One volume group to another

One more question.

If I add more disks to my VA7110...would I be able to use Command View to add the space to the LUN that vg20 uses in command view and then use maybe SAM to add it to the Volume group and then to the logical volume /dev/vg20/lvu03 ?
Pete Randall
Outstanding Contributor

Re: Moving disks from One volume group to another

Jesse,

There is no need to add it to an existing LUN. A new LUN can be added into an existing VG, as long as you have not reached the Max PV limit as shown by vgdisplay.


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Moving disks from One volume group to another

Hi Jesse:

Yes, if you are not (yet) conformtable using LVM commands, the menu-based utilities will certainly help.

I'm an old command-line junkie because I never want to do something twice. If I know the commands, then I can craft a script to automate something the next time. Besides, scripts are one way of documenting what to do.

That aside, peek at the SAM log after you do something there. You can begin to see the command used and together with the manpages for the command you can begin to get more comfortable.

Regards!

...JRF...
Jesse Delk
Frequent Advisor

Re: Moving disks from One volume group to another

Thanks for all the info.