Operating System - HP-UX
1834346 Members
2011 Online
110066 Solutions
New Discussion

Re: LVM and vgcreate ques...

 
SOLVED
Go to solution
Chris Fadrowski
Super Advisor

LVM and vgcreate ques...

i want to create a vg at 400 gb. Its failing because i believe i need to do something like

vgcreate -s 8 vg16 /dev/dsk/cxtxdx

meaning i have to explicitly tell it -s 8

is this the case? the error i get states its too big. Can someone tell me the proper syntax for creating that lun?
22 REPLIES 22
Geoff Wild
Honored Contributor

Re: LVM and vgcreate ques...

Try this:

vgcreate -s 16 -p 32 -e 32768 /dev/vg16 /dev/dsk/cxtxdx

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Chris Fadrowski
Super Advisor

Re: LVM and vgcreate ques...

what is the -p 32 mean?
James R. Ferguson
Acclaimed Contributor
Solution

Re: LVM and vgcreate ques...

Hi:

Every physical disk has n-number of physical extents into which it can be carved. THe maximum number of extents is dependent upon the extent SIZE and the overall size of the disk itself.

In the case above, '-s 8' means an extent size of 8MB. For a 400GB volume group, you would need 400*1000/8 or 50,000 total extents.

Too, ONE physical extent holds the LVM header for a volume group. Referencing the switches defined for 'vgcreate', the size of the LVM header is dependent on the extent size ('-s'), the number of extents possible in the volume group ('-e') and the maximum number of physical volumes the volume group will ever hold ('-p'). To a lesser extent, the maximum number of logical volumes allowed ('-l') also contributes to the LVM header size.

Hence, if you do a 'vgcreate' using the default values of '-s', '-e', and '-p' you may find that your LVM header is too large to fit in a 4MB (default) extent. Increasing the extent size to 8MB may be sufficient.

Regards!

...JRF...
Geoff Wild
Honored Contributor

Re: LVM and vgcreate ques...

-p max_pv Set the maximum number of physical volumes
that the volume group is allowed to contain.
The default value for max_pv is 16. The
maximum number of physical volumes can be a
value in the range 1 to 255.


-s pe_size number of megabytes in each physical extent

-e max_pe maximum number of physical extents


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Chris Fadrowski
Super Advisor

Re: LVM and vgcreate ques...

Not working. here is what i get

root@host:/>vgcreate -s 16 -p 32 -e 32768 /dev/vgc32 /dev/dsk/ch8t2d6
Volume group "/dev/vgc32" has been successfully created.
Volume Group configuration for /dev/vgc32 has been saved in /etc/lvmconf/vgc32.conf
root@host:/>lvcreate -L 400000 -n lvol132 vgc32
Logical volume "/dev/vgc32/lvol132" has been successfully created with
character device "/dev/vgc32/rlvol132".
lvcreate: Not enough free physical extents available.
Logical volume "/dev/vgc32/lvol132" could not be extended.
Run the "lvextend" command to create space on the Logical Volume.


in the past i have used this

vgcreate -s 8 vgc32 /dev/dsk/c8t2d6

and then

lvcreate -L 400000 -n lvol132 vgc32

and it worked.
Torsten.
Acclaimed Contributor

Re: LVM and vgcreate ques...

The question is: How large is the disk?

You did
vgcreate -s 16 -p 32 -e 32768 /dev/vgc32 /dev/dsk/ch8t2d6

this is in fact

vgcreate -s 16 /dev/vgc32 /dev/dsk/ch8t2d6
(+ the limits) PE size is 16MB

What is "vgdisplay -v" showing?

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!   
Geoff Wild
Honored Contributor

Re: LVM and vgcreate ques...

400000 =approx 390 GB

vgdisplay vgc32


Multiply "Free PE" x "PE Size"

Example, 23720 x 32 = 759040 MB

divide by 1024 = 741.25 GB

400GB = 409600 MB

lvcreate -L 409600 -n lvol132 vgc32

Rgds...Geoff


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Chris Fadrowski
Super Advisor

Re: LVM and vgcreate ques...



root@host:/>vgcreate -s 16 -p 32 -e 32768 /dev/vgc32 /dev/dsk/ch8t2d6
Volume group "/dev/vgc32" has been successfully created.
Volume Group configuration for /dev/vgc32 has been saved in /etc/lvmconf/vgc32.conf
root@host:/>lvcreate -L 400000 -n lvol132 vgc32
Logical volume "/dev/vgc32/lvol132" has been successfully created with
character device "/dev/vgc32/rlvol132".
lvcreate: Not enough free physical extents available.
Logical volume "/dev/vgc32/lvol132" could not be extended.
Run the "lvextend" command to create space on the Logical Volume.



here is the vgdisplay -v

--- Volume groups ---
VG Name /dev/vgc32
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 32
Cur PV 1
Act PV 1
Max PE per PV 32768
VGDA 2
PE Size (Mbytes) 16
Total PE 6398
Alloc PE 0
Free PE 6398
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vgc32/lvol132
LV Status available/syncd
LV Size (Mbytes) 0
Current LE 0
Allocated PE 0
Used PV 0


--- Physical volumes ---
PV Name /dev/dsk/ch8t2d6
PV Status available
Total PE 6398
Free PE 6398
Autoswitch On


still doesn't like the lvcreate
Torsten.
Acclaimed Contributor

Re: LVM and vgcreate ques...

To add this:

You can run the command even on a disk that is 16MB in size:

vgcreate -s 16 -p 32 -e 32768 /dev/vgc32 /dev/dsk/ch8t2d6


(should be c8t2d6 - "h" is wrong here)


This make no sense but it is possible.
The command says nothing about the disk size.

Be aware of what lvcreate does:
...lv_size is rounded up to the nearest multiple of the logical extent size...

As a result of multiple rounded values during the creation process your own calculation sometimes not match the reality ...

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: LVM and vgcreate ques...

...
PE Size (Mbytes) 16
Total PE 6398
Alloc PE 0
Free PE 6398
...

16MB * 6398 PE = 102368MB

This is not 400GB!

Your LUN is probably too small ...

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!   
Chris Fadrowski
Super Advisor

Re: LVM and vgcreate ques...

this is from another server is which i just used -s 8 option

--- Volume groups ---
VG Name /dev/vgy20
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 51199
VGDA 2
PE Size (Mbytes) 8
Total PE 51192
Alloc PE 50000
Free PE 1192
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vgy20/lvol120
LV Status available/syncd
LV Size (Mbytes) 400000
Current LE 50000
Allocated PE 50000
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/ch5t1d2
PV Name /dev/dsk/c7t1d2 Alternate Link
PV Name /dev/dsk/c5t1d2 Alternate Link
PV Status available
Total PE 51192
Free PE 1192
Autoswitch On


i verified the LUN is exactly 400gb on the SAN. the cH is for "hitachi" disk. it's just what it does once it finds the disk attached to the server.

all i have ever done on previous servers was this command and it worked just fine..

vgcreate -s 8 vgc25 /dev/dsk/chxtxdx

lvcreate -L 400000 -n lvolxxx vgc25

and it worked like a charm. not sure why its not working here.
Geoff Wild
Honored Contributor

Re: LVM and vgcreate ques...

Dietmar posted a great utility called lvmcompute in:

http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=747334&admit=109447627+1199390502421+28353475

It will compute sizes for you.

As Torsten says - your LUN is too small for a lv of 400 GB - unless you add more of them.

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Torsten.
Acclaimed Contributor

Re: LVM and vgcreate ques...

... not sure why it is not working here ...


PE Size (Mbytes) 8
Total PE 51192


8MB * 51192 PE = 409536 MB

You are using a much bigger LUN on the other system.

The value "-s 8" has almost nothing to do with this.



A smal disk/LUN is just a small disk/LUN.

A larger disk is just larger ...

;-)

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: LVM and vgcreate ques...

In your other thread you say

"All luns created have been 100 gb."


http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1146585


I'm sure you are using one of them now.



BTW,
your profile shows

"I have assigned points to 280 of 701"


You should change this ...

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!   
Geoff Wild
Honored Contributor

Re: LVM and vgcreate ques...

Run

diskinfo /dev/dsk/ch8t2d6

It will be less then 400GB...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Chris Fadrowski
Super Advisor

Re: LVM and vgcreate ques...

the lun is 400 gb on the san that it's attached too. i triple checked this.

the only thing i can think of is, the lun is still may be formatting on the SAN and the system isn't seeing all of the LUN.

this could be a possibility. the lun should come out to 409600 as someone stated above. so lvcreate'g a 400 gb lun should be no problem. It just can't be bigger than 409600.
Chris Fadrowski
Super Advisor

Re: LVM and vgcreate ques...

Yes all my other luns are at 100 gb. i create one 400 gb lun for each oracle box for segments. I am more of a SAN admin so this part i am sure of.

i appreciate everyone's patience on this matter. Thank you greatly.
Torsten.
Acclaimed Contributor

Re: LVM and vgcreate ques...

I have never seen a "h" in a device file before.

The "ioscan -fn" result may be interesting.

Anyway, run "diskinfo" on this device file to be sure what the system can see ...

We are talking about LUN 22 if this helps ...

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!   
Chris Fadrowski
Super Advisor

Re: LVM and vgcreate ques...

the diskinfo solved the problem. even thou the disk LUN was formatted, the system is only showing this...

root@host:/>diskinfo /dev/rdsk/ch8t2d6
SCSI describe of /dev/rdsk/ch8t2d6:
vendor: HITACHI
product id: DF600F
type: direct access
size: 204857600 Kbytes
bytes per sector: 512

which means its only seeing about 200gb for some reason. i have a suspicion it's the driver for the disk on the san. i checked the LUN and it is 400gb but the system is only seeing half for some reason. either way, got some more to look at.

thank you again for your patience. Points have been assigned.
Torsten.
Acclaimed Contributor

Re: LVM and vgcreate ques...

Again, The "ioscan -fn" result may be interesting.

Are you using special drivers?

It really looks like the disk size is still changing (at least from 100GB to 200GB).

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!   
Chris Fadrowski
Super Advisor

Re: LVM and vgcreate ques...

i agree. I noticed it changed thats why i thought the disk wasn't complete with it's format. When it showed it was thats where the diskinfo stopped with 204857600

ioscan -fn below

yes, Hitachi requires HDLM drivers be run against disks that are added. it loads it into the kernel.



disk 53 0/2/1/0.97.8.19.0.2.1 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c10t2d1
disk 54 0/2/1/0.97.8.19.0.2.2 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c10t2d2
disk 55 0/2/1/0.97.8.19.0.2.3 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c10t2d3
disk 56 0/2/1/0.97.8.19.0.2.4 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c10t2d4
disk 57 0/2/1/0.97.8.19.0.2.5 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c10t2d5
disk 62 0/2/1/0.97.8.19.0.2.6 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c10t2d6
disk 63 0/2/1/0.97.8.19.0.2.7 zdlmfdrv NO_HW DEVICE HITACHI DF600F
/dev/dlm/c10t2d7
target 7 0/2/1/0.97.8.19.0.3 tgt NO_HW DEVICE
disk 64 0/2/1/0.97.8.19.0.3.0 zdlmfdrv NO_HW DEVICE HITACHI DF600F
/dev/dlm/c10t3d0
disk 65 0/2/1/0.97.8.19.0.3.1 zdlmfdrv NO_HW DEVICE HITACHI DF600F
/dev/dlm/c10t3d1
ext_bus 11 0/2/1/0.97.8.255.1 fcpdev CLAIMED INTERFACE FCP Device Interface
target 3 0/2/1/0.97.8.255.1.3 tgt CLAIMED DEVICE
ctl 7 0/2/1/0.97.8.255.1.3.0 sctl CLAIMED DEVICE HITACHI DF600F
/dev/rscsi/c11t3d0
ba 3 0/3 lba CLAIMED BUS_NEXUS Local PCI-X Bus Adapter (122e)
ba 4 0/4 lba CLAIMED BUS_NEXUS Local PCI-X Bus Adapter (122e)
ba 5 0/5 lba CLAIMED BUS_NEXUS Local PCI-X Bus Adapter (122e)
fc 1 0/5/1/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Ad
apter
/dev/td1
fcp 2 0/5/1/0.97 fcp CLAIMED INTERFACE FCP Domain
ext_bus 8 0/5/1/0.97.9.19.0 fcparray CLAIMED INTERFACE FCP Array Interface
target 9 0/5/1/0.97.9.19.0.0 tgt CLAIMED DEVICE
disk 18 0/5/1/0.97.9.19.0.0.0 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t0d0 /dev/dsk/ch8t0d0 /dev/rdsk/ch8t0d0
disk 19 0/5/1/0.97.9.19.0.0.1 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t0d1 /dev/dsk/ch8t0d1 /dev/rdsk/ch8t0d1
disk 20 0/5/1/0.97.9.19.0.0.2 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t0d2 /dev/dsk/ch8t0d2 /dev/rdsk/ch8t0d2
disk 21 0/5/1/0.97.9.19.0.0.3 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t0d3 /dev/dsk/ch8t0d3 /dev/rdsk/ch8t0d3
disk 22 0/5/1/0.97.9.19.0.0.4 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t0d4 /dev/dsk/ch8t0d4 /dev/rdsk/ch8t0d4
disk 23 0/5/1/0.97.9.19.0.0.5 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t0d5 /dev/dsk/ch8t0d5 /dev/rdsk/ch8t0d5
disk 24 0/5/1/0.97.9.19.0.0.6 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t0d6 /dev/dsk/ch8t0d6 /dev/rdsk/ch8t0d6
disk 25 0/5/1/0.97.9.19.0.0.7 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t0d7 /dev/dsk/ch8t0d7 /dev/rdsk/ch8t0d7
target 10 0/5/1/0.97.9.19.0.1 tgt CLAIMED DEVICE
disk 26 0/5/1/0.97.9.19.0.1.0 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t1d0 /dev/dsk/ch8t1d0 /dev/rdsk/ch8t1d0
disk 27 0/5/1/0.97.9.19.0.1.1 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t1d1 /dev/dsk/ch8t1d1 /dev/rdsk/ch8t1d1
disk 28 0/5/1/0.97.9.19.0.1.2 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t1d2 /dev/dsk/ch8t1d2 /dev/rdsk/ch8t1d2
disk 29 0/5/1/0.97.9.19.0.1.3 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t1d3 /dev/dsk/ch8t1d3 /dev/rdsk/ch8t1d3
disk 30 0/5/1/0.97.9.19.0.1.4 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t1d4 /dev/dsk/ch8t1d4 /dev/rdsk/ch8t1d4
disk 31 0/5/1/0.97.9.19.0.1.5 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t1d5 /dev/dsk/ch8t1d5 /dev/rdsk/ch8t1d5
disk 32 0/5/1/0.97.9.19.0.1.6 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t1d6 /dev/dsk/ch8t1d6 /dev/rdsk/ch8t1d6
disk 33 0/5/1/0.97.9.19.0.1.7 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t1d7 /dev/dsk/ch8t1d7 /dev/rdsk/ch8t1d7
target 11 0/5/1/0.97.9.19.0.2 tgt CLAIMED DEVICE
disk 34 0/5/1/0.97.9.19.0.2.0 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t2d0 /dev/dsk/ch8t2d0 /dev/rdsk/ch8t2d0
disk 35 0/5/1/0.97.9.19.0.2.1 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t2d1 /dev/dsk/ch8t2d1 /dev/rdsk/ch8t2d1
disk 58 0/5/1/0.97.9.19.0.2.2 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t2d2 /dev/dsk/ch8t2d2 /dev/rdsk/ch8t2d2
disk 59 0/5/1/0.97.9.19.0.2.3 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t2d3 /dev/dsk/ch8t2d3 /dev/rdsk/ch8t2d3
disk 60 0/5/1/0.97.9.19.0.2.4 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t2d4 /dev/dsk/ch8t2d4 /dev/rdsk/ch8t2d4
disk 61 0/5/1/0.97.9.19.0.2.5 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t2d5 /dev/dsk/ch8t2d5 /dev/rdsk/ch8t2d5
disk 66 0/5/1/0.97.9.19.0.2.6 zdlmfdrv CLAIMED DEVICE HITACHI DF600F
/dev/dlm/c8t2d6 /dev/dsk/ch8t2d6 /dev/rdsk/ch8t2d6
disk 67 0/5/1/0.97.9.19.0.2.7 zdlmfdrv NO_HW DEVICE HITACHI DF600F
/dev/dlm/c8t2d7 /dev/dsk/ch8t2d7 /dev/rdsk/ch8t2d7
target 12 0/5/1/0.97.9.19.0.3 tgt NO_HW DEVICE
disk 68 0/5/1/0.97.9.19.0.3.0 zdlmfdrv NO_HW DEVICE HITACHI DF600F
/dev/dlm/c8t3d0 /dev/dsk/ch8t3d0 /dev/rdsk/ch8t3d0
disk 69 0/5/1/0.97.9.19.0.3.1 zdlmfdrv NO_HW DEVICE HITACHI DF600F
/dev/dlm/c8t3d1 /dev/dsk/ch8t3d1 /dev/rdsk/ch8t3d1
ext_bus 9 0/5/1/0.97.9.255.1 fcpdev CLAIMED INTERFACE FCP Device Interface
target 8 0/5/1/0.97.9.255.1.3 tgt CLAIMED DEVICE
ctl 6 0/5/1/0.97.9.255.1.3.0 sctl CLAIMED DEVICE HITACHI DF600F
Torsten.
Acclaimed Contributor

Re: LVM and vgcreate ques...

ok, I see the special driver.

special drivers may have special tools too.

you should dig into this ...

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!