Operating System - HP-UX
1827099 Members
3986 Online
109714 Solutions
New Discussion

Failing to mirror LV despite sufficient PEs

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Failing to mirror LV despite sufficient PEs

Hello LVM wizzards,

although I nominally have sufficient PEs in a VG when I try to mirror one LV from that VG with less allocated PEs than the remaining free I get the following response from LVM:

# lvextend -m 1 /dev/vg06/lvol4
lvextend: Not enough free physical extents available.
Logical volume "/dev/vg06/lvol4" could not be extended.
Failure possibly caused by strict allocation policy

OK, the reason seems to be the strict allocation policy.

Here are the stats of vg06 and that lvol4:

# vgdisplay vg06
--- Volume groups ---
VG Name /dev/vg06
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 4
Open LV 4
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 25000
VGDA 4
PE Size (Mbytes) 4
Total PE 8680
Alloc PE 7348
Free PE 1332
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

# lvdisplay /dev/vg06/lvol4
--- Logical volumes ---
LV Name /dev/vg06/lvol4
VG Name /dev/vg06
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 3000
Current LE 750
Allocated PE 750
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

As you can see, 750 PEs necessary for mirroring vs. 1332 still available.

In the manpage of lvchange I read about the -D flag for specifying the distributed allocation policy.
Would that be an option if I issued something like

# lvchange -D f /dev/vg06/lvol4

TIA
Ralph
Madness, thy name is system administration
6 REPLIES 6
Bill McNAMARA_1
Honored Contributor
Solution

Re: Failing to mirror LV despite sufficient PEs

strings /etc/lvmtab

look for the /dev/dsk/cxtydz belonging to the vg06.

Then pvdisplay /dev/dsk/...

You'll probably find that the free PE are all on the same disk that the lvol6 is on and mirrordisk won't mirror on the same disk unless you change strict policy to no..

man pvmove to start moving lvols around one pv to another..
Use lvdisplay -v /dev/vg06/lvol6
to find out placement of the lvol

Later,
Bill
It works for me (tm)
Robin Wakefield
Honored Contributor

Re: Failing to mirror LV despite sufficient PEs

Hi Ralph,

The -D switch is for evenly distributing an LV across a number of disks to share the load, normally done when you set up the LV initially. Your problem is to do with the strict allocation on your LV, which forces the mirror copy to be on a different physical disk.

You can switch this off, but there is no point in mirroring if both halves are (even partially) on one disk.

If you do a "vgdisplay -v" you should see that the disks you're currently not using do not have enough space on them for the mirror copy, so extra/bigger disks are required.

Rgds, Robin.
Manel Ventura
Advisor

Re: Failing to mirror LV despite sufficient PEs

Hi,
I suppose that the disks have the same capacity. Review that there are not inconsistencies at disk level (pvdisplay - v 'disk1', pvdisplay - v 'disk2').

If you can?t see the problem, remove the mirror disk of the VG, create their LVM structure again and recreate another time the mirror of all the LVs.
Christopher McCray_1
Honored Contributor

Re: Failing to mirror LV despite sufficient PEs

Try specifying the other disk in the vg at the end of your lvextend command. If you only have two disks, you'll want the mirror on the other pv. I don't think it liked it because it assumed the same disk the original lv is on.

Good luck,
Chris
It wasn't me!!!!
eran maor
Honored Contributor

Re: Failing to mirror LV despite sufficient PEs

Hi

another thin kthat i would check is if you are working with PVG-strict/contiguous allocation policy .

if yes i would check the file /etc/lvmpvg to see the order of the PVG
listed in the /etc/lvmpvg file. For example:

(A failing /etc/lvmpvg file: )

VG /dev/vg_burn
PVG c2b
/dev/dsk/c2t6d0
PVG c2a
/dev/dsk/c2t5d0

(A working /etc/lvmpvg file: )

VG /dev/vg_burn
PVG c2a
/dev/dsk/c2t5d0
PVG c2b
/dev/dsk/c2t6d0
if the file in not correct is will prevent you to mirror a logical voulme even if you have free space .
love computers
Ralph Grothe
Honored Contributor

Re: Failing to mirror LV despite sufficient PEs

Thank you all for your suggestions.

Bill, I'm really an idiot.
Of course lvextend rejected to mirror on the same disk while strict allocation is effective.
You were right, the free PEs are all on one disk (I should have checked before posting):

# vgdisplay -v vg06 | awk '/PV Name/ || /Free PE/'
Free PE 1500
PV Name /dev/dsk/c1t1d0
Free PE 0
PV Name /dev/dsk/c2t1d0
Free PE 1500

Robin and others,
I totally agree that it wouldn't make much sense to mirror to the same disk.

Looks as though we will have to get some new disk space.
Madness, thy name is system administration