Re: [vserver] unify file system

About this list Date view Thread view Subject view Author view Attachment view

From: Sam Vilain (
Date: Wed Aug 14 2002 - 06:49:19 EDT

Paul Sladen <> wrote:

> > On can not just unify all files found to be the same?
> It's not the unifying that's the problem, it's the finding which files are
> the same that is the hard part.

Not too hard, and there are lots of tricks you can use to avoid having
to stat every file and directory on the filesystem.

For instance, you can restrict the search so that only files in the
same place are compared for unification, eg /vservers/*/bin/ls. You
can make sure that you're checking the inode number for each directory
entry as you readdir() to avoid stat()'ing every inode every time.
You can compare other file stat information before actually comparing
the files. And you can use the tricks that `find' use to avoid having
to stat() every file in a directory to see if there are any
sub-directories off this one.

I've implemented an algorithm which is fairly efficient; though the
code probably still leaks :-)

You will also need a couple of the modules (ReadDir, Pod::Constants)
at to use it.

Takes less than 5 minutes to scan and unify about 30 systems' /usr
directories on my test system.

> Disk space was the issue there. Disk space is cheap now.

This is a myth. The same rule applies that has always applied: Cheap,
Fast, Reliable: pick any two.

   Sam Vilain,     WWW:
    7D74 2A09 B2D3 C30F F78E      GPG:
    278A A425 30A9 05B5 2F13

A politician's most important ability is to foretell what will happen tomorrow and next month and next year - and to explain afterwards why it didn't happen. - anon.

About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.4 : Mon Aug 19 2002 - 12:01:02 EDT