Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mirror VG to smaller disk

Status
Not open for further replies.

comtec17

Vendor
Jun 18, 2002
2,338
US
Hello all!
I am currently in the process of adding some EMC SAN disk to 3 of my AIX 4.3.3 servers. My current data/VG/LV/FS reside on SSA disk which I will be retiring after the EMC is in place.

Now off to my question:

My current AIX server has 2 VG's. One of them is rootvg, but it is staying on local disk. My other VG is on SSA. My VG on SSA contains 9 LV's rangeing in size. I am only currently using about 10% of each LV and want to reduce them. I know that there is a command called "lreducevg" that is unsupported by IBM and there are some serious risks, so with that said I dont want to do that.

The reason for reducing the sizes of the LV's is due to the EMC disk that is being created is smaller than what I currently have assigned. I would like to do a VGMirror or an LVMirror to the new disk.

Can I mirror the VG and LV's to disk smaller than that of the current SSA disk? I would like to copy this data over the the new disk using the same VG names and LV names. I am looking for the easiest, most reliable to do this. I will export the old VG when the mirror/restore/copy of it is complete and disconnect my SSA and have it as a standby.

To sum up my questions:

What is the best method of mirroring/copying my current VG to a set of new PV's that are smaller?

Thanks in advance and sorry about rambling on.

CoMteC17
 
The only way I can see to mirror from the SSA to the EMC is to use more than one of the EMC disks for the VG.

Either that or back up the data, remove the LVs from the SSA's, rebuild them to the smaller size, restore the data and then do your mirroring.

I've never heard of lreducevg and am curious about it. HP, if I remember correctly, has a similar command and you can specify which physical extents (partitions) are to be deleted. Another command tells you which extents have data in them. But if you've got the data backed up and have to rebuild the LVs, it might be worth a try to use the lreducevg command -- unless this is a production box!
 
There's not a quick and simple 1 command fix for this. I assume since you say you want to export the ssa vg later that the EMC and ssa will be in two seperate vgs. Any of the lv copy commands do a 1 to 1 logical partition copy so you can't use them to duplicate the lv. Good idea on avoiding lreducelv. I've tried using it before and you are better off doing copies.

Given all that your logic would have to be like the following:

create emc vg
for each ssa lv
make smaller lv/fs on EMC
temp mount new fs
sync files from oldfs to newfs
unmount old and new fs
remove old lv
rename newlv to oldlv
mount newlv on orig mnt point
remove ssa vg

I've done similar things in the past and it can be scripted fairly easily.
 
bi and usige,
Thanks for your response. As to usige, I currently have 10 SSA disks assigned to the LV's. The disk I am adding from EMC are only 2. My VG name and LVnames must remain the same names for SAP and HACMP purposes.

Is there any way to change the name of the VG? For instance, my current vg is vg001 and has 9 LV's. Can I create a temp VG, say vg002 with the 9 new LV's with temp names then go back and rename my LV's and VG? My current VG and LV's will remain together. I am going to export my old VG and LV's and remove the SSA adapter in case I have to go back.
 
If you export the ssa vg then export the emc vg you can run:

importvg -V <old vg major num> -y <old vg name> <new emc disk>

This will import the vgda from the emc temp vg and name the imported vg to the old name. You will need to make sure that the ssa vg is also removed and the emc vg imported on all other nodes in the cluster.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top