From owner-freebsd-doc@FreeBSD.ORG Fri May 20 10:49:44 2005 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8740E16A4CE for ; Fri, 20 May 2005 10:49:44 +0000 (GMT) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8671143D66 for ; Fri, 20 May 2005 10:49:40 +0000 (GMT) (envelope-from markhannon@optusnet.com.au) Received: from hal.home.lan (c220-237-60-254.sunsh4.vic.optusnet.com.au [220.237.60.254])j4KAncG9004928 for ; Fri, 20 May 2005 20:49:39 +1000 Received: from tbird.home.lan ([192.168.1.5]) by hal.home.lan with esmtp (Exim 3.36 #1 (Debian)) id 1DZ54U-0002fK-00 for ; Fri, 20 May 2005 20:49:38 +1000 From: Mark Hannon To: freebsd-docs@freebsd.org Content-Type: text/plain Date: Fri, 20 May 2005 20:49:39 +1000 Message-Id: <1116586180.8570.1.camel@tbird.home.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 Content-Transfer-Encoding: 7bit Subject: HOWTO Restore a FreeBSD system using the fixit CD X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2005 10:49:44 -0000 Here are some notes I made when recently restoring an install. Perhaps something could go into the handbook? Regards/Mark ============================================================= HOWTO Restore a FreeBSD installation directly from dump files ============================================================= These instructions document how to restore a FreeBSD installation from a series of dump files stored on a local HDD. They have been used to migrate a FreeBSD installation from a vmware guest install to a local HDD install. Step One - Backup ----------------- Backup your FreeBSD installation to a series of dumpfiles. # /sbin/dump -L -0 -f root.0 / # /sbin/dump -L -0 -f var.0 /var # /sbin/dump -L -0 -f usr.0 /usr This will create three dumpfiles with your root, var and usr partitions. Move the files to a local disk partition. Step Two - Create FreeBSD partition ----------------------------------- Boot the 5.4-RELEASE-disc1 CD and select the Configure->Fdisk option. Create a FreeBSD partition and select W to write the changes. Ignore the warnings and quit. Step Three - Create FreeBSD disklabel ------------------------------------- Select the disklabel option and create and mount new options as per normal. Sysinstall creates the disklabel, makes the new filesystems and mounts them all under /mnt. i.e in the automatic disklabel mode the user will end up with the following filesytems created and mounted: / = /mnt /tmp = /mnt/tmp /var = /mnt/var /usr = /mnt/usr The following steps will restore the backup installation into these partitions. Step Four - Restore the Filessystems ------------------------------------ Select the fixit -> cd/dvd option and enter the Fixit shell. Start csh to get command line completion Fixit# csh Setup a large /tmp filesystem so that restore doesn't complain. Do this by linking to the restored systems /tmp. # mv tmp/ tmp.old # ln -sf /mnt/tmp tmp Mount the local disk partition with the files to restore. # mkdir /dumpfiles # /mnt2/usr/sbin/mount_msdosfs /dev/ad0s5 /dumpfiles Restore the root partition # cd /mnt # /mnt2/sbin/restore xf /dumpfiles/root.0 Restore the remaining partitions # cd /mnt/var # /mnt2/sbin/restore xf /dumpfiles/var.0 # cd /mnt/usr # /mnt2/sbin/restore xf /dumpfiles/usr.0 Enter the installed system to cleanup # /mnt2/sbin/chroot /mnt Correct the /tmp permissions in the installed system # chmod 1777 /tmp Edit fstab etc # vi /etc/fstab etc # vi /etc/rc.conf Exit the installed chroot, fixit csh and fixit shells # ^D # ^D # ^D Step Five - Reboot ------------------ Reboot and start your new system (either via another bootloader or by setting the FreeBSD partition active).