What is the best way to image copy a FreeBSD system?

Alexander Best arundel at freebsd.org
Tue Feb 15 15:20:43 UTC 2011

On Tue Feb 15 11, Jerry McAllister wrote:
> On Tue, Feb 15, 2011 at 01:53:44AM -0500, Xn Nooby wrote:
> > On Linux I use clonezilla, which understands the EXT3 filesystem, and
> > it can skip unused space (I'm using about 3GB out of 1TB).
> > 
> > On FreeBSD, I have to fill the 1TB drive with zero-filled files, then
> > delete them, on each partiton, since CloneZilla uses DD+gzip on the
> > entire drive.
> > 
> > I like to make image copies of new systems, so I can revert back to my
> > starting point in case I break it, but CloneZilla is taking 9 hours to
> > image the drive.  I can re-install a lot faster than that.
> My suggestion would be to do the slicing/partitioning on the copy
> and then use dump/restore on each partition from the new drive to 
> the copy drive.   
> A dd image is not really all that good a way to do it.   
> It just produces a sector by sector copy which is not efficient.
> The dump/restore produces what you want which is an efficient runable system
> on the copy disk.   
> Once you get the dump/restore finished, you could use rsync periodically
> to keep it up to date.   Actually you could use rsync to do all the
> copying on to the prepartitioned copy drive, but I would prefer dump/restore.
> > I normally store my image copies on a Samba share on another system,
> > they are stored as files.  I am not copying to another raw drive.
> In that case, use dump(8) to create those files and store them
> where-ever you wish.
> > 
> > Is there an image-copy backup program that understands the UFS
> > file-system? Or perhaps there is a better solution on FreeBSD?
> As mentioned above, dump(8)/restore(8) is made for that.


i used something like "(dump -L -0f - /)|(cd /mnt/image ; restore -rf -)" to
migrate my root partition onto a new disk.

just be sure to *not* use pax(1). i fell for it once and ran into a lot of
problems, because it doesn't preserve all data (such as chflags(1) e.g.).


ps: if you still want to do a sector by sector copy, have a look at
recoverdisk(1). it's really great in trying to recover every last bit on semi
broken devices.
> ////jerry
> > _______________________________________________
> > freebsd-questions at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list