question about resizing partitions under lvm

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Mon Jun 29 14:55:57 UTC 2009


On Fri, Jun 26, 2009 at 05:33:16PM -0400, Richard Dice wrote:
> I'm interested in taking 100gb from my /var partition and giving it to my
> /home partition.  Both partitions are using the ext3 file system and it's
> all being co-ordinated by lvm.  Here's my partition setups:
> 
> monad:~# df
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/mapper/vg00-root
>                       19682584   1130420  17552332   7% /
> tmpfs                  4056128         0   4056128   0% /lib/init/rw
> udev                     10240       128     10112   2% /dev
> tmpfs                  4056128         0   4056128   0% /dev/shm
> /dev/md0                482090     58405    398793  13% /boot
> /dev/mapper/vg00-home
>                      196861252 186862044         0 100% /home
> /dev/mapper/vg00-tmp  49214272    184428  46529852   1% /tmp
> /dev/mapper/vg00-usr  49214272   3638008  43076272   8% /usr
> /dev/mapper/vg00-usrlocal
>                      153796644   4885652 141098488   4% /usr/local
> /dev/mapper/vg00-var 196861252    621272 186240008   1% /var
> 
> (There's a mirroring RAID-1 underneath all that too, but I don't think this
> is an issue I need to concern myself with.)
> 
> Since I've not done this before, I wanted to get a basic sanity check out
> there from people who are hopefully more familiar with this kind of thing.
> My plan is (in pseudocode):
> 
> umount /var
> resize2fs /dev/mapper/vg00-var -100G
> lvreduce /dev/mapper/vg00-var -100G

I always feel much safer shrinking the filesystem by more than the lv
first, then expanding to fill all space after the fact.  I just don't
trust the rounding they might do.

So I would do a shrink by 105GB, then lvreduce, then resize2fs without
a size to fill space again.

> umount /home
> lvextend /dev/mapper/vg00-home +100G
> resize2f /dev/mapper/vg00-home +100G

No, just resize to the default, which is all space.

> mount /home
> mount /var
> 
> Does this make sense?  Do I need to worry about whether the /home and /var
> partitions are adjacent, given that I'm doing this all under lvm?

This appears to be a nice up to date guide:

http://www.tcpdump.com/kb/os/linux/lvm-resizing-guide/intro.html

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list