Swapping hard drives

Ted Mittelstaedt tedm at toybox.placo.com
Mon Mar 7 01:15:33 PST 2005



> -----Original Message-----
> From: owner-freebsd-questions at freebsd.org
> [mailto:owner-freebsd-questions at freebsd.org]On Behalf Of Eric McCoy
> Sent: Sunday, March 06, 2005 6:07 AM
> To: Ralph
> Cc: FreeBSD Questions
> Subject: Re: Swapping hard drives
>
>
> Ralph wrote:
> > Hello folks
> >   I'm looking to do a quick swap on a hard disk I currently
> have in my FreeBSD file-server.  It's an old 30Gb disk, and
> I've bought a nice, new big one to replace it.  The problem
> is, I'm not sure what the best way to do this is.  I have
> Samba shares on there, and other things, and as far as I'm
> concerned it's better if the system doesn't know [or care]
> that the disk is being swapped out, does that make sense?
> >
> >   I guess what I'm asking is this, what's the best way to do
> a swap like this?
>
> Put the new disk in your server, partition it "similarly" to the old
> disk, format, and copy over your data.  Then remove the old disk and
> reuse its connectors for your new disk (or just update
> /etc/fstab).  The
> idea is that your old filesystem is, say, /dev/ad2s1e.  That's
> what you
> want your new one to be.  All you need to do, really, is juggle IDE
> cables or SCSI IDs to make that happen.
>

Be careful that you use the new high density cable with your new disk,
don't use the old IDE cable or you will have problems.

Here's an alternate method to the above:

1) Remove old disk, install new disk, put a minimal scratch install of
freebsd
on the new disk.

2) disklabel -e ad0  and record the disklabel exactly!

3) put the old disk back in and jumper it master, rejumper the new disk
as slave.

4) dd if=/dev/ad0 of=/dev/ad1 bs=someblocksizeyoufeelworkswell

this will overwrite the disklabel on the new disk with a copy of the
disklabel on the old one.

5) Remove old disk and rejumper new disk as single drive.

6) boot into FreeBSD and disklabel and change the label on ad0 to what it
was
in step 3, reboot server for good measure

6) now you can go into the partitioning program and you will see all the
extra space after the end of the existing partition, you can then put
this
into a new partition and mount it on some convenient directory.

I don't know if the above will work I never have tried it, but I know
people who have done this sort of thing with 4.X.  The big advantage is
you get exactly what was on the old disk, onto the new disk, far more
exact than a simple file copy.

Ted


> You can also do an over-the-network copy, but that will obviously be
> much slower and requires two FreeBSD computers besides.
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"
>



More information about the freebsd-questions mailing list