Róbert Čerňanský writes:

> On Sun, 27 Nov 2011 00:01:07 +0100
> Alex Schuster <wo...@wonkology.org> wrote:
> 
> >   pvcreate /dev/sda5
> >   vgcreate myvg /dev/sda5
> >   lvcreate -n usr -L 10G myvg
> >   mke2fs -j /dev/myvg/usr
> > 
> > Of course, just using /dev/sda5 for /usr is simpler. But what if this
> > turns out to be too small? With so many partitions I would think this
> > is very likely to happen sooner or later. With LVM, all you'd have to
> > do is:
> > 
> >   lvresize -L +1G /dev/myvg/usr
> >   resize2fs /dev/myvg/usr
> 
> Here I do not understand from where this +1G is taken?  Don't you have
> to make something smaller by 1G first?

I assumed that /dev/sda5 is large enough and has free space that is not
being used for logical volumes. The lvcreate -L 10G step creates a
logical volume of 10 GB size, the rest of the volume group (that is using
the physical volume /dev/sda5) is being unused. You can create other
logical volumes with lvcreate, or extend existing ones, until all of that
space is being used. Then, you need to make something smaller of course
(which can be done), or you can extend your volume group by another
partition. Which may be on the same drive, or even on another one.

  pvcreate /dev/sda6
  vgextend myvg /dev/sda6
  lvresize...

        Wonko

Reply via email to