Re: Logical Volume Manager

Miguel de Icaza (
30 Sep 1997 12:26:24 -0500

Heinz said:

> Because logical volumes (LVs) can be resized at runtime i need a filesystem
> (FS) feature which enables ext2 to be extended/reduced while its mounted too.
> This could be an extension to tunefs or a separate FS administration tool.

I have written a patch for Linux 2.1.39 that modifies the ext2 file
system to allow it to span multiple devices. At system operation time
you can add devices to an ext2 file system (and remove devices from a
file system, but I have not finished that bit :-) and the file system
will resize accordingly. This does not really resize the file system,
instead, the file system code has been taught how to deal with a file
system that spans multiple disks.

If you are interested in looking at the patches and the tools that
implement this, check:

One of the problems of the code I have is that I have not written
support for fsck nor ext2lib for dealing with these modified file
systems. This needs to be done, but I am not sure if I should spend
more time on this pursuing this goal.

This may not be quite what you have in mind, as I think the purpose of
your logical volume is that you will hide the details of where the
disk blocks are actually located on the disk to the upper layers, am I
correct? I have the impression that this logical volume that you
implemented is a glamorous version of the MD linear personality?

> It should work like this:
> -------------------------
> AFTER extending a LV the contained filesystem should be linear
> extentable (superblocks etc.) beyond the old FS limit.
> BEFORE reduction of the LV the FS should be shrinkable (moving user data
> and reducing metadata) from its actual end to the new LV size.

This sure can be done by ext2 if you do not need to do these tasks at
runtime. If you want to grow and shrink an ext2 file system at
runtime, that can prove to be far from a trivial hack.

In that regard, probably the easier to implement and less disturbing
approach would be to use an approach similar to my patch. But in that
case, I am not sure it makes much sense to use the logical volume

If people like the idea (specially, the ext2 maintainers), I could add
the missing bits to the multi-device ext2 patchs (like having the code
be an optional compilation feature and the shrink-fs option, which is
pretty easy to do).

Best wishes,