[Top] [All Lists]

Re: Xfs partition "move" ?

Subject: Re: Xfs partition "move" ?
From: "D. Stimits" <stimits@xxxxxxxxxx>
Date: Thu, 20 Dec 2001 12:40:42 -0700
Cc: linux-xfs@xxxxxxxxxxx
References: <200112201855.fBKIt4X16354@oss.sgi.com> <1008873166.30178.0.camel@stout.americas.sgi.com>
Reply-to: stimits@xxxxxxxxxx
Sender: owner-linux-xfs@xxxxxxxxxxx
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):
"0000", "123456789"
After if the whole tail is used:
"1234567890000", ""
After if the minimal tail is used:
"123456789", "0000"
After if half was used:
"12345678900", "00"

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
> --
> Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs
> sandeen@xxxxxxx   SGI, Inc.

<Prev in Thread] Current Thread [Next in Thread>