[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using dd to copy a disk.



On Tue, Jul 29, 2003 at 07:55:24AM +0200, Rogier Wolff wrote:

> > Can I build a new bare metal drive on /dev/hda using dd
> > 
> >    dd if=/dev/sda of=/dev/hda
> > 
> > Will that work with the hardware RAID array?  If so will it also copy 
> > the MBR?
> 
> Yep. Yep. 
> 
> > The destination drive will NOT be used in a RAID array.  Also, the 
> > drives in the RAID array cannot be used outside of the array due to the 
> > meta data written by 3ware card.
> 
> I take objection to the term "cannot be used": 
> As "harddisk-recovery.com" we'll make them work if neccesary, but
> that's not really relevant now.

Well, I meant I couldn't pull a drive out of the RAID array and use it 
as a stand-alone IDE drive as it.

> - Modify the /etc/fstab and /etc/lilo.conf files before rebooting. 
> - Add

Yes, my fstab points to /dev/sda* and the new drive will be at /dev/hda*


> to Lilo.conf, mount the hda disk on /mnt and then run 
>   lilo -r /mnt
> 
> (Mount at least the / and /boot partitions! Hmm. you don't have /boot,
> so "/" would have to do.... )
> 
> Note that I'm recommending you run lilo while you're concerned about
> the MBR. It might work, but running LILO again gives you a bigger
> chance to get it to work....

Yes, I would think I'd need to do that.  The RAID card is confusing to 
me -- I assume the MBR says which drive and which sector (first sector, 
I suppose) to load the OS.  So I'd think that would be different for the 
new hardware.

> Oh, Note that you'd be copying a LIVE partition. A logging filesystem
> like ext3 or XFS will take care in writing stuff to the drive in the
> right order. You're screwing that up by just copying over the
> raw drive.

So rsync would be a better way to go, then.  That would avoid that 
problem.

Otherwise, probably best to drop into single mode and then mount 
everything read only, as you suggest, and then run the dd command.
I assume rsync will handle the symlinks ok.  Plus I could re-partition 
the drive (say into a single partition) and rsync wouldn't care.

I would have expected rsync to take longer, but I guess as was pointed 
out dd will copy unused sectors.

Thanks much for all the tips.


-- 
Bill Moseley
moseley@hank.org



Reply to: