Operating System - HP-UX
1834759 Members
3281 Online
110070 Solutions
New Discussion

How to create a Logical Volume in particular portion of speficied Physical disk

 
SOLVED
Go to solution
John Jayaseelan
Super Advisor

How to create a Logical Volume in particular portion of speficied Physical disk

Hi,

Is it possible to create a logical volume in particular portion of speficied Physical disk, For example Creating a logical volume of size 100MB at end of 17GB hard disk c0t1d0.

Thanks
John Jayaseelan
8 REPLIES 8
Pete Randall
Outstanding Contributor
Solution

Re: How to create a Logical Volume in particular portion of speficied Physical disk

John,

I believe it's first come, first served, so, if you allocate the first 16.9GB to a temporary LV, you should then be able to create your desired LV where you want it.

Pete

Pete
Chris Wilshaw
Honored Contributor

Re: How to create a Logical Volume in particular portion of speficied Physical disk

Using the normal LVM commands, this is not possible - it will allocate the space from the start of the disk.

I suppose that to get round this, you could create a large partition on the disk, leaving 100MB free, then create your 100MB partition, and remove the large partition.
Bill McNAMARA_1
Honored Contributor

Re: How to create a Logical Volume in particular portion of speficied Physical disk

pete is correct.. create a temporary lv of 16G first to buffer the space, then create your 100Mb lv. remove the temporary lv..

Later,
Bill

It works for me (tm)
John Palmer
Honored Contributor

Re: How to create a Logical Volume in particular portion of speficied Physical disk

Not directly but you could do something like:-

lvcreate -n templv vg??
lvextend -L 16900 /dev/vg??/templv /dev/dsk/c0t1d0

lvcreate -n yourlv vg??
lvextend -L 100 /dev/vg??/yourlv /dev/dsk/c0t1d0

lvremove -f /dev/vg??/templv

i.e. create a temp volume that occupies all the rest of the disk, create your volume tnen remove the temporary one.

Regards,
John
Sridhar Bhaskarla
Honored Contributor

Re: How to create a Logical Volume in particular portion of speficied Physical disk

Hi John,

It is possible. But there is no direct command to specify what physical extents are to be used.

Determine the number of extents needed for 100 MB (ex., 25 if you have the extent size of 4 MB), find the total number of extents (say X) on the disk (pvdisplay -v) and create a logical volume of ( [x-25]*extent size ) and then create another logical volume of 100MB. Then delete the first logical volume.

If you already have logical volumes on the disk, then case is slightly difficult. Again you can use the same logic above to get what you need. Fill up all the extents until the last 25 extents (if the extent size if 4MB) by creating dummy logical volume(s), create your 100MB logical volume and then delete the dummies.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
MANOJ SRIVASTAVA
Honored Contributor

Re: How to create a Logical Volume in particular portion of speficied Physical disk

Hi John


In LVM you cannot specify where to create the partition like you want in the inner side of the disk presumingly for better I/O , in VXFS you can define where the partition will start from .


Manoj Srivastava
James R. Ferguson
Acclaimed Contributor

Re: How to create a Logical Volume in particular portion of speficied Physical disk

Hi:

On one hand, concern for the I/O time based on the physical placement on a disk of a filesystem takes me back in time farther than I want to go. [Interestingly, AIX does offer selection of physical disk areas (outer, center, etc.]. I am *not* disputing that you might improve performance, but I question whether the improvement might really be perceptable to an end-user in a large population. I suspect that better performance can be gained by more optimal coding practices in many cases, particularly in SAN environments with a good cache.

If you are dealing with a database engine, like Oracle, you might find this study on "SAME" (Stripe And Mirror Everything) of interest:

http://technet.oracle.com/deploy/availability/pdf/oow2000_same.pdf

Regards!

...JRF...
harry d brown jr
Honored Contributor

Re: How to create a Logical Volume in particular portion of speficied Physical disk

I agree with JRF. To me the idea of "micro"-managing storage was something we did in the 70's through the 90's.

If you need that kind of speed for 100MB I suggest you go buy some RAM DISK or simply more MEMORY for your server.

live free or die
harry
Live Free or Die