On Wed, May 22, 2002 at 07:29:11PM -0700, Angus D Madden wrote:
> Karsten M. Self, Mon, May 20, 2002 at 02:09:32AM -0700: 
> > on Mon, May 20, 2002, R. Lockhart ([EMAIL PROTECTED]) wrote:
> > > I need to transfer all my data, os, partitions, formatting, to a new
> > > hard drive. I got a lemon hd (still perfect electronicly but making
> > > ugly noises). A replacement is on the way from the manufacturer but
> > > I'm not sure about the best way to mirror a-b.
> >    $ mkdir /mnt/oldhd
> >    $ mkdri /mnt/newhd
> >    $ mount /dev/hda /mnt/oldhd
> >    $ mount /dev/hdb /mnt/newhd
> >    $ cd /mnt/oldhd
> >    $ tar cvf - . | ( cd /mnt/newhd; tar xf - )
> > (rsync, or cp -padR are other alternatives).

    Rsync be your best bet if you can determine the correct syntax. It's
    what system imager uses to basically do the same thing. 

> Also, you'll need to install a new boot block (MBR) or the new disk
> won't boot.  The LILO mini-howto explains how to do that:
> 
> http://www.tldp.org/HOWTO/mini/LILO-4.html
> 
> You can use fdisk -l /dev/hda to get the parition table of the old disk.

    sfdisk is really cool for this. Last week I had to put the exact
    same partition on 23 disks in a raid box I was setting up as a JBOD: 

    for i in c d e f g h i j k l m n o p q r s t u v w x 
        do 
        sfdisk -d /dev/sdb | sed s /sdb/sd$i/ | sfdisk -uM -L /dev/sd$i  
        done

    In this case, assuming that the drives are hda and hdc, and that
    they are the same size: 

    sfdisk -d /dev/hda | sed s /hda/hdc/ | sfdisk -uM -L /dev/hdc should
    do it. 

    Ain't unix wonnerful. 


-- 
My last cigarette was roughly 31 days, 9 hours, 20 minutes ago.
YHBW


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to