Operating System - HP-UX
1833777 Members
1918 Online
110063 Solutions
New Discussion

Re: moving data to a new volume group

 
Jim Lopez
Occasional Contributor

moving data to a new volume group

Is it possible to move or copy data from a small volume group to a larger volume group?Or is it easier just to delete the larger volume group so the smaller volume group can be extended?

6 REPLIES 6
Sachin Patel
Honored Contributor

Re: moving data to a new volume group

Both are good idea.

you can use tar or cpio or cp or mv to move data from one filesystem to another.

You can easily extend file system by using pvcreate on new disk. vgextend and then lvextend command.

I will go with extending volume group so have more disk space.

Sachin Patel
Is photography a hobby or another way to spend $
Helen French
Honored Contributor

Re: moving data to a new volume group

Hi,

You can use either way ! But remember that the files/data are in the file system level. Your volume group might be devided in to Logical volumes in which the file system are created.

You can either create a new VG, new LVs, and new file systems in the large disk, copy the data to that. OR, extend the current VG with the new disk ( adding ) and extend the LVs and the file systems.

Read these topics from the LVM sessions:

http://www.docs.hp.com/hpux/onlinedocs/B2355-90672/B2355-90672.html

HTH,
Shiju

Life is a promise, fulfill it!
James R. Ferguson
Acclaimed Contributor

Re: moving data to a new volume group

Hi Jim:

One problem often faced is that the volume group geometry ('max_pe', 'max_pv', 'pe_size') are fixed at the time a volume group is first created ('vgcreate') and cannot be changed. Without prior planning, starting with a small physical disk as the "seed" for the volume group can lead to the inability to utilize all physical extents on newly added, larger physical disk and/or the inability to simply add more physical volumes to the volume group. In these cases, the only recourse is to recreate the volume group, logical volumes, and filesystems and copy data into them.

The method by which the recreated filesystems are reloaded with data can be from backup, via copy utilities ('cpio' is most useful) or via the use of mirroring (MirrorDisk/UX) software.

Regards!

...JRF...

pap
Respected Contributor

Re: moving data to a new volume group

Hi,

In order to move data from smaller vg to larger VG.

you can do in foloowing way.

1. suppose you have free disks available in machine, you can extend smaller VG by just adding new disks in it.

2. you can move data from smaller VG to larget VG but it requires more pain...I mean it will involve backup and all other things. as you can move data within VG only and not across VGs.

3. IF u can reduce any larger VG, then utilize the freed disk for smaller VG there by extending smaller VG.

The good solution is to extend smaller VG by adding disks available in any way.

-pap
"Winners don't do different things , they do things differently"
MANOJ SRIVASTAVA
Honored Contributor

Re: moving data to a new volume group

Hi Jim

I would abs the decision on the following :

1. Size of the partions involved.
2. Maximum FREE PE
3. Ease of operation.
4. System Downtime involved.

Incase it is small they it is better to do a copy on tape using cpio , tar and get over it , hoever if it is bigger size say > 1 Gb then it is always better to extend . here is a useful link.

http://docs.hp.com/hpux/onlinedocs/5971-2383/5971-2383.html

Manoj Srivastava
Jeff Schussele
Honored Contributor

Re: moving data to a new volume group

Jim,

Another option is to extend the original VG w/the new larger disk & use the pvmove command to move the existing LV info & data to it.
Then you could vgreduce the original disks out. see the man pgs on pvmove.
This is useful if the new disk is faster.
Of course as JRF pointed out do a little investigation to insure max_pe & pe_size are going to be workable for the new disk
You can always vgextend the old disk(s) back in later if you need the extra storage down the road.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!