Unix System Total Replication

Is there any way to totally replicate a unix system from one hardisk to another? And be able to swap the hardisk and restart the system without any error?

Yes, of course. The dd() command. Disk-to-disk copy.

Tq Neo, for the reply, but i think that would not solve my problem. I want to be able to duplicate the hardisk, say for backup purposes, and when the system actually crash or got corrupted, i can just change the hardisk to my backup and restart the computer without any hassle at all. Any ideas?
tried dd() command, could not run system with copied hardisk.

We have used dd many times and it works fine. Many linux vendors also use dd to duplicate entire disk sets for linux boxes they are selling. That is how they can get a lot of linux boxes out the door quickly. If they had to do the standard install on each platform, it would take forever!

When you run dd between hard disks with the same geometry, the two disks have a mirror copy of each other. If you mount the copied disk in place of the original disk, it will work fine. If I'm not mistaken dd also copies all the boot sector and MBR boot information as well. Here is plain example:

(not counting blocks, other flags, etc.)

dd if=/dev/hda of=/dev/hdb

where /dev/hda is the original and /dev/hdb is the new one. Of course, your hard drives might be on different device drivers depending on your configuration, boot sequence, etc.

Then you must replace /dev/hda with /dev/hdb.

This should work. But I've not done if for some time, so please check the man pages for dd.

[Edited by Neo on 11-03-2000 at 09:51 PM]

Dear Neo & Nuraman,

we had the same problem and wanted to mirror our boot disk
to a backup one. So we tried to use dd as suggested by Neo.
Our boot disk is partitioned in eight... partitions.
Our backup disk is exactly the same as the boot one (same
model, size) and has been partitioned in the same way as the boot one.
So we tried to dd each partition on the boot disk to the
corresponding partition on the backup

Example: dd if=/dev/dsk/c0t0d0s0 of=/dev/dsk/c0t2d0s0

At the end, we took a look at the backup disk: it was
empty, no file which was on the boot disk was found on the
We even tried to swap disks, but the server does not boot
anymore, a message is shown saying: Boot failed, loaded
file is not executable.

Did we dd'ed the correct devices ?
On our system there are the same partitions listed as
May be we must dd those devices instead ?