Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 1999 14:23:28 -0400 (EDT)
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        dtougas@converging.net
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Is it possible to clone a hard disk?
Message-ID:  <199907121823.OAA24661@cc942873-a.ewndsr1.nj.home.com>
In-Reply-To: <D1378A34D8E2D211831900105A99D3FE06D1B9@BDC> from Damien Tougas at "Jul 12, 99 10:59:04 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Damien Tougas wrote,
> Hello,
> 
> I want to put a second IDE hard disk in my FreeBSD 3.1 server, and create a
> clone of the one that currently exists.  I thought that this might be a good
> disaster recovery scheme to use when upgrading my operating system.  If any
> problem occurrs while installing the upgrade, all I have to do is switch the
> drives to be back to where I was before with minimum downtime.  How possible
> or practical is this?  I know that in Windows NT we would use a product such
> as Norton Ghost, how would I go about creating such a clone in FreeBSD?

It's a breeze. Slice and partition the new drive (ask if you need
help). Then make new filesystems in the partitions (see newfs(8) and
ask if you need more help). Then for each partition to be cloned (for
an example, I assume you are in slice 1 of the new drive), 

# mount /dev/wd1s1a /mnt
# cd /mnt
# dump -0af - / | restore -rf -

And then move on to the next filesystem,

# umount /mnt
# mount /dev/wd1s1f /mnt
# cd /mnt
# dump -0af - /usr | restore -rf -

etc., etc... This can easily be scripted if you want to be clever.

Of course, see dump(8) and restore(8) for more details about what is
going on there. And feel free to ask more detailed questions.

Some people may recommend doing a dd(1) right from one disk to
another, but I would only recommend it if you _really_ know what you
are doing.
-- 
Crist J. Clark                           cjclark@home.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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