From owner-freebsd-questions@FreeBSD.ORG Tue Dec 9 14:26:36 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 62CEF16A4CE for ; Tue, 9 Dec 2003 14:26:36 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E49343D1F for ; Tue, 9 Dec 2003 14:26:33 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id hB9MQVwt061952; Tue, 9 Dec 2003 16:26:31 -0600 (CST) (envelope-from dan) Date: Tue, 9 Dec 2003 16:26:31 -0600 From: Dan Nelson To: lists@battleface.com Message-ID: <20031209222630.GD2435@dan.emsphone.com> References: <2F59B51B-2A94-11D8-9005-000A95775140@battleface.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2F59B51B-2A94-11D8-9005-000A95775140@battleface.com> X-OS: FreeBSD 5.2-BETA X-message-flag: Outlook Error User-Agent: Mutt/1.5.5.1i cc: freebsd-questions@freebsd.org Subject: Re: archiving and restoring disk images... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2003 22:26:36 -0000 In the last episode (Dec 09), lists@battleface.com said: > I dumped a disk image of my root partition like this: > > dd if=/dev/da0s1a | gzip -9 -c > where.ever.gz > > Does this include the boot sector? In other words, if I need to > restore this disk image I can do the reverse and the boot sector and > root partition will be back to that state. How should I go about > this, if what I'm saying is valid? Can I do this in single user mode > or should I boot from CD and go from there? I haven't needed to do > this yet, but I want to know how. If dumping the root partition like > this is not a good means of backing up, please say so. What would you > recommend? I tar most everything else. The first BSD partition includes the disklabel partition and the boot blocks for that slice, but will not contain the MBR or fdisk partition table. Something like "dd if=/dev/da0 of=mbr count=1" would do that. To restore the disklabel partition you'll need to dd your where.ever dump to /dev/da0s1, since on a new disk there won't be an 'a' partition to write to. After the dd is done, the 'a' partition should appear. I usually either use dump or tar to back up my root partition, and use sysinstall or a bootable CD image to fdisk and disklabel new media before restoring. That way I can change the partition sizes if my new disk is larger/smaller than the original. -- Dan Nelson dnelson@allantgroup.com