A difficult filesystem
Peter Hickman
peter.hickman at semantico.com
Wed Jun 20 14:12:11 BST 2007
Andy Armstrong wrote:
> I have an rsync based backup regime that results in a filesystem
> containing lots of inodes many of which have as many as fifty hard
> links pointing to them. I'm not sure how many files there are in total
> - the little script I have analysing it has been running all night and
> is up to 26,000,000 plus. debugfs tells me there are a shade over
> 6,000,000 inodes.
>
> I want to migrate the whole (ext3) filesystem onto another, larger
> device.
>
> Any of the normal hard-link-preserving copying methods run out of
> memory pretty early - for obvious reasons.
>
> So I copied the whole filesystem (dd if=x of=y) onto the new device
> with a view to growing it in place. Unfortunately parted deosn't like
> it either - "You found a bug in GNU Parted".
>
> While I work up a bug report for parted I've got a little Perl prog
> crawling the whole filesystem and building a SQLite DB with two tables
> - one for dir entries and one for inodes. When the finishes (sometime
> next week at the current rate of progress) I'll have a 30G or so
> database with more than 100 million rows.
>
> Then I should be in a position to copy the FS preserving hard links.
> Phew.
>
> While I'm waiting does anyone have tips for other tools that might be
> useful?
>
Is mtree available for your system? This can recreate directory
structures and reset permissions and ownerships - it's a *BSD thing but
should be available.
--
Peter Hickman.
Semantico, Lees House, 21-23 Dyke Road, Brighton BN1 3FE
t: 01273 358223
f: 01273 723232
e: peter.hickman at semantico.com
w: www.semantico.com
More information about the london.pm
mailing list