1829836 Members
2065 Online
109993 Solutions
New Discussion

Re: Lvol creation

 
M. Tariq Ayub
Regular Advisor

Lvol creation

Hi,

I have 4 PV c8t1d0,c8t1d1,c8t1d2,c8t1d3. I have created a vg01 with this 4 PV. I need to create 3 lvols such that c8t1d0 will be in lvol1, c8t1d1 and c8t1d2 will be in lvol2 and c8t1d3 will be on lvol3. I will not use any striping. What will be the command for creating this three lvol.
5 REPLIES 5
Shaikh Imran
Honored Contributor

Re: Lvol creation

Hi,
I don't know what are you going to achieve
by that...
Anyways
I dont think it's so simple with LVM but
i will advise you to create 4 vg's instead and allot the full vg to a single LV.

say you can create
vg01 = c8t1d1
vg02 = c8t1d2
vg03 = c8t1d3
vg04 = c8t1d4
then create single LV's on each above vg's.
This will also be simple and helpful for data
recovery and failure of disks..

Regards,



I'll sleep when i am dead.
Cheryl Griffin
Honored Contributor

Re: Lvol creation

lvcreate -n lvol1 /dev/vg01
lvcreate -n lvol2 /dev/vg01
lvcreate -n lvol3 /dev/vg01

Replace -l X with the number of extents to allocate to each lvol:
lvextend -l X /dev/vg01/lvol1 /dev/dsk/c8t1d0
lvextend -l X /dev/vg01/lvol2 /dev/dsk/c8t1d2
lvextend -l X /dev/vg01/lvol3 /dev/dsk/c8t1d3
"Downtime is a Crime."
Jose Mosquera
Honored Contributor

Re: Lvol creation

Hi,

I'll recomend you the following schema:
lvol1 --> vg01 --> c8t1d0
lvol2 --> vg02 --> c8t1d1, c8t1d2
lvol3 --> vg03 --> c8t1d3

#
pvcreate -f /dev/rdsk/c8t1d0
mkdir -p /dev/vg01
mknod /dev/vg01/group c 64 0x010000
vgcreate vg01 /dev/dsk/c8t1d0
lvcreate -L -n lvol1 vg01
newfs -F vxfs /dev/vg01/rlvol1
fsadm -F vxfs -o largefiles /dev/vg01/rlvol1
mkdir -p /
mount /dev/vg01/lvol1 /
#
pvcreate -f /dev/rdsk/c8t1d1
pvcreate -f /dev/rdsk/c8t1d2
mkdir -p /dev/vg02
mknod /dev/vg02/group c 64 0x020000
vgcreate vg02 /dev/dsk/c8t1d1 /dev/rdsk/c8t1d2
lvcreate -L -n lvol2 vg02
newfs -F vxfs /dev/vg02/rlvol2
fsadm -F vxfs -o largefiles /dev/vg02/rlvol2
mkdir -p /
mount /dev/vg02/lvol2 /
#
pvcreate -f /dev/rdsk/c8t1d3
mkdir -p /dev/vg03
mknod /dev/vg03/group c 64 0x030000
vgcreate vg02 /dev/dsk/c8t1d3
lvcreate -L -n lvol3 vg03
newfs -F vxfs /dev/vg03/rlvol3
fsadm -F vxfs -o largefiles /dev/vg03/rlvol3
mkdir -p /
mount /dev/vg03/lvol3 /


Rgds.
M. Tariq Ayub
Regular Advisor

Re: Lvol creation

Hi I want to give two disks to lvol2. so what should be the command

lvextend -l X /dev/vg01/lvol2 /dev/dsk/c8t1d1 /dev/dsk/c8t1d2
Cheryl Griffin
Honored Contributor

Re: Lvol creation

I apologize for the oversight in my original answer.

You have the correct syntax.

You can also specify -l (lower case L) to specify the extent size, or -L (upper case) to specify the size in Megabytes rather than extents.

See http://www.docs.hp.com/hpux/onlinedocs/B2355-90691/00/01/199-con.html for further explanation of -l and -L.
"Downtime is a Crime."