Re: Volume management on Linux with the ext2fs.

Miguel de Icaza (
Wed, 23 Apr 1997 13:27:48 -0500

Hello Ted,

> First of all, there are a number of places in the kernel which assume
> that if a filesystem is associated with a device, it's associated with
> exactly one device. Filesystems obviously don't have to be associated
> with a device --- for example, NFS and SMBfs aren't associated with
> devices --- however you have to write the filesystem code
> differently.

What would break in the kernel if we did such thing? The upper layers
of the kernel can continue to assume that our file system is just
using one device. And as far as the user does not use the device for
something else, we can just hide this fact from the kernel. I lack
your global picture of the kernel, so I may be saying some nonsense

> And the ext2 filesystem code, at a very fundamental level, assumes an
> ext2 filesystem is associated with a single device.

That is exactly what I would like to change. From a one-night reading
of the ext2 file system, it seems possible to implement the
extensions. We just need to get a routine that maps from a given
global block number to the device/local-to-the-device-block-number.

> The advantage of using RAID-0, then, is that you don't have to change
> any kernel code --- it's merely writing a user-space program to resize
> the filesystem. If we used your scheme, we would have to rewrite an
> awful lot of kernel code, and then make some pretty large modification
> to the user-space programs as well. So I think the RAID-0 technique is
> better.

That is right. Your scheme looks nicer, but then again, it does not
allow a system to continue operation and still let you add a new disk
to the system. This is something at least the IRIX XFS/XVM lets you
do. I would love to have this functionality in Linux.

My plan is to make the smallest, cleanest implementation of this
scheme, and keep the changes to the kernel to the minimum. User space
tools will require changes, that's right.

> The one problem with both of your scheme and this RAID-0 scheme is what
> do you do when you want to remove a physical disk from a filesystem?
> The simplest case is where you want to remove the last physical disk.
> Then, you will need the resize utility (which you will have already to
> accomplish the RAID-0 scheme), so you can resize the filesystem down.
> The resizing utility will have to migrate inodes and disk blocks out
> from the physical disk, so that you will be able to remove it from the
> logical volume.

I would like to follow what the IRIX guys did: you can unplug a device
from a volume by running some program that: 1. sanity checks if it is
possible to do this; 2. disables all of the ongoing i/o to that file
system while moving the information and 3. moves the information away
from the disk you want to remove and 4. re-enables disk I/O.

> This is where a redesigned scheme that tries to handle volume sets from
> the very beginnning has some advantages over a RAID-0 scheme.

I can do the changes for the ext2fs to handle my suggestion, then we
can look at them, try to reduce the number of changes and making them
as clean as possible before we even attempt integration with the main
ext2fs source code.