public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] lvm2 questions
@ 2009-06-04 19:01 Maxim Wexler
  2009-06-04 23:00 ` Albert Hopkins
  0 siblings, 1 reply; 5+ messages in thread
From: Maxim Wexler @ 2009-06-04 19:01 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] lvm2 questions
  2009-06-04 19:01 [gentoo-user] lvm2 questions Maxim Wexler
@ 2009-06-04 23:00 ` Albert Hopkins
  2009-06-05  4:32   ` Maxim Wexler
  0 siblings, 1 reply; 5+ messages in thread
From: Albert Hopkins @ 2009-06-04 23:00 UTC (permalink / raw
  To: gentoo-user

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] lvm2 questions
  2009-06-04 23:00 ` Albert Hopkins
@ 2009-06-05  4:32   ` Maxim Wexler
  2009-06-05  6:16     ` Philip Webb
  0 siblings, 1 reply; 5+ messages in thread
From: Maxim Wexler @ 2009-06-05  4:32 UTC (permalink / raw
  To: gentoo-user

On 6/4/09, Albert Hopkins <marduk@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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] lvm2 questions
  2009-06-05  4:32   ` Maxim Wexler
@ 2009-06-05  6:16     ` Philip Webb
  2009-06-05  8:34       ` Neil Bothwick
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Webb @ 2009-06-05  6:16 UTC (permalink / raw
  To: gentoo-user

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] lvm2 questions
  2009-06-05  6:16     ` Philip Webb
@ 2009-06-05  8:34       ` Neil Bothwick
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Bothwick @ 2009-06-05  8:34 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-05  8:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-04 19:01 [gentoo-user] lvm2 questions Maxim Wexler
2009-06-04 23:00 ` Albert Hopkins
2009-06-05  4:32   ` Maxim Wexler
2009-06-05  6:16     ` Philip Webb
2009-06-05  8:34       ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox