A difficult filesystem

Nick Cleaton nick at cleaton.net
Wed Jun 20 14:12:41 BST 2007

On Wed, Jun 20, 2007 at 01:30:05PM +0100, 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.

Hmm, you could copy the source to the dest link by link.

Every time you copy a file, create an extra hard link to it on the
dest fs, under a name derived from its inode number on the source fs.

Every time you go to copy a file, first check by inode number if you
already have a link to it on the dest, and if so make an extra link on
the dest instead of copying.

Blat the tree of extra hardlinks on the dest when done.


More information about the london.pm mailing list