xfs
[Top] [All Lists]

Re: XFS shrink (step 0)

To: David Chinner <dgc@xxxxxxx>
Subject: Re: XFS shrink (step 0)
From: Ruben Porras <ruben.porras@xxxxxxxxxxx>
Date: Mon, 30 Jul 2007 19:30:25 +0200
Cc: xfs@xxxxxxxxxxx, iusty@xxxxxxxxx
In-reply-to: <20070629065525.GQ31489@sgi.com>
References: <1180715974.10796.46.camel@localhost> <20070604001632.GA86004887@sgi.com> <1182291751.5289.9.camel@localhost> <20070619234248.GT86004887@sgi.com> <46838FB4.1040906@linworks.de> <20070629065525.GQ31489@sgi.com>
Sender: xfs-bounce@xxxxxxxxxxx
Am Freitag, den 29.06.2007, 16:55 +1000 schrieb David Chinner:
> On Thu, Jun 28, 2007 at 12:38:44PM +0200, Ruben Porras wrote:

> For something like this it's probably easier to do with shell/perl/awk.
> 
> e.g. in shell, the number of ags in the filesystem:
> 
> iterate all ags:
> 
> numags=`xfs_db -r -c "sb 0" -c "p agcount" /dev/sdb8 | sed -e 's/.* = //'`
> lastag=`expr $numags - 1`
> for ags in `seq 0 1 $lastag`; do
>       ....
> done
> 
> Free space in an AG 0:
> 
> xfs_db -r -c "freesp -s -a 0" /dev/sdb8 | awk '/total free blocks/ {print $4}'

I decided to calcule the free space in a AG directly as the space in
"freeblks" - "btreeblks".

Attached is a perl script that calculates the free space of a hole
filesystem. It's easy to modify it to get the free space from a range of
AGs, so unless there are errors, I lay it on the mailing list as an
example, and I'll adapt it later as needed. I would like to start with
the step number 2.

How is the state of the program xfs_reno.c? Can it be released in the
near future as GPL, or should I go better for now with point number 3
(that is, move data out of offline AGs)?

Attachment: freecount.pl
Description: Perl program

<Prev in Thread] Current Thread [Next in Thread>
  • Re: XFS shrink (step 0), Ruben Porras <=