best approach to clone a disk?

Joe Auty joe at
Wed Feb 15 12:47:33 PST 2006

On Feb 15, 2006, at 2:40 PM, Steve Quinn wrote:

> --- Joe Auty wrote:
>> Thanks Steve, but this is exactly the same script I've been using all
>> along, while in Single User Mode.
>> However, could you explain the zeroing of blocks, and what its
>> purpose is for? Does this solve the problem of space being lost when
>> cloning a disk to a larger disk?
> Hi Joe
> Sorry, you mentioned Freesbie and I assumed you had not used dump  
> under your FreeBSD install
> Now that I think about it, I was getting errors like yours when I  
> was first learning this script
> I remember having to adjust it to taste
> Have a look at your fstab (cat /etc/fstab) and ensure the scripts  
> references to your FreeBSD
> slices match your system.
> In the script I sent you, my clone destination disk was ad2 so you  
> will need to look at that as
> well
> Don't worry Joe, you are very very close
> Regarding zeroing empty or unused blocks, have a look at this
> Regarding space lost cloning to a larger disk, zeroing unused  
> blocks wont help that.  Imagine your
> 10GB FreeBSD hard disk is cloned with G4U to a 20GB hard disk.  It  
> will probably work great but
> your 20GB disk is only half full.  You will have to use growfs to  
> expand a slice or create a new
> partition to reclaim the empty space. Sorry, I have not tried this  
> yet and have no experience.
> In cloning to a bigger disk, I prefer the dump/restore script  
> method as I get to fully utilize the
> larger disk capacity

It sort of helps, but sort of doesn't at the same time. I've tried  
the dump command from the script using the correct slices, and still  
had that kernel panic. I figured that using the Freesbie CD might be  
a way of testing whether my install on my master/source drive was  
somehow messed up, but I haven't gone very far with that (dump  
reports "unsupported file system" errors).

I've also looked at growfs, but I'm not entirely sure how to handle  
the prequisite to using it which is using bsdlabel. It seems that  
running bsdlabel within /stand/sysinstall doesn't recognize the free  
space, so I can't create a new partition map that reflects this free  
space. I'll keep working at it though...

Thanks for your help!

Joe Auty
NetMusician: web publishing software for musicians
joe at

More information about the freebsd-questions mailing list