Operating System - HP-UX
1833756 Members
2678 Online
110063 Solutions
New Discussion

Can't extend /home with space available

 
Johns Manville
Frequent Advisor

Can't extend /home with space available

I am trying to extend /home and when I run lvextend, I get the following error:
--------------------
# lvextend -l 472 /dev/vg00/lvol6
lvextend: Not enough free physical extents available.
Logical volume "/dev/vg00/lvol6" could not be extended.
Failure possibly caused by strict allocation policy
--------------------

Here is the lvol6 info from an lvdisplay:

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

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c1t2d0 169 169
/dev/dsk/c2t2d0 169 169
-----------------------

Here is the vgdisplay info:

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

As you can see, I have 268 PE free @ 4Mbytes per PE. My current allocated PE for lvol6 is 338. Since I can only use half of the free 268 PE, due to mirroring, 134 PE plus the used 338 PE equals the 472 PE I'm trying to extend to the file system.

The "strict allocation" issue would tend to indicate that there is not enough space on the second drive for mirroring. However, in checking both drives with pvdisplay, they are exactly the same with 134 free PE each. They should be able to mirror ok. Here is the pvdisplay info on one of the drives:

--- Physical volumes ---
PV Name /dev/dsk/c1t2d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 10
PE Size (Mbytes) 4
Total PE 4340
Free PE 134
Allocated PE 4206
Stale PE 0
IO Timeout (Seconds) 180
Autoswitch On
Proactive Polling On

--- Distribution of physical volume ---
LV Name LE of LV PE for LV
/dev/vg00/lvol1 75 75
/dev/vg00/lvol2 1024 1024
/dev/vg00/lvol3 50 50
/dev/vg00/lvol4 640 640
/dev/vg00/lvol5 125 125
/dev/vg00/lvol6 169 169
/dev/vg00/lvol7 448 448
/dev/vg00/lvol8 512 512
/dev/vg00/lvol9 1000 1000
/dev/vg00/lvol10 163 163
-----------------------------

Can anyone tell me what this issue is caused by and how I can extend this file system? Thanks.
15 REPLIES 15
Pete Randall
Outstanding Contributor

Re: Can't extend /home with space available

I suspect the culprit is your strict allocation policy for that lvol, which implies contiguous. Check the distribution of your available PEs to see if there are enough free contiguous extents available.

Shoud this be the case, you can turn off strict allocation with lvchange.


Pete

Pete
Johns Manville
Frequent Advisor

Re: Can't extend /home with space available

The configuration indicates that the contiguous requirement is turned off. I also ran "lvchange -C n /dev/vg00/lvol6" to make sure.

I could turn off strict, but my understanding is that will pretty much invalidate my mirroring. With strict turned off, it can write the mirrored bytes to the same drive, thereby nullifying the mirroring.

Are there any solutions that will preserve the integrity of the mirror?

Thanks.
Torsten.
Acclaimed Contributor

Re: Can't extend /home with space available

Since the setting is not

Allocation strict/contiguous

it is OK to set it to strict only.




The problem is here:

Current LE 169
Allocated PE 338

Your calculation:

338 + 134 = 472


But notice:

Current LE 169 !!!


Corrected:

169 + 134 = 303 !!!

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!   
Torsten.
Acclaimed Contributor

Re: Can't extend /home with space available

You need to run

# lvextend -l 303 /dev/vg00/lvol6

otherwise the message is correct, if you want to increse the LVOL from currently

169

to

472

you need

606

free extends - you don't have them.


;-))

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!   
Johns Manville
Frequent Advisor

Re: Can't extend /home with space available

I don't believe that makes any sense. Since when do you add LE to PE? Allocated is already 338 PE and extending to less than that won't work. I'm getting more confused.
Torsten.
Acclaimed Contributor

Re: Can't extend /home with space available

Let's have a look again:

Current LVOL size: 169 PE (*2 due to mirror = 338)

Free extends: 268 ( /2 due to mirror = 134)



current extends + free extends
169 + 134 = 303


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!   
Torsten.
Acclaimed Contributor

Re: Can't extend /home with space available

If you don't believe this ;-) look here:

--- Distribution of physical volume ---
LV Name LE of LV PE for LV
...
/dev/vg00/lvol6 169 169
...


LV Size (Mbytes) 676 ( /4MB = 169 extends)

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!   
Torsten.
Acclaimed Contributor

Re: Can't extend /home with space available

Does it make sense now?


Don't mix up with current and allocated PE's!

The number of allocated extends is *2 the current size, because it is mirrored!

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!   
Johns Manville
Frequent Advisor

Re: Can't extend /home with space available

By golly you are right. It worked fine. So, am I asleep this morning or have I been working with Linux too long? :)

Thanks for your help. I really, really appreciate it. This saved me from staying up Saturday night late.
Torsten.
Acclaimed Contributor

Re: Can't extend /home with space available

Sometimes the solution is directly in front of your eyes, but you cannot see it ...

Have fun!

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

Re: Can't extend /home with space available

The "-l" option of the lvextend command takes the value in LEs, not PEs. I think this is the source of your confusion. Check the man page if you don't believe me.

The calculation:

If your LV is not mirrored, you get one logical extent by allocating one physical extent.

If you use regular two-way mirroring, you will need 2 PEs for each LE; for three-way mirroring, it would be 3 PEs for each LE.

You wish to extend lvol6, which is already mirrored, so the ratio for the entire lvol6 is 2 PEs for LE.

You have 2 disks with 134 free PEs on each. If you use all the free space, with two-way mirroring you can get 2 * 134 / 2 = 134 new LEs.

So the largest possible new size for lvol6 is 169 existing LEs + 134 new LEs = 303 LEs.

MK
MK
Md. Minhaz Khan
Super Advisor

Re: Can't extend /home with space available

Dear Johns,

I think you mixed up with small "l" and capital "L" for HP-UX LVM. you should run one of below commands to solve your problem:

#lvextend -L 472 /dev/vg00/lvol6

or

#lvextend -l 303 /dev/vg00/lvol6

I am sure one of the above commands will solve your problem.

Thanks
Minhaz
Md. Minhaz Khan
Super Advisor

Re: Can't extend /home with space available

Sorry correct command is:

#lvextend -L 1212 /dev/vg00/lvol6

Or

#lvextend -l 303 /dev/vg00/lvol6

Thanks
Minhaz
AVV
Super Advisor

Re: Can't extend /home with space available

@Torsten - Commentable diagnose.

@ Johns,


Please use

#lvextend -L /dev/vgxx/lvolxx.

It will help you in calculation as you could see the current size in MB using lvdisplay.

Anyway.....learning is experience and experience can be used to help ....as Torsten did.
Taifur
Respected Contributor

Re: Can't extend /home with space available

Hi,

Follow below steps,

1. umount /dev/vg00/lvol6 /home
2. lvchange -s n /dev/vg00/lvol6
lvchange -C n /dev/vg01/lvol6
3.lvextend -L /dev/vg00/lvol6

Hope, it will help for lvextend.

Rgds//
Taifur