1752681 Members
5244 Online
108789 Solutions
New Discussion юеВ

lvextend oddity

 
Jerod Prothe
New Member

lvextend oddity

Greetings,
I have never added a disk drive before but read some forums and man pages on commands and tried it out.
What happened was I added a 9.1 GB disk, made it an eligible physical volume, extended a volume group and extended a logical volume to the new disk (or so I thought). I got the "Not enough free physical extents" message and tried a smaller number for the lvextend command.
I rebooted and received a core dump and bdf does not reflect the added disk. The system came up fine (except for the dump).
Attached is a (large) document that has the commands I entered and the output from those commands.
What am I missing? Thanks.
HP-UX 11.0, A3311A disk enclosure on HP 9000
8 REPLIES 8
Stuart Abramson_2
Honored Contributor

Re: lvextend oddity

you have probably exceeded the maximum PE count for the VG. If so, there is no way to add the PV to the VG. Create another VG to hold the new PV and add file systems from the new VG.

Here is how this happens:
Maximum PE count is set when you add the first PV to the VG. If the 2nd PV is bigger than the first, then he can't fit.
Kent Ostby
Honored Contributor

Re: lvextend oddity

Jerod --
Did you extend the filesystem after extending the logical volume ?

fsadm or extendfs is needed to extend the filesystem before the space will be available to the filesystem and before it will show up in bdf.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Helen French
Honored Contributor

Re: lvextend oddity

The issue is you are trying to add a bigger capacity disk to the VG than the original disk. When you create VGs, the Max PE per PV is set default to 1016 and the PE size will be 4MB. With these default configs, the max. PV size you can add to that VG in future will be 1016 x 4 = 4GB. Now if you have used these defaults when you created your VG at the first time, you cannot add a 9GB disk to it.

Possible solution is: Create a new VG without using defaults (set Max PE/PV and PV size to a desired value) and with 9GB disk. Take backups of old VG data, remove that VG and add those disks to the new VG. Then restore data from backup.
Life is a promise, fulfill it!
Helen French
Honored Contributor

Re: lvextend oddity

Typo .. In the second part, read "set max PE/PV and PE size to desired value"

# man vgcreate
Life is a promise, fulfill it!
GK_5
Regular Advisor

Re: lvextend oddity

VG01 was created with a disk of only 1016PE. So the maximum PE a disk in vg01 can have is 1016. So even though your disk has 2170 PE, only 1016 have been used.
# vgdisplay -v /dev/vg01 will show MAX PE per PV.

Volume group property needs to be updated.
IT is great!
Jerod Prothe
New Member

Re: lvextend oddity

HP technician advised to create new volume group for the contents of lvol2. I did not create a new file system and was overlooking the limitations of the commands. Thanks to all. Forums are great.
RolandH
Honored Contributor

Re: lvextend oddity

Hi Jerod,

it is all possibel what you have made. But you have added a 9GB disk to a VG who is restricted to 1016 PE per PV (each 4MB = max 4064MB per PV). So you must be aware that you will waste the half of the size of the 9GB disk.
So I recommend you to create a new vg with 4 lvol in there with the size you need for each lvol of your vg01 and then copy the data to new lvol's. Use the double of max PE what is possible (if PE size is 4MB). ie. 9GB disk = max. 2250 PE. But you take 4500 in case you will add the next time a 18GB disk to that vg.
After the copy is complete and correct (unmount the old lvols and mount the new one on the mount points) you can add the 4GB disk to the new vg.

That what I would do. Otherwise you came in trouble if you must extend our vg again no more free PE and you have only one 18GB disk you can add. Then you waste a lot of space. Keep that in mind.

Roland
Sometimes you lose and sometimes the others win
Sunil Sharma_1
Honored Contributor

Re: lvextend oddity

Hi,
There is small problem, infact your logical volume is not extended so change will not reflect.

In your case you can use only 1016 PE out of 2000 Odd PE. this value is defined at the time of cration of voulme group.

So you can extend you logical volume maximum by 1016x4=4064MB (Default 1PE=4MB) but you specified 5000 MB so lvextend command got failed.

You again run command with 4000 MB argument and extend FS also then it will reflect your new size.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***