Operating System - HP-UX
1828376 Members
3228 Online
109976 Solutions
New Discussion

how to use lvcreate for the specific LUN

 
SOLVED
Go to solution
Michael Mac
Occasional Advisor

how to use lvcreate for the specific LUN

VG Name /dev/vg_ignite
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 4
Open LV 4
Max PV 100
Cur PV 8
Act PV 8
Max PE per PV 2232
VGDA 16
PE Size (Mbytes) 4
Total PE 17848
Alloc PE 17500
Free PE 348
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg_ignite/lv_ignite
LV Status available/syncd
LV Size (Mbytes) 4000
Current LE 1000
Allocated PE 1000
Used PV 3
...

--- Physical volumes ---
PV Name /dev/dsk/c8t12d0
PV Name /dev/dsk/c9t12d0 Alternate Link
PV Status available
Total PE 2231
Free PE 1392
Autoswitch On

-------------
pvcreate /dev/rdsk/c9t15d6 (9 GB)
pvcreate /dev/rdsk/c12t15d6 (9 GB Alternate Link)
vgextend vg_ignite /dev/dsk/c22t8d4 /dev/dsk/c23t8d4
lvcreate -n lv_or920 -L 9000 /dev/vg_ignite

After I created additional 9GB disk.
what command can I use to tell lvcreate for the new 9 GB (lv_or920) device.
OR other way to create.

Thanks,

Michael
6 REPLIES 6
Hoang Chi Cong_1
Honored Contributor

Re: how to use lvcreate for the specific LUN

Hi Michael

If you have Online-JFS, is is simple to do:
With vgextend vg_ignite /dev/dsk/c22t8d4 /dev/dsk/c23t8d4 command, the size of the vg_ignite will be enlarge with 9GB and you can create any logical volume in this VG as you want.
For your question, you need to create new LV and mount it, do you?
So that after create the lv_or920, you can format this LV:
#newfs -F vxfs /dev/vg_ignite/rlv_or920

Data will be stripe on both of link.

Hope this helps
Regard,
HoangChiCong

Looking for a special chance.......
A. Clay Stephenson
Acclaimed Contributor

Re: how to use lvcreate for the specific LUN

Lvcreate does not allow you to specify a PV but lvextend does. We can "outbushwhack" this by first using lvcreate to create the LVOL with a zero size (that is legal) and then use lvextend to increase the size and specify the PV.
If it ain't broke, I can fix that.
Devender Khatana
Honored Contributor

Re: how to use lvcreate for the specific LUN

Hi Michael,

As clay clarified. It will be lvcreate with null size and then lvextend with required size to required Disk ( Here LUN).

#lvcreate -n lv_ora920 /dev/vg_ignite

#lvextend -L 9000 /dev/vg_ignite/lv_ora920 /dev/dsk/c22t8d4

Confirm by
#lvdisplay -v /dev/vg_ignite/lv_0920

HTH,
Devender
Impossible itself mentions "I m possible"
Michael Mac
Occasional Advisor

Re: how to use lvcreate for the specific LUN

Hello again,

Please help/verify the following steps:

pvcreate /dev/rdsk/c9t15d6 (9 GB)
pvcreate /dev/rdsk/c12t15d6 (9 GB Alternate Link)
vgextend vg_ignite /dev/dsk/c9t15d6 /dev/dsk/c12t15d6
-- lvcreate with null size for lv_ora920 only right??
-- it doesn't zero the existing LV right??
lvcreate -n lv_ora920 /dev/vg_ignite
lvextend -L 9000 /dev/vg_ignite/lv_ora920 /dev/dsk/c9t15d6

Please let me know do I have to include the Alternate link /dev/rdsk/c12t15d6.

Thanks,

Michael
Patrick Wallek
Honored Contributor
Solution

Re: how to use lvcreate for the specific LUN

To create a NEW LV called lv_ora920 in the vg called vg_ignite on /dev/dsk/c9t15d6 (alt. link c12t15d6t):

# pvcreate /dev/rdsk/c9t15dt
(no need to pvcreate the alt. link since they are the same disk)

# vgextend vg_ignite /dev/dsk/c9t15d6 /dev/dsk/c12t15d6
(make c9t15dt with its alt. link part of vg_ignite)

# lvcreate -n lv_ora920 /dev/vg_ignite
(create a new 0 size LV called lv_ora920 in vg_ignite - No this doesn't do anything to the existing LV)

# lvextend -L 9000 /dev/vg_ignite/lv_ora920 /dev/dsk/c9t15d6
(extend the LV to 9GB on disk d9t15d6)

# newfs -F vxfs /dev/vg_ignite/rlv_ora920
(create the filesystem on the new LV)

# mount /dev/vg_ignite/lv_ora920 /somedir
(mount the LV to its dir.)

Don't forget to add it to /etc/fstab so it will mount automatically when the machine boots.
Michael Mac
Occasional Advisor

Re: how to use lvcreate for the specific LUN

Thank you all....