LVM questions

Dick Davies rasputnik at gmail.com
Sat Apr 22 22:53:01 UTC 2006


On 22/04/06, Tony Arnold <tony.arnold at manchester.ac.uk> wrote:

> The root file system is ext3. I could use resize2fs to shrink it, but it
> won't if it's mounted, and I cannot umount the root file system on a
> running system.

 I don't know of any filesystem that supports online shrinking,
so I generally start off as small as I can get away with and grow if need be
(mostly I use reiserfs, which lets you grow without unmounting).

> So I've done what I needed to do, but I feel there should be a cleaner
> way. Maybe a live CD boot would have helped.

I'd have gone for that, yeah. My general plan is

  sudo umount /dev/ubuntu/root
  sudo resize_reiserfs -s -1G /dev/ubuntu/root
  sudo lvreduce -L -1G /dev/ubuntu/root
  sudo mount /dev/ubuntu/root

(resize_reiserfs and lvreduce seem to support the same size notation,
which makes this a lot easier).

Growing is similar (just expand the LV before the filesystem,
change the '-' to a '+' and don't bother to umount/mount :)

There's a (fairly old) entry on my blog about LVM at:

  http://number9.hellooperator.net/articles/2005/10/10/loveit-very-much

--
Rasputin :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/




More information about the ubuntu-users mailing list