Re: Replacing boot drive: how to make a copy of it?
On Sunday 03 September 2006 23:23, Marty wrote:
> Marty wrote:
> > Kaspar Fischer wrote:
> >> Hi list,
> >> I need to replace my boot disk as it starts failing (with bad blocks).
> >> What is the easiest way to obtain, on a new harddrive (at least as
> >> large as the old one), an exact copy of the root file system and
> >> swap partition?
> >> Never touch a running system -- so my intention is to *copy* the
> >> drive instead of installing a new Debian system.
> >> Thanks and regards,
> >> Kaspar
> > If for example you have two identical hard drives /dev/hda and
> > /dev/hdb, with your root partition on /dev/hda, and you don't have
> > any bad blocks on either drive, then you can make a perfect sector-
> > -by-sector mirror using "cp /dev/hda /dev/hdb"
> Addendum: I posted in haste. Having re-read your message, since your
> case involves both bad blocks and non-identical drives, I would probably
> opt for rsync as described below after manually setting up the partitions
> on the target drive.
One other suggestion. If, before you make the copy you set up the new drive
as a single element of a raid 1 raid array, then replace the failing disk and
add the replacement in as the second element to this array, you will then
have a permanent hot standby system.
That is something I have just done, although I have a separate boot partition,
and you have to independently store the boot block on to both drives (I use
grub - which is very easy).
There is some good articles on the web with step by step instructions - I
can't locate them right now, but a bit of googling will find them