Operating System - HP-UX
1835238 Members
2185 Online
110078 Solutions
New Discussion

Choose disk with lvcreate

 
SOLVED
Go to solution
Greg Stark_1
Frequent Advisor

Choose disk with lvcreate

When you create a new lv, is there a way to specify which disk in the vg you want the extents to come from.

Here is my problem: I have an 11.00, D270 with 2 9Gig drives. Both drives are part of VG00. I installed the OS on 1 drive and then mirrored it to the other. This used about 3G on each of the drives and left about 6 unallocated on each. I now need to create about 8G (4x2G) more of un-mirrored fs's. My problem is that as I start creating these, it uses all the remainder of 1 disk and then spills to the next. Because of this, I can never extend any of the mirrored OS fs's and properly mirror them. I would like to put
2 of the new fs's on each disk so there would be 2G free on each disk.

Does this long-winded babble make sense? I know the easy answer would be to get mgmt to spring for some larger drives or a disk system.

Thanks again,
Greg
4 REPLIES 4
Darrell Allen
Honored Contributor
Solution

Re: Choose disk with lvcreate

Hi Greg,

The way to get the LV on the disk(s) you want is to lvcreate the LV without specifying a size then lvextend the LV specifying the size and the disks you want to use. man lvextend.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
James R. Ferguson
Acclaimed Contributor

Re: Choose disk with lvcreate

HI Greg:

You need to establish an '/etc/lvmtab' file. It's designed expressly to address the situation you describe.

Have a look at the man pages for 'lvmpvg (4)'.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Choose disk with lvcreate

Hi Greg:

The answer is no, not directly BUT you can out bushwhack it. If you man lvcreate, you will notice that no pv_path argument can be specified but if you man lvextend, you will note that you can specify a pv_path.

1) Create a new lvol with lvcreate but specify a size of zero.

2) lvextend to your desired size and specify the pv_path.

3) Build your filesystem using newfs.

Man lvcreate, lvextend for details.

If it ain't broke, I can fix that.
Sandip Ghosh
Honored Contributor

Re: Choose disk with lvcreate

Hi Greg,

You can do like this

#lvcreate -n /dev/vg00
#lvextend -L /dev/vg00/

Hope this will solve your problem and this way you can take the PE from the disk you want.

Sandip
Good Luck!!!