From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <02ee01c2dadc$7e7ff310$020010ac@romio> From: "Roman Gavrilov" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_02EB_01C2DAED.41FC8E10" Subject: [linux-lvm] lvm mirroring Sender: linux-lvm-admin@sistina.com Errors-To: linux-lvm-admin@sistina.com Reply-To: linux-lvm@sistina.com List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: Date: Sat Feb 22 10:41:04 2003 List-Id: To: linux-lvm@sistina.com This is a multi-part message in MIME format. ------=_NextPart_000_02EB_01C2DAED.41FC8E10 Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: quoted-printable Hello, I have 2 physical discs. I have 4 partitions on the first disk.=20 I created a volume group "lvmhd" from all of the partitions and later = created logical volumes. this is the result from the vgdisplay --- Volume group --- VG Name lvmhd VG Access read/write VG Status available/resizable VG # 0 MAX LV 256 Cur LV 3 Open LV 3 MAX LV Size 2 TB Max PV 256 Cur PV 4 Act PV 4 VG Size 35.59 GB PE Size 32 MB Total PE 1139 Alloc PE / Size 1131 / 35.34 GB Free PE / Size 8 / 256 MB VG UUID xqamqE-9gSs-Xy3O-2tVQ-wYzy-Cp3u-0Wivbd and those are the logical volumes /dev/lvmhd/lvm_usr 3.0G 980M 1.8G 35% /usr /dev/lvmhd/lvm_var 4.9G 65M 4.6G 2% /var /dev/lvmhd/lvm_home 27G 33M 25G 1% /home later I mirrored the first disk to the second disk with dd if=3D/dev/hda = of=3D/dev/hdb so if the first disk breaks I can remove it and replace it = with the second disk and get the server up in minutes. Now I want to be able to use the second disk while I am running from the = first. But the volume groups are the same and I am afraid that if I will = recreate the logical volumes I'll ruin some thing on the second disk. Is there anything I can do about it so I could use the second disk for = backups but still have the same architecture as the primary disk ? is there any way to mount those logical volumes which are mirrors of the = primary disk ? for example I can do=20 pvdisplay /dev/hdb3 (this is the slave disk which is the mirror of the = primary and its not mounted) --- Physical volume --- PV Name /dev/hdb3 VG Name lvmhd PV Size 13.67 GB [28676025 secs] / NOT usable 32.19 MB = [LVM: 129 KB] PV# 1 PV Status available Allocatable yes (but full) Cur LV 3 PE Size (KByte) 32768 Total PE 436 Free PE 0 Allocated PE 436 PV UUID 5XenPH-2NLb-cmN0-qEBb-QGuJ-zWxv-otMr7i thanks ------=_NextPart_000_02EB_01C2DAED.41FC8E10 Content-Type: text/html; charset="windows-1255" Content-Transfer-Encoding: quoted-printable
Hello,
 
I have 2 physical discs.
I have 4 partitions on the first disk.=20
I created a volume group "lvmhd" from = all of the=20 partitions and later created logical volumes.
 
this is the result from the = vgdisplay
--- Volume group ---
VG=20 Name           &nb= sp;  =20 lvmhd
VG=20 Access           &= nbsp;=20 read/write
VG=20 Status           &= nbsp;=20 available/resizable
VG=20 #            =      =20 0
MAX=20 LV            = ;   =20 256
Cur=20 LV            = ;   =20 3
Open=20 LV            = ;  =20 3
MAX LV = Size           2=20 TB
Max=20 PV            = ;   =20 256
Cur=20 PV            = ;   =20 4
Act=20 PV            = ;   =20 4
VG=20 Size           &nb= sp;  =20 35.59 GB
PE=20 Size           &nb= sp;  =20 32 MB
Total=20 PE            = ; =20 1139
Alloc PE / Size       1131 / 35.34 = GB
Free  PE / Size       8 / 256 = MB
VG=20 UUID           &nb= sp;  =20 xqamqE-9gSs-Xy3O-2tVQ-wYzy-Cp3u-0Wivbd
and those are the logical = volumes
/dev/lvmhd/lvm_usr    = 3.0G =20 980M  1.8G  35% /usr
/dev/lvmhd/lvm_var   =20 4.9G   65M  4.6G   2%=20 /var
/dev/lvmhd/lvm_home    27G   = 33M  =20 25G   1% /home
later I mirrored the first disk to the = second disk=20 with dd if=3D/dev/hda of=3D/dev/hdb so if the first disk breaks I can = remove it and=20 replace it with the second disk and get the server up in = minutes.
 
Now I want to be able to use the second = disk while=20 I am running from the first. But the volume groups are the same and I am = afraid=20 that if I will recreate the logical volumes I'll ruin some thing on the = second=20 disk.
Is there anything I can do about it so = I could use=20 the second disk for backups but still have the same architecture as the = primary=20 disk ?
is there any way to mount those logical = volumes=20 which are mirrors of the primary disk ?
for example I can do
pvdisplay /dev/hdb3 (this is the slave = disk which=20 is the mirror of the primary and its not mounted)
--- Physical volume = ---
PV=20 Name           &nb= sp;  =20 /dev/hdb3
VG=20 Name           &nb= sp;  =20 lvmhd
PV=20 Size           &nb= sp;  =20 13.67 GB [28676025 secs] / NOT usable 32.19 MB [LVM: 129=20 KB]
PV#          &nb= sp;       =20 1
PV=20 Status           &= nbsp;=20 available
Allocatable        &= nbsp; =20 yes (but full)
Cur=20 LV            = ;   =20 3
PE Size (KByte)       32768
Total=20 PE            = ; =20 436
Free=20 PE            = ;  =20 0
Allocated PE         =20 436
PV=20 UUID           &nb= sp;  =20 5XenPH-2NLb-cmN0-qEBb-QGuJ-zWxv-otMr7i
thanks
------=_NextPart_000_02EB_01C2DAED.41FC8E10--