public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "J. Roeleveld" <joost@antarean.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] LVM: extending volume groups and logical volumes
Date: Fri, 16 Dec 2011 08:41:07 +0100	[thread overview]
Message-ID: <201112160841.07959.joost@antarean.org> (raw)
In-Reply-To: <yu9mxattg2f.fsf@nyu.edu>

On Friday 16 December 2011 03:18:16 Allan Gottlieb wrote:
> I need to add space to /var (thank you, libreoffice), which is on lvm.
> Since my one volume group vg is getting low, I thought this would be a
> good time to extend it as well.

Actually, you need space in /var/tmp/portage

> Alan (McKinnon) has posted very helpful lvm bits (reprinted below).
> Following alan's bottom up creation mandate I believe the idea is
> 
> phy disk:   /dev/sda  my only drive
> phy part:   fdisk   create another partition of type LVM (/dev/sda8)
> phy vol:    pvcreate /dev/sda8
> vol grp:    vgextend vg /dev/sda8
> log vol:    lvextend --size +10G /dev/vg/var
> file sys:   resize2fs /dev/vg/var
> files/dirs: not relevant
> 
> Questions
> 
> 1.  Apparently 2.6 (hence 3.x) kernels can expand mounted file systems
>     (/var is mounted as ext3).
> 
>     Since I can't unmount /var because it is in use, I guess that, if I
>     every need to shrink /var, I would need to boot off a CD.  Is that
>     correct?

For shrinking, you need to umount the partition first. Online-resizing only 
works when increasing the size.

>     Back in the day, we had single user mode for this, but I don't see
>     how to get the equivalent now.

"rc single" (See Dales email)

>     Is it really safe to extend /var (i.e., /dev/vg/var) while mounted
>     as ext3?  It sounds frightening since daemons could start running
>     and access /var.

Yes, I regularly extend filesystems while already copying data to them.

> 2.  Since currently /var is entirely from /dev/sda7 (my original lvm
>     partition) should I use the optional parameter to lvextend to
>     force the new space for /var to come from there as well?
>         lv extend --size +10G /dev/sda7

No, LVM can assign space from any disk. It will know where to go when 
accessing it.

If it's just temporary for LibreOffice, I'd suggest making a temporary LV, mount 
it at /var/tmp/portage and then emerging the software.
Then when finished, umount and remove the LV.

I see no need to have /var really large for normal use and have never tried 
shrinking filesystems myself.

> thanks in advance

Your welcome :)

HTH,

--
Joost



  parent reply	other threads:[~2011-12-16  7:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-16  2:18 [gentoo-user] LVM: extending volume groups and logical volumes Allan Gottlieb
2011-12-16  2:46 ` Dale
2011-12-16  3:05 ` [gentoo-user] " Jens Müller
2011-12-16  3:50   ` Jens Müller
2011-12-16  7:41 ` J. Roeleveld [this message]
2011-12-16  7:51   ` [gentoo-user] " Dale
2011-12-16 10:02   ` Neil Bothwick
2011-12-16 13:27     ` Pandu Poluan
2011-12-16  9:02 ` Philip Webb
2011-12-17  1:37 ` Allan Gottlieb
2011-12-17  1:56   ` Dale
2011-12-17  2:23     ` Allan Gottlieb
2011-12-17  3:35       ` Dale
2011-12-17  4:14         ` Allan Gottlieb
2011-12-17  4:59           ` Dale
2011-12-17  9:55             ` pk
2011-12-17 13:57               ` Allan Gottlieb
2011-12-17 15:18                 ` Dale
2011-12-17 16:47   ` Philip Webb
2011-12-17 17:07     ` Allan Gottlieb
2011-12-20 13:21   ` J. Roeleveld
2011-12-20 13:50     ` Allan Gottlieb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201112160841.07959.joost@antarean.org \
    --to=joost@antarean.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox