Operating System - HP-UX
1833758 Members
2143 Online
110063 Solutions
New Discussion

mirroring exsisting logical volumes

 
SOLVED
Go to solution
Jason_309
Regular Advisor

mirroring exsisting logical volumes

I am new to this so please bare with me.

I need to mirror exsiting logical volumes, but do not know how to do it. Can i get some help? Here is the two i need to mirror:

/dev/vg02/lvol3 67108864 6218840 60484592 9% /u09

/dev/vg02/lvol6 67108864 4256488 62501696 6% /u12


Thanks
21 REPLIES 21
Patrick Wallek
Honored Contributor
Solution

Re: mirroring exsisting logical volumes

First identify the disk/disks they are going to be mirrored to. Then make sure those disks are part of the VG02 volume group.

Once that is done:

# lvextend -m 1 /dev/vg02/lvol3 /dev/dsk/c?t?d?
# lvextend -m 1 /dev/vg02/lvol6 /dev/dsk/c?t?d?

Replace the c?t?d? with the address of the disks or disks you want to use for the mirror.
John Dvorchak
Honored Contributor

Re: mirroring exsisting logical volumes

First of all do you have Mirrordisk UX installed? If so then you have to verify that there are disks in the volume group available to use as a mirror. If so then the command is very simple:

lvextend -m 1 /dev/vg02/lvol3
lvextend -m 1 /dev/vg02/lvol6

If you don't have enough free disk extents(PE's) from a vgdisplay, the command will fail.

Also mirroring will not, by default work, if you try to mirror to the same physical disk drive.
If it has wheels or a skirt, you can't afford it.
John Poff
Honored Contributor

Re: mirroring exsisting logical volumes

Hi,

You might take a look at 'lvmerge' and 'lvsplit' also. I've never tried those before but they might be what you are looking for.

Also, I'm guessing that you meant for us to "bear" with you, instead of "bare" with you. :)

JP
Torsten.
Acclaimed Contributor

Re: mirroring exsisting logical volumes

for future use and learning about managing your system, have a look at this documentation:

http://forums1.itrc.hp.com/service/forums/getattachment.do?attachmentId=264528&ext=.txt

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!   
Sameer_Nirmal
Honored Contributor

Re: mirroring exsisting logical volumes

First you should identify a disk which you are going to use for mirroring those logical volumes through iosscan -fnC disk

1.Make it LVM disk by
pvcreate -f /dev/rdsk/c?t?d?

2.Add it to the Volume group of the existing disk to be mirrored vg02 in your case.
vgextend vg02 /dev/dsk/c?t?d?

3. Mirror the lvols using
lvextend -m 1 /dev/vg02/lvol3 /dev/dsk/c?t?d?
lvextend -m 1 /dev/vg02/lvol6 /dev/dsk/c?t?d?

Youa are done with mirroring those lvols!!!
Sandman!
Honored Contributor

Re: mirroring exsisting logical volumes

Must have MirrorDisk/UX product installed on system before you start mirroring.

# swlist -l bundle | grep -i mirrordisk

Are there spare disks in VG02 volume group. If not add them using pvcreate i.e.

# pvcreate /dev/rdsk/c#t#d#

Now mirror the specific lvol onto the above disk as follows:

# lvextend -m [# of mirrors] /dev/vg02/lvol3 /dev/dsk/c#t#d#

for example if you need to create one mirror copy then do the following:

# lvextend -m 1 /dev/vg02/lvol3 /dev/dsk/c#t#d#

cheers!
Jason_309
Regular Advisor

Re: mirroring exsisting logical volumes

I am actually trying to mirror
/dev/vg02/lvol3 67108864 6218840 60484592 9% /u09

to

/dev/vg02/lvol6 67108864 4256488 62501696 6% /u12

I am not adding new disks.

Patrick Wallek
Honored Contributor

Re: mirroring exsisting logical volumes

No can do. You can NOT mirror one lvol to a different lvol. LVM mirroring does not work like that.
Torsten.
Acclaimed Contributor

Re: mirroring exsisting logical volumes

can somebody help me holding down the control key while I'm pressing c or v? It was the wrong link, here is the right one:

http://docs.hp.com/en/5990-8172/ch06s02.html#cdebgaei

Jason, you need a blank disks for mirroring!



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!   
Jason_309
Regular Advisor

Re: mirroring exsisting logical volumes

All the disks on both lvo's are empty.
Torsten.
Acclaimed Contributor

Re: mirroring exsisting logical volumes

No, no - there is no disk on a lvol. the lvols are on the disks. I guess we have to start from beginning. Please give us some more information. first I suggest, post a "vgdisplay -v" ,a "strings /etc/lvmtab" and "ioscan -fnCdisk".

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!   
Jason_309
Regular Advisor

Re: mirroring exsisting logical volumes

vgdisplay -v:

--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4350
VGDA 4
PE Size (Mbytes) 8
Total PE 8680
Alloc PE 7136
Free PE 1544
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg00/lvol1
LV Status available/syncd
LV Size (Mbytes) 384
Current LE 48
Allocated PE 96
Used PV 2

LV Name /dev/vg00/lvol2
LV Status available/syncd
LV Size (Mbytes) 16384
Current LE 2048
Allocated PE 4096
Used PV 2

LV Name /dev/vg00/lvol3
LV Status available/syncd
LV Size (Mbytes) 256
Current LE 32
Allocated PE 64
Used PV 2

LV Name /dev/vg00/lvol4
LV Status available/syncd
LV Size (Mbytes) 256
Current LE 32
Allocated PE 64
Used PV 2

LV Name /dev/vg00/lvol5
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 512
Allocated PE 1024
Used PV 2

LV Name /dev/vg00/lvol6
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 128
Allocated PE 256
Used PV 2

LV Name /dev/vg00/lvol7
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 512
Allocated PE 1024
Used PV 2

LV Name /dev/vg00/lvol8
LV Status available/syncd
LV Size (Mbytes) 2048
Current LE 256
Allocated PE 512
Used PV 2


--- Physical volumes ---
PV Name /dev/dsk/c0t6d0
PV Status available
Total PE 4340
Free PE 772
Autoswitch On

PV Name /dev/dsk/c3t6d0
PV Status available
Total PE 4340
Free PE 772
Autoswitch On



VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 6
Open LV 6
Max PV 16
Cur PV 12
Act PV 12
Max PE per PV 17501
VGDA 24
PE Size (Mbytes) 4
Total PE 209988
Alloc PE 198838
Free PE 11150
Total PVG 2
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg01/lvol1
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 32768
Used PV 2

LV Name /dev/vg01/lvol2
LV Status available/syncd
LV Size (Mbytes) 69996
Current LE 17499
Allocated PE 34998
Used PV 4

LV Name /dev/vg01/lvol3
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 32768
Used PV 2

LV Name /dev/vg01/lvol4
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 32768
Used PV 2

LV Name /dev/vg01/lvol5
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 32768
Used PV 2

LV Name /dev/vg01/lvol6
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 32768
Used PV 2


--- Physical volumes ---
PV Name /dev/dsk/c4t0d0
PV Status available
Total PE 17499
Free PE 0
Autoswitch On

PV Name /dev/dsk/c4t1d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c4t2d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c4t3d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c4t4d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c4t5d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c6t8d0
PV Status available
Total PE 17499
Free PE 0
Autoswitch On

PV Name /dev/dsk/c6t9d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c6t10d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c6t11d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c6t12d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c6t13d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On


--- Physical volume groups ---
PVG Name PVG0
PV Name /dev/dsk/c4t0d0
PV Name /dev/dsk/c4t1d0
PV Name /dev/dsk/c4t2d0
PV Name /dev/dsk/c4t3d0
PV Name /dev/dsk/c4t4d0
PV Name /dev/dsk/c4t5d0

PVG Name PVG1
PV Name /dev/dsk/c6t8d0
PV Name /dev/dsk/c6t9d0
PV Name /dev/dsk/c6t10d0
PV Name /dev/dsk/c6t11d0
PV Name /dev/dsk/c6t12d0
PV Name /dev/dsk/c6t13d0


VG Name /dev/vg02
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 12
Act PV 12
Max PE per PV 17501
VGDA 24
PE Size (Mbytes) 4
Total PE 209988
Alloc PE 131072
Free PE 78916
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg02/lvol1
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 16384
Used PV 1

LV Name /dev/vg02/lvol2
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 16384
Used PV 1

LV Name /dev/vg02/lvol3
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 16384
Used PV 1

LV Name /dev/vg02/lvol4
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 16384
Used PV 1

LV Name /dev/vg02/lvol5
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 16384
Used PV 1

LV Name /dev/vg02/lvol6
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 16384
Used PV 1

LV Name /dev/vg02/lvol7
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 16384
Used PV 1

LV Name /dev/vg02/lvol8
LV Status available/syncd
LV Size (Mbytes) 65536
Current LE 16384
Allocated PE 16384
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c5t0d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c5t1d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c5t2d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c5t3d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c5t4d0
PV Status available
Total PE 17499
Free PE 17499
Autoswitch On

PV Name /dev/dsk/c5t5d0
PV Status available
Total PE 17499
Free PE 17499
Autoswitch On

PV Name /dev/dsk/c7t8d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c7t9d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c7t10d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c7t11d0
PV Status available
Total PE 17499
Free PE 1115
Autoswitch On

PV Name /dev/dsk/c7t12d0
PV Status available
Total PE 17499
Free PE 17499
Autoswitch On

PV Name /dev/dsk/c7t13d0
PV Status available
Total PE 17499
Free PE 17499
Autoswitch On


strings /etc/lvmtab:

strings /etc/lvmtab
/dev/vg00
/dev/dsk/c0t6d0
/dev/dsk/c3t6d0
/dev/vg01
/dev/dsk/c4t0d0
/dev/dsk/c4t1d0
/dev/dsk/c4t2d0
/dev/dsk/c4t3d0
/dev/dsk/c4t4d0
/dev/dsk/c4t5d0
/dev/dsk/c6t8d0
/dev/dsk/c6t9d0
/dev/dsk/c6t10d0
/dev/dsk/c6t11d0
/dev/dsk/c6t12d0
/dev/dsk/c6t13d0
/dev/vg02
/dev/dsk/c5t0d0
/dev/dsk/c5t1d0
/dev/dsk/c5t2d0
/dev/dsk/c5t3d0
/dev/dsk/c5t4d0
/dev/dsk/c5t5d0
/dev/dsk/c7t8d0
/dev/dsk/c7t9d0
/dev/dsk/c7t10d0
/dev/dsk/c7t11d0
/dev/dsk/c7t12d0
/dev/dsk/c7t13d0

Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
disk 0 1/0/0/3/0.6.0 sdisk CLAIMED DEVICE HP 36.4GST336753LC
/dev/dsk/c0t6d0 /dev/rdsk/c0t6d0
disk 1 1/0/0/3/1.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 305
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 2 1/0/1/0/0/1/1.6.0 sdisk CLAIMED DEVICE HP 36.4GST336753LC
/dev/dsk/c3t6d0 /dev/rdsk/c3t6d0
disk 3 1/0/2/0/0.0.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c4t0d0 /dev/rdsk/c4t0d0
disk 4 1/0/2/0/0.1.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c4t1d0 /dev/rdsk/c4t1d0
disk 5 1/0/2/0/0.2.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c4t2d0 /dev/rdsk/c4t2d0
disk 6 1/0/2/0/0.3.0 sdisk CLAIMED DEVICE HP 73.4GMAP3735NC
/dev/dsk/c4t3d0 /dev/rdsk/c4t3d0
disk 7 1/0/2/0/0.4.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c4t4d0 /dev/rdsk/c4t4d0
disk 8 1/0/2/0/0.5.0 sdisk CLAIMED DEVICE HP 73.4GMAP3735NC
/dev/dsk/c4t5d0 /dev/rdsk/c4t5d0
disk 9 1/0/4/0/0.0.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c5t0d0 /dev/rdsk/c5t0d0
disk 10 1/0/4/0/0.1.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c5t1d0 /dev/rdsk/c5t1d0
disk 11 1/0/4/0/0.2.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c5t2d0 /dev/rdsk/c5t2d0
disk 12 1/0/4/0/0.3.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c5t3d0 /dev/rdsk/c5t3d0
disk 13 1/0/4/0/0.4.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c5t4d0 /dev/rdsk/c5t4d0
disk 14 1/0/4/0/0.5.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c5t5d0 /dev/rdsk/c5t5d0
disk 15 1/0/6/0/0.8.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c6t8d0 /dev/rdsk/c6t8d0
disk 16 1/0/6/0/0.9.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c6t9d0 /dev/rdsk/c6t9d0
disk 17 1/0/6/0/0.10.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c6t10d0 /dev/rdsk/c6t10d0
disk 18 1/0/6/0/0.11.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c6t11d0 /dev/rdsk/c6t11d0
disk 19 1/0/6/0/0.12.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c6t12d0 /dev/rdsk/c6t12d0
disk 20 1/0/6/0/0.13.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c6t13d0 /dev/rdsk/c6t13d0
disk 21 1/0/14/0/0.8.0 sdisk CLAIMED DEVICE HP 73.4GMAP3735NC
/dev/dsk/c7t8d0 /dev/rdsk/c7t8d0
disk 22 1/0/14/0/0.9.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c7t9d0 /dev/rdsk/c7t9d0
disk 23 1/0/14/0/0.10.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c7t10d0 /dev/rdsk/c7t10d0
disk 24 1/0/14/0/0.11.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c7t11d0 /dev/rdsk/c7t11d0
disk 25 1/0/14/0/0.12.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c7t12d0 /dev/rdsk/c7t12d0
disk 26 1/0/14/0/0.13.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c7t13d0 /dev/rdsk/c7t13d0

John Dvorchak
Honored Contributor

Re: mirroring exsisting logical volumes

Both of the lvols have something in them because lvol3 has 9% and lvol6 has 6% used. Are you just going to throw the data away or is it backed up via tape or some other method? In any event you can't mirror one lvol to another.

Can you be more specific as to what you want to do? The mirror process mirrors data from one logical volume (LV) to another physical disk. If you are out of physical disks and you want to reclaim the disk space from one of the LV's to use as a mirror for the other then you have to remove that LV that is going to be the mirror with the lvremove command.

If you want to mirror the data on lvol3 then you will have to first do an lvdisplay /dev/vg02/lvol6 and note the disk ctd number that lvol6 lives on.

1. umount lvol3 and lvol6
2. lvremove /dev/vg02/lvol6
3. lvextend -m /dev/vg02/lvol3 /dev/dsk/c_t_d_ where the ctd numbers are the disk that lvol6 used to reside on.
4. mount /dev/vg02/lvol3
5. vi /etc/fstab and comment out the line that pointed to /dev/vg02/lvol6

If it has wheels or a skirt, you can't afford it.
Jason_309
Regular Advisor

Re: mirroring exsisting logical volumes

The data on those will be moved. We need to put some pro data files on disks with more space available and mirror it.
Sandman!
Honored Contributor

Re: mirroring exsisting logical volumes

Are you going to move data off both and then mirror them or just one of them and then mirror /dev/vg02/lvol3 onto /dev/vg02/lvol6 ??? Could you be more concrete as to what you're looking for?

regards
Jason_309
Regular Advisor

Re: mirroring exsisting logical volumes

All of the data on the lvol's will be moved.
To put production data on.
Sandman!
Honored Contributor

Re: mirroring exsisting logical volumes

You mean data on both lvol3 and lvol6 will be removed? In that case what are you trying to mirror.

thx
Jason_309
Regular Advisor

Re: mirroring exsisting logical volumes

We will be moving Prod data from other places.
Sandman!
Honored Contributor

Re: mirroring exsisting logical volumes

You'll be moving prod data from somewhere else onto /dev/vg02/lvol3 and /dev/vg02/lvol6? Which lvols are you trying to mirror then? Please be more specific and elaborate on your situation.

regards
Jason_309
Regular Advisor

Re: mirroring exsisting logical volumes

I am not sure i can be more descriptive. I want to mirror lvol6 and lvol3. Once they are mirroed we will be moving prod data to them.
Patrick Wallek
Honored Contributor

Re: mirroring exsisting logical volumes

You CAN NOT mirror one LVOL to another. It just doesn't work that way.

If you want to mirror you will have to remove one LVOL so you can the space to mirror the other LVOL.