Duplicate the System Drive

FreeBSD

This How-to will outline how to migrate FreeBSD to a new larger drive or just move things over to a new drive. In this how-to I will assume you are upgrading an IDE system but this same procedure will work for a SCSI system just use the da* device instead of the ad* device.

Install the new drive as a slave (for IDE) or a second drive (for SCSI). For this how-to ad0 is the old drive and ad1 is the new one.

Erase all data on the new drive

# dd if-/dev/zero of=/dev/ad1 bs=512 count=79

Fdisk and label the new drive.

You can use sysinstall to fdisk and label the new drive or use the command line utilities. Create the ‘a‘ slice for root and ‘e‘ for usr.

# fdisk -v -B -I /dev/ad1
# bsdlabel -w -B /dev/ad1s1
# bsdlabel -e /dev/ad1s1

Create the new file systems on the new disk

# newfs /dev/ad1s1a
# newfs -U /dev/ad1s1e

Clone the existing file systems to the new drive.

# mount /dev/ad1s1a /mnt
# dump -0f - / | (cd /mnt; restore -rvf - )
# mount /dev/ad1s1e /mnt/usr
# dump -0f - /usr | (cd /mnt/usr; restore -rvf - )

Leave a Comment

Your email address will not be published. Required fields are marked *