xfs
[Top] [All Lists]

Re: lvm and segmentation

To: monkeyiq <monkeyiq@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: lvm and segmentation
From: "Martin K. Petersen" <mkp@xxxxxxxxxxxxx>
Date: 22 Feb 2002 09:29:40 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <200202220745.g1M7jP631499@xxxxxxxxxxxxxxxxxxxxx>
Organization: Linuxcare, Inc.
References: <200202220745.g1M7jP631499@xxxxxxxxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)
>>>>> "monkeyiq" == monkeyiq  <monkeyiq@xxxxxxxxxxxxxxxxxxxxx> writes:

monkeyiq> It strikes me that a filesystem no longer knows about a
monkeyiq> contiguoius disk the lvm and so if I define a preallocated
monkeyiq> 15Gb file then there is no real say, even if xfs_bmap
monkeyiq> reports a single extent, that I can be sure that there is a
monkeyiq> contiguious 15Gb block ready for my data. Just wondering if
monkeyiq> I am correct in this thought?

In theory, yes.

LVM allocates space in big fixed-size blocks (called extents in LVM,
but they are not arbitrarily sized like ours).  By default these are
4MB each.  See the -s option to vgcreate.

So worst case your file will be chopped into discontiguous chunks of
4MB each (plus fluff for misalignment at the beginning and end).

On top of that you can tell lvcreate to try and allocate contiguous
space (-C) when you create a volume.

If you don't pvmove or grow the volume often, chances are your data
will be mostly contiguous.  You can check the physical mapping using
lvdisplay.

-- 
Martin K. Petersen, Principal Linux Consultant, Linuxcare, Inc.
mkp@xxxxxxxxxxxxx, http://www.linuxcare.com/
SGI XFS for Linux Developer, http://oss.sgi.com/projects/xfs/


<Prev in Thread] Current Thread [Next in Thread>