best approach to clone a disk?

Steve Quinn letter2steve at
Wed Feb 15 11:40:48 PST 2006

--- 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

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

I hope this helps

Take care


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the freebsd-questions mailing list