Hi,
I am facing problem while creating a Logical Volume
on a Multipath Lun.
There are 4 paths to a LUN. The corresponding scsi
devices are /dev/sdg, /dev/sdu, /dev/sdba, /dev/sdbj.
1. Initially there were no PVs, VGs and
LVs.
[root@PC-P31211 root]# pvscan
pvscan --
reading all physical volumes (this may take a while...)
pvscan -- ERROR
"pv_read(): read" reading physical volumes
[root@PC-P31211 root]#
vgscan
vgscan -- reading all physical volumes (this may take a
while...)
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully
created
vgscan -- WARNING: This program does not do a VGDA backup of your
volume group
[root@PC-P31211 root]# lvscan
lvscan -- no volume
groups found
2. Then I created a PV on /dev/sdg1. (I had already
created partitions of sdg)
[root@PC-P31211 root]# pvcreate
/dev/sdg1
pvcreate -- physical volume "/dev/sdg1" successfully
created
The o/p of pvscan is as follows,
[root@PC-P31211 root]# pvscan
pvscan --
reading all physical volumes (this may take a while...)
pvscan -- inactive PV
"/dev/sdg1" is in no VG [402.61 MB]
pvscan -- inactive PV
"/dev/sdu1" is in no VG [402.61 MB]
pvscan -- inactive PV
"/dev/sdba1" is in no VG [402.61 MB]
pvscan -- inactive PV "/dev/sdbj1"
is in no VG [402.61 MB]
pvscan -- total: 4 [1.57 GB] / in use: 0 [0] /
in no VG: 4 [1.57 GB]
Here u can notice that even though I have created
PV on sdg, pvscan shows all the scsi devices which are pointing to the same
LUN.
3. Then I created a VG on PV /dev/sdg1
[root@PC-P31211 root]# vgcreate test_vg
/dev/sdg1
vgcreate -- INFO: using default physical extent size 4
MB
vgcreate -- INFO: maximum logical volume size is 255.99
Gigabyte
vgcreate -- doing automatic backup of volume group
"test_vg"
vgcreate -- volume group "test_vg" successfully created and
activated
The o/p of vgscan & pvscan is as follows,
[root@PC-P31211 root]# vgscan
vgscan --
reading all physical volumes (this may take a while...)
vgscan -- found
active volume group "test_vg"
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d"
successfully created
vgscan -- WARNING: This program does not do a VGDA
backup of your volume group
[root@PC-P31211 root]# pvscan
pvscan --
reading all physical volumes (this may take a while...)
pvscan --
ACTIVE PV "/dev/sdg1" of VG "test_vg" [396 MB / 396 MB
free]
pvscan -- inactive PV "/dev/sdu1" of VG "test_vg" [396 MB / 396
MB free]
pvscan -- inactive PV "/dev/sdba1" of VG "test_vg" [396 MB / 396 MB
free]
pvscan -- inactive PV "/dev/sdbj1" of VG "test_vg" [396 MB / 396 MB
free]
pvscan -- total: 4 [1.57 GB] / in use: 4 [1.57 GB] / in no VG: 0
[0]
4. Then I tried to create LV on "test_vg". But that
gave me error.
[root@PC-P31211 root]# lvcreate -L 50 -n
test_lv test_vg
lvcreate -- rounding size up to physical extent
boundary
lvcreate -- ERROR "No such device or address" creating VGDA for
"/dev/test_vg/te
st_lv" in kernel
Also see the results of lvscan & lvdisplay
which are contradictory.
[root@PC-P31211 root]# lvscan
lvscan --
ACTIVE
"/dev/test_vg/test_lv" [52 MB]
lvscan -- 1 logical volumes with 52 MB total
in 1 volume group
lvscan -- 1 active logical volumes
[root@PC-P31211 root]# lvdisplay
/dev/test_vg/test_lv
lvdisplay -- logical volume "/dev/test_vg/test_lv"
doesn't exist
Can any body help me to solve this
problem???
Somebody suggested me a solution...
a. Deactivate VG
b. Run vgscan
c. Activate VG
d. Create LV.
I followed these step. The o/p is given
below.
[root@PC-P31211 root]# vgchange -an
vgchange
-- volume group "test_vg" successfully deactivated
[root@PC-P31211
root]# vgscan
vgscan -- reading all physical volumes (this may take a
while...)
vgscan -- found inactive volume group "test_vg"
vgscan --
"/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING:
This program does not do a VGDA backup of your volume
group
[root@PC-P31211 root]# vgchange -ay
vgchange -- volume
group "test_vg" successfully activated
[root@PC-P31211 root]#
pvscan
pvscan -- reading all physical volumes (this may take a
while...)
pvscan -- inactive PV "/dev/sdg1" of VG "test_vg" [396 MB /
396 MB free]
pvscan -- inactive PV "/dev/sdu1" of VG "test_vg" [396 MB
/ 396 MB free]
pvscan -- inactive PV "/dev/sdba1" of VG "test_vg" [396 MB /
396 MB free]
pvscan -- ACTIVE PV "/dev/sdbj1" of VG "test_vg"
[396 MB / 396 MB free]
pvscan -- total: 4 [1.57 GB] / in use: 4 [1.57 GB] /
in no VG: 0 [0]
[root@PC-P31211 root]# lvcreate -L 50 -n test_lv
test_vg
lvcreate -- rounding size up to physical extent boundary
lvcreate
-- doing automatic backup of "test_vg"
lvcreate -- logical volume
"/dev/test_vg/test_lv" successfully created
[root@PC-P31211 root]#
lvscan
lvscan --
ACTIVE
"/dev/test_vg/test_lv" [52 MB]
lvscan -- 1 logical volumes with 52 MB total
in 1 volume group
lvscan -- 1 active logical
volumes
[root@PC-P31211 root]# lvdisplay
/dev/test_vg/test_lv
--- Logical volume ---
LV
Name
/dev/test_vg/test_lv
VG
Name
test_vg
LV Write Access
read/write
LV
Status
available
LV
#
1
#
open
0
LV
Size
52 MB
Current
LE
13
Allocated LE
13
Allocation
next free
Read ahead sectors 120
Block
device
58:0
This apporach helped me to create the Logical
Volume. But it does not fulfill my requirement. Here initially I had
created VG on sdg1, but after doing (vgchange -an, vgscan, vgchage -ay) that VG
got shifted on sdbj. And hence LV will also be created on this LV. But I want LV
to be created on sdj only. Is there any solution to my problem???
Regards,
Sameer
Halgatti