1837523 Members
3722 Online
110117 Solutions
New Discussion

Re: lvcreate doubt

 
SOLVED
Go to solution
Valkiria Santos
Frequent Advisor

lvcreate doubt

Hello all.

I??ve a simple doubt about lvcreate.
I??d like create a lvol in specific disk.
The correct command to do its follow:
#lvcreate -l vgxx /dev/dsk/cxtydz ?

Please, help me. I forget how to do this...

Tkts,
Valkiria
6 REPLIES 6
nancy rippey
Trusted Contributor

Re: lvcreate doubt

The way I use lvcreate is to first create the lv
lvcreate -n lv## /dev/vg## (create 0 sized LV)
lvextend -l <# 4MB extents> /dev/vg##/lv## /dev/dsk/cXtXd0 - Make lv's size you want

Don't forget to make the mountpoint and newfs
mkdir /mntpoint

mkdir /mntpoint

newfs -F vxfs -b /dev/vg##/lvol_

nrip

Re: lvcreate doubt

Not quite. lvcreate doesn't let you specify a physical disk. If you want all the PEs to go on a particular disk first create the LV:

lvcreate -n lvolname vgname

This creates a LV of 0 size in the volume group.
Then use lvextend to size the LV and assign the LV to a particular disk:

lvextend -L size /dev/vgname/lvname /dev/dsk/cXtYdZ

e.g. to create a 200MB logical volume called lvol4 in volumge group vg01 and on disk c1t2d0 do the following:

lvcreate -n lvol4 /dev/vg01
lvextend -L 200 /dev/vg01/lvol4 /dev/dsk/c1t2d0

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Thierry Poels_1
Honored Contributor
Solution

Re: lvcreate doubt

Hi,

it's a two step process:
first define the LVOL (size will be 0) and then extend the LVOL on the specific disk.

lvcreate -n lvoln /dev/vgxx
lvextend -L nnn /dev/vgxx/lvoln /dev/dsk/cxtydz

afterwards you can create the filesystem and edit /etc/fstab if required.

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Roger Baptiste
Honored Contributor

Re: lvcreate doubt

Hi,

<>

Before you create an lvol, make sure
1) About the Size of Lvol which you want to
create.
2) The Name of the Lvol which you want to create
3) The VG on which you want to Create it.
(optional: and the disk on which you want it.)

4) Optional:The allocation policy (distributed, striping...). This is not necessary for
simple creation.

>>#lvcreate -l vgxx /dev/dsk/cxtydz ?

To make it easy, assign size in Mbytes
by giving -L option
You cannot specify the disk name in
an lvcreate command. It would need to
go into lvextend command:
so, the right command would be:

lvcreate -n /dev/vgname
(this creates a LV of Zero size)
lvextend -L /dev/vgname /dev/dsk/cxtydz
(this extends the LV to the specified size)

But, before you do this, make sure the
Disk belongs to that volume group, by
giving the VGDISPLAY command
vgdisplay -v /dev/vgname will show what
disks belong to the VG.

Also, once you create the LV, if this
is going to be filesystem, you would need
to give the newfs command to make it a
filesystem.

HTH
raj
Take it easy.
Valkiria Santos
Frequent Advisor

Re: lvcreate doubt

Thanks for all to solve my doubt... long time without use technical part, only admnistrating cause blackout like this.
:-)
Sanjay_6
Honored Contributor

Re: lvcreate doubt

Hi Valkiria,

you can do it like this,

lvcreate -n lv_name /dev/vg_name
lvextend -L lv_size /dev/vg_name/lv_name /dev/dsk/pv_name
newfs -F vxfs -o largefiles /dev/vg_name/rlv_name

you can also refer to the hp manual "Managing systems and workgroups"

Here is a thread to that manual, Look for the section Managing Disks -> Tasks That You Can Perform Only with HP-UX Commands --> Extending a Logical Volume to a Specific Disk.

Hope this helps.

thanks