cloning a FreeBSD HDD

Kurt J. Lidl lidl at pix.net
Wed Mar 29 16:46:26 UTC 2006


On Wed, Mar 29, 2006 at 10:14:19AM -0300, Patrick Tracanelli wrote:
> Daniel O'Connor wrote:
> >On Wednesday 29 March 2006 14:34, M. Warner Losh wrote:
> >
> >>dump + restore is slow but reliabe.
> >
> >Faster than dd for disks that aren't full :)
> >
> >It also gives you a defrag as well as allowing you to change FS options.
> 
> Yes, pretty much faster for non-full disks, even compared to paralell 
> dd(1). And we always have the "-L" option to snapshot and dump(1) from 
> live file systems, what makes it an interesting and completly viable 
> choice to clone the disks in multiuser mode (no need to go single user).

In a prior life, I had to generate a bunch (50 or 60) disk images
from a master server image.  The server image was updated periodically,
so we decided to always go for doing it on the fly, rather than
just restoring a known-good dumpfile from some place. (Questionable
in hindsight, but...)

Anyhow, we were using SCSI disks, so I got a shelf full of scsi
disk canisters (since we had standardized on a particular one) and
then wrote a zsh script to do the dumping.  Zsh has a particular
ability to have it duplicate the contents of a single input
stream to multiple output streams.  So we would fire up one
dump on the master disk, and then pipe the output to multiple
copies of restore running (one per disk) simultaneously.  It was
way faster than doing them sequentially.

And, impressive to watch the access lights on the drives when you
were making seven disk drives copies at once...

-Kurt


More information about the freebsd-hackers mailing list