Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2006 12:29:19 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Kevin Kinsey <kdk@daleco.biz>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Using dd to Make a Clone of a Drive
Message-ID:  <20060210102919.GA1056@flame.pc>
In-Reply-To: <43EBE2F8.8000501@daleco.biz>
References:  <200602092036.k19KaIhn086956@dc.cis.okstate.edu> <20060209220123.GA4751@flame.pc> <43EBE2F8.8000501@daleco.biz>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2006-02-09 18:48, Kevin Kinsey <kdk@daleco.biz> wrote:
>Giorgos Keramidas wrote:
>> Bah!  That's too slow for my taste.  I would usually go for a newfs,
>> dump, and restore option.  For instance, to create a copy of /usr on a
>> second disk:
>>
>>    newfs -U /dev/ad1s1a
>>    mount /dev/ad1s1a /mnt
>>    dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )
>>
>> Copying with dd(1) is not as fast :)
>
> Sorry to butt in --- but I'm needing to start cloning too.  Looks
> like a winner to me ... wouldn't this have the added advantage
> of making "same size and geometry" (cf. Erik Trulsson, 4 hours ago,
> this thread) less relevant?

Yes, this is pretty much the important point :)

> As long as the "new" slice had enough space, geometry shouldn't
> matter to dump|restore ....  <?>

Right :)  It also allows restoring in a different partition layout.

I used this recently to 'recover' my laptop's installation, using a
spare partition.  Before running 'installkernel' and 'installworld',
a backup of my root, /var and /usr partitions was saved with:

    # cd /home/backup
    # dump -o -aL -f root.ad0s1a /
    # dump -o -aL -f var.ad0s1d  /var
    # dump -o -aL -f usr.ad0s1e  /usr

A 'copy' of the original /, /var and /usr was restored in ad0s2a, which
was a single UFS partition, large enough to hold a restored copy of my
old /, /var and /usr partitions:

    # newfs -U /dev/ad0s2a
    # mount /dev/ad0s2a /mnt
    # ( cd /mnt;      restore -ruf /home/backup/root.ad0s1a )
    # ( cd /mnt/var ; restore -ruf /home/backup/var.ad0s1d  )
    # ( cd /mnt/usr ; restore -ruf /home/backup/var.ad0s1e  )

Then, when things went totally nuts after the installation of a new
system on ad0s1* partitions, I could still boot from ad0s2a and restore
my old backup copies from /home :)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060210102919.GA1056>