Eric Sandeen wrote:
> On Thu, 2001-12-20 at 11:56, Stefano Peluchetti wrote:
> > I need to "move" phisically the xfs root partition to the first block of my
> > hd to ba able to enlarge it and cover all the available space.
> > As now the partition starts after 4GB i can' t engrow it to the full size of
> > my hd (43GB) .
> > How could i do?
> > Do i need a second HD?
> Yes. (Or tape, or...)
> growfs only grows on the end of a filesystem, you can't grow the
> beginning backwards...
It would probably be ridiculously painful to do, but maybe not, so I'll
suggest a possible change that might make this possible. Suppose that a
clean/new XFS partition were added just before the current partition,
one that in this case started at the first block, and ended just before
the current partition. A twisted version of growfs could be designed to
merge the 2nd (tail end) partition into the first. Perhaps it would be
(with some difficulty) possible to also make a version that consumes the
earliest inodes first, and adds in the beginning of the old tail
partition exactly as it consumes the inodes, and only if there is not
enough space already available from the new head partition without
consuming the old. The idea being to squeeze as much as possible into
the newer head partition before consuming the older tail partition,
making it possible to stop "consumption" before the old tail partition
is actually complete. This in turn making it possible to arbitrarily cut
off how much of the tail *must* be consumed and used in the new
partition...at the end of the process, the user could be asked how much
of the blank space should be left alone (default to use it all), and how
much should be chopped off (at the very end). The chopped off part would
become its own empty XFS partition.
If "0" stands for an empty node, and other numbers for used nodes, the
idea would be something like this just before running the XFS merge
(quoted segments are partitions, sample shows a filled tail partition):
After if the whole tail is used:
After if the minimal tail is used:
After if half was used:
It would be something like a destructive memmove with strict pre/post
conditions. I have no idea if this would be practical, but I would
wonder if the logging mechanism could be utilized to make this
practical. I suspect that being able to do that would give XFS a unique
advantage over most any other filesystem.
Ok, so I'm bored again.
D. Stimits, stimits@xxxxxxxxxx
> Eric Sandeen XFS for Linux http://oss.sgi.com/projects/xfs
> sandeen@xxxxxxx SGI, Inc.