Transferring system to a new hard drive

Dennis Koegel amf at hobbit.neveragain.de
Fri Nov 5 07:24:47 PST 2004


On Fri, Nov 05, 2004 at 09:13:25AM -0600, CHris Rich wrote:
> My original install of FreeBSD is on a 30 gig hard drive, I want to
> move it to an 80 gig I now have, but i don't want to have to reinstall
> everything since I've spent hours waiting for some ports to install.
> [...]
> If I do move it over will I have ot make new slices to take advantage
> of the bigger hard drive?

What I usually do is:
- install the new hd as second drive in the running system
- partition/slice it as you like
- newfs the new partitions
- mount the whole structure somewhere, like
  * mount /dev/ad1s1a /mnt
  * mount /dev/ad1s1e /mnt/usr
  * mount /dev/ad1s1f /mnt/var
  etc.
- go single user
- cd / && find <all dirs except mnt, proc, tmp> | cpio -padmuv /mnt
- check /mnt/etc/fstab
- write boot sector to ad1
- shutdown, replace old drive with new drive
- done

The find|cpio combination will copy your entire system 1:1 to the
new hard disk and it's slice structure below /mnt.

HTH,
- D.


More information about the freebsd-questions mailing list