[rhelv6-beta-list] My first experiences with RHEL6 beta

Chris Adams cmadams at hiwaay.net
Tue Jun 15 19:39:12 UTC 2010


Once upon a time, Bryan J. Smith <b.j.smith at ieee.org> said:
> On Tue, 6/15/10, Chris Adams <cmadams at hiwaay.net> wrote:
> > IMHO the biggest drawback with LVM and filesystem changes
> > right now on Linux is that you cannot shrink a mounted
> > filesystem (at least not ext*), only expand.
> 
> This is a limitation of e2fsprogs, not LVM.  I do not believe it has
> anything to do with LVM.  Feel free to correct me if I am wrong, but
> I believe this is very much the case.

If you want to get technical, it is a limitation of the Linux kernel
ext* filesystems, not the user-space e2fsprogs.

However, my point is that moving PEs around is fun (but not terribly
useful in lots of cases), and changing which LVs they are assigned to is
great and all, but it is of reduced usefulness if the things on top of
those PEs can't handle the LVs changing sizes on the fly.

It doesn't matter if LVM/DM can slice and dice disks (and make Julienne
fries!) if the things that run on top of the LVs can't take advantage of
all the functionality.  It isn't a shortcoming of LVM/DM directly, but
it is a shortcoming of the system.

Let's say I have /var and /usr/local, with a swap file on /var.  Now I
have /var running out of space but lots of free space in /usr/local; I
can make a new swap file in /usr/local, add it, remove the swap file
from /var, and free up space in /var.  Essentially, I have moved free
space from /usr/local to /var.

If instead I have /var, /usr/local, and swap, each as separate LVs, and
I have /var running out of space but lots of free space in /usr/local, I
have to shut down, shrink /usr/local (which can be a time-consuming
operation), and shrink the LV (hope you do the math right!).  I can then
boot up, add the PEs to the /var LV and resize /var.

Do you see how swap files can give you additional flexibility that you
do not get with stand-alone swap partitions or LVs?  You can even put
multiple swap files in different filesystems with different priorities
(obviously, never put multiple swap files OR partitions/LVs on the same
disk at the same priority level though).

Swap is a tough case; you often don't know how much to allocate in
advance (especially on Linux where swap usage patterns change from time
to time), you don't want to tie up too much of your disk with swap space
that will never be used, but when you need it, you want to have all you
need available and then some.

Again, I don't use swap files (although I have considered it), and I do
make good use of LVM/DM.  I just don't claim that LVM/DM solves all
problems and swap LVs always beats swap files.
-- 
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.




More information about the rhelv6-beta-list mailing list