cancel
Showing results for 
Search instead for 
Did you mean: 

splitting mirror for new VG

 
SOLVED
Go to solution
Vishu
Trusted Contributor

splitting mirror for new VG

Hi,

i have one VG vg_data having 4 disks (2 + 2(mirrored)). i want to use the 2*mirrored disk in a new VG vg_data1, but want the same data of vg_data VG. Please provide the procedure.

I thought of following. Plz suggest on it.

1. split all LVs with lvsplit command so that there remain no mirror LV.
2. vgreduce both disks out of vg_data.
3. Create new vg vg_data1.
3. Import those disk in new VG with vgimport command as

# vgimport /dev/vg_data1
14 REPLIES
Torsten.
Acclaimed Contributor

Re: splitting mirror for new VG

When using lvsplit

http://docs.hp.com/en/B3921-60631/lvsplit.1M.html

LVs are still part of the VG.

Is this a problem?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Vishu
Trusted Contributor

Re: splitting mirror for new VG

yes, they are. but i want to use those disks in a new VG. so i think they should not be a part of other VG anymore.

please suggest, or if you have some good steps of yours, please provide.
Vishu
Trusted Contributor

Re: splitting mirror for new VG

any help in it?
Vishu
Trusted Contributor

Re: splitting mirror for new VG

hey guys,

I have to perform this activity today. any help would be highly appreciated.
Aneesh Mohan
Honored Contributor

Re: splitting mirror for new VG

Hi,

Honestly , I didnt testet this.

I belive at the time of step 4 you may face some errror because of same vgid you are importing .

If am right then you can use vgchgid command to change

#vgchgid /dev/rdsk/c0t0d0 /dev/rdsk/c0t0d1 /dev/rdsk/c0t0d2

then you can do vgimport procedure.


Please let me know if it works :)

Aneesh
Wim Rombauts
Honored Contributor

Re: splitting mirror for new VG

I think you will just have to try.

It is not documented (not to my knowledge) what exactly happens with vgreduce.
If the disk information is not touched, you could try to import them as a new (but incomplete) volumegroup.
If vgreduce erases necessary information on the disks, you will be stuck.
Slawomir Gora
Honored Contributor

Re: splitting mirror for new VG

Hi,
look at chapter: Splitting a Volume Group
in doc:
http://docs.hp.com/en/5992-6576/ch03s03.html#vgsplit

Vishu
Trusted Contributor

Re: splitting mirror for new VG

Thanks for the responses.

But i can't use vgchgid as it is HPUX 11.11.

@Wim, you are right. as vgreduce will impact the VGRA of the disks, so they can't be exported.
but can i try by having a map file (in preview mode) of vg_data VG and then try importing new VG on those disks.

# vgimport -m /dev/vg_data1

Please suggest.
Aneesh Mohan
Honored Contributor

Re: splitting mirror for new VG

see my solution is to use lvsplit and no vgsplit and it is available in hpux 11.11

I would like to add few more additional things ...

a) may need to -f option while vgimport.

b) you may need to clean "b" lvol(split lvol) on primary vg using lvremove

c) you may need to clean source lvol on new vg using lvremove.

d) then you can use vgreduce -f primaryvg & vgreduce -f newvg


Aneesh
Aneesh Mohan
Honored Contributor

Re: splitting mirror for new VG

one thing I forgot to mention is please ignore your second step that is vgreduce ...

Aneesh
Aneesh Mohan
Honored Contributor
Solution

Re: splitting mirror for new VG

see..

1) split all LVs with lvsplit command so that there remain no mirror LV.

2) vgchgid the "b" lvol disks

3) Import the secondary disks in new vg with -f option

4) use lvremove to remove "b" lvols from source vg

5) use lvremove to remove source lvols from newvg


Aneesh
SoorajCleris
Honored Contributor

Re: splitting mirror for new VG

# lvcreate -n sooraj -l 2 vg00
Logical volume "/dev/vg00/sooraj" has been successfully created with
character device "/dev/vg00/rsooraj".
Logical volume "/dev/vg00/sooraj" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
[rx76-1p0]/
# newfs -Fvxfs /dev/vg00/sooraj
vxfs newfs: /dev/vg00/sooraj is not a character device
[rx76-1p0]/
# newfs -Fvxfs /dev/vg00/rsooraj
version 5 layout
16384 sectors, 16384 blocks of size 1024, log size 1024 blocks
unlimited inodes, largefiles not supported
16384 data blocks, 15288 free data blocks
1 allocation units of 32768 blocks, 32768 data blocks
last allocation unit has 16384 data blocks

[rx76-1p0]/

# pvcreate -f /dev/rdsk/c3t6d0

Physical volume "/dev/rdsk/c3t6d0" has been successfully created.

# vgextend vg00 /dev/dsk/c3t6d0
vgextend: Warning: Max_PE_per_PV for the volume group (4238) too small for this PV (4341).
Using only 4238 PEs from this physical volume.
Volume group "vg00" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

# lvextend -m 1 /dev/vg00/sooraj /dev/dsk/c3t6d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/sooraj" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
[rx76-1p0]/

# lvsplit /dev/vg00/sooraj
Logical volume "/dev/vg00/soorajb" has been successfully created with
character device "/dev/vg00/rsoorajb".
Logical volume "/dev/vg00/sooraj" has been successfully split.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
[rx76-1p0]/


# vgchgid -f /dev/rdsk/c3t6d0
vgchgid: disk "/dev/rdsk/c3t6d0" is already in vg "/dev/vg00".
[rx76-1p0]/

Here here it gives an error .....
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Aneesh Mohan
Honored Contributor

Re: splitting mirror for new VG

>>># vgchgid -f /dev/rdsk/c3t6d0
vgchgid: disk "/dev/rdsk/c3t6d0" is already in vg "/dev/vg00".

Oops dealing with vg00 ...

You need to export the orginal volume group ,then only it will allow to do vgchgid.

Using single user mode you can do it ,after seperating the things you can import both the volume groups using -f option.

Aneesh
SoorajCleris
Honored Contributor

Re: splitting mirror for new VG

excatly .. thats what I wanted to tell you ... :)
Thank you
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie