[Sussex] Really Dumb dd question
Steve Dobson
SDobson at manh.com
Thu Jan 9 13:21:01 UTC 2003
Nik
On 09 January 2003 at 10:29 wrote:
> The purpose of this exercise is to make a exact (partition is not an
> issue here) duplicate of a disk which can be swapped from hdc to hda in
> the cables should hda collapse.. we can then if hda is still functional
> swap the disks around and walk away. the customer has a near instant
> last night replacement. just a shortcut to resolving problems.
>
> So how would cpio do this better?
This is a bit like using a sledge hammer to crack a nut. dd will make
and exact copy, but it will also copy those parts of the disk that don't
need to be copied (like swap).
I would recommend using 'rsync'. It good in that it looks at the
modified date stamp and the file size and assumes that copies which have
the same values don't need to be copied. Much better in terms of
system resources.
The only problem left is making that disk bootable when it is swapped
to the first boot device. You'll need to look at lilo configuration
for that; I don't know if it can be done as I haven't done it myself.
Personally, I'd do this another way.
First I'd configure lilo.conf to have a boot option that boots from the
backup disk (still on /dev/hdc - with root as /dev/hdc1).
Then after the rsync of /etc I'd run a sed script to change the backup
copy of /etc/fstab so that it now points at devices on /dev/hdc.
If the main disk fails (as long as the boot block is okay) you can boot
it form the backup. Short down time as you don't need to move any hardware.
Given that the disk has failed and this is a commercial operations you're
going to replace the disk anyway (disks are cheep!!!) so you'll have to
get some down time anyway.
Hope this has helped
Steve
More information about the Sussex
mailing list