Re: [gentoo-user] lvm2 questions

2009-06-05 Thread Philip Webb
090604 Maxim Wexler wrote:
 why give the logical volumes any size at all ?
 If they can be expanded at will,
 why not just the let the files fill them up as much as they need ?

That's not how it works: you need to create the LVs with enough space
for your likely needs  LVM then assigns them in its own way to the PVs;
later, if you made an LV too small, you can increase it
(you also have to extend the file system after you've done that,
but of couse don't simply reformat the whole LV);
if you want to decrease an LV -- rather unlikely in real life -- ,
the problem is that you may risk losing data, if that part is dropped:
I would imagine the correct procedure is to copy everything somewhere
-- another LV, another partition, a USB stick -- ,
then delete the LV  recreate it with the smaller size.

When I set up LVM in my newly-built machine in Nov 2007 ,
I tried to estimate what each LV would need based on experience.
Recently, I added a whole new LV  extended another,
but otherwise LVM has worked flawlessly (even SystemRescue recognises it).

-- 
,,
SUPPORT ___//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT`-O--O---'   purslowatchassdotutorontodotca




Re: [gentoo-user] lvm2 questions

2009-06-05 Thread Neil Bothwick
On Fri, 5 Jun 2009 02:16:20 -0400, Philip Webb wrote:

 That's not how it works: you need to create the LVs with enough space
 for your likely needs  LVM then assigns them in its own way to the PVs;
 later, if you made an LV too small, you can increase it
 (you also have to extend the file system after you've done that,
 but of couse don't simply reformat the whole LV);
 if you want to decrease an LV -- rather unlikely in real life -- ,
 the problem is that you may risk losing data, if that part is dropped:
 I would imagine the correct procedure is to copy everything somewhere
 -- another LV, another partition, a USB stick -- ,
 then delete the LV  recreate it with the smaller size.

You shrink an LV in much the same way that you increase its size, except
in the opposite order - resize the filesystem and then the LV. It's not
difficult but it does take longer, because the filesystem resize
generally results in data being moved around. The main difficulty is that
you cannot shrink a mounted filesystem, so if you can't unmount it you
have to use a live CD to do the job.


-- 
Neil Bothwick

2 + 2 = 5 for extremely large values of 2.


signature.asc
Description: PGP signature


[gentoo-user] lvm2 questions

2009-06-04 Thread Maxim Wexler
Hi group,

Creating LVM partitions on SSD and SD card using systemrescuecd-1.2.0
while following doc, 'Gentoo LVM2 installation'.  In the doc it says
to edit the 'filter =' statement in lvm.conf in order to scan the
correct devices. But just below it says to use #pvcreate with the
appropriate devices. But if you use pvcreate to specify the device
you're planning to partition what's the point in editing lvm.conf?
Edited it anyways.

Now have:
...
filter= [ r|/dev/ndb.*|, a|/dev/sd[ab]| ] # only changed 'accept' line
...

/root % vgscan
Reading all physical volumes. This may take a while...

Well, no, it was more or less instant. There was no further output and
the prompt reappeared. Does this mean everything is cool or that
vgscan found nothing?

Maxim



Re: [gentoo-user] lvm2 questions

2009-06-04 Thread Albert Hopkins
On Thu, 2009-06-04 at 13:01 -0600, Maxim Wexler wrote:
 Hi group,
 
 Creating LVM partitions on SSD and SD card using systemrescuecd-1.2.0
 while following doc, 'Gentoo LVM2 installation'.  In the doc it says
 to edit the 'filter =' statement in lvm.conf in order to scan the
 correct devices. But just below it says to use #pvcreate with the
 appropriate devices. But if you use pvcreate to specify the device
 you're planning to partition what's the point in editing lvm.conf?
 Edited it anyways.
 
 Now have:
 ...
 filter= [ r|/dev/ndb.*|, a|/dev/sd[ab]| ] # only changed 'accept' line
 ...
 
 /root % vgscan
 Reading all physical volumes. This may take a while...
 
 Well, no, it was more or less instant. There was no further output and
 the prompt reappeared. Does this mean everything is cool or that
 vgscan found nothing?
 

You still need pvcreate to create PVs.  What the filter parameter is for
is for when LVM scans for PVs.  Basically pvcreate puts a header on the
device so that vgscan and friends knows that it's a PV.  It may be
undesirable to scan some devices (e.g. optical drives) for PVs.

Having said that, usually the defaults for filter and exclude are fine
and you don't need to play with them (as is the case for many defaults).

You'll know if LVM has detected your PVs by running pvdisplay.  If your
PV doesn't show up either a: you didn't pvcreate it or b: it didn't get
scanned due to your filter or exclude params.

-a




Re: [gentoo-user] lvm2 questions

2009-06-04 Thread Maxim Wexler
On 6/4/09, Albert Hopkins mar...@letterboxes.org wrote:

 You'll know if LVM has detected your PVs by running pvdisplay.

Check! Thanks Albert

Another please, from the doc:

Note:  As Terje Kvernes commented, it is easier to increase the size
of a partition then to shrink it. You might therefore want to start
with smaller partitions and increase their size as needed.
  Code Listing 2.5: Creating and extending logical volumes

Then why give the logical volumes any size at all? If they can be
expanded at will, why not just the let the files fill them up as much
as they need? This point has me stymied.

Maxim