From owner-freebsd-questions@FreeBSD.ORG Sat Jun 9 17:59:30 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38AA01065670 for ; Sat, 9 Jun 2012 17:59:30 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from fileserver.home.qeng-ho.org (blue.qeng-ho.org [217.155.128.241]) by mx1.freebsd.org (Postfix) with ESMTP id 4DBB88FC08 for ; Sat, 9 Jun 2012 17:59:29 +0000 (UTC) Received: from fileserver.home.qeng-ho.org (localhost [127.0.0.1]) by fileserver.home.qeng-ho.org (8.14.5/8.14.5) with ESMTP id q59HiwT3073419; Sat, 9 Jun 2012 18:44:58 +0100 (BST) (envelope-from freebsd@qeng-ho.org) Message-ID: <4FD38B9A.4010400@qeng-ho.org> Date: Sat, 09 Jun 2012 18:44:58 +0100 From: Arthur Chance User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120425 Thunderbird/12.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <2903.1339191855@tristatelogic.com> <20434.30642.31558.246729@jerusalem.litteratus.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Ronald F. Guilmette" Subject: Re: Making a bootable backup (hard)disk... how? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 17:59:30 -0000 On 06/09/12 00:58, Warren Block wrote: > On Fri, 8 Jun 2012, Robert Huff wrote: > >> >> Ronald F. Guilmette writes: >> >>> I got a lot of disks here, so that part is not a problem. I just >>> need to make sure that I'm gonna do this the Right Way[tm]. >>> (I've already been making my own ham-fisted disk-to-disk backups >>> in the past, but I'm sure that the way I have been doing that is >>> sub-optimal, so I'm here seeking knowledge of how to do this the >>> Right Way.) >>> >>> The bottom line is this... I know how to use cpio, and would like >>> to use it to create a complete and _bootable_ backup of my main >>> system disk. (My main system disk has only one BIOS partition, >>> and that is sub-divided into the usual set of FreeBSD partitions, >>> you know, /, /dev, /tmp, /usr, /var, /usr/compat/linux/proc, and >>> /var/named/dev.) >> >> As far as I know, the only way guaranteed to preserve metadata >> is dump/restore. See previous (not necessarily recent) discussion >> (on this list, and possibly in the Handbook) for more information. > > The rsync port has a flags option. I haven't tried it for a full backup. > Even if it can copy all filesystem attributes like dump, there are still > non-filesystem things needed for booting that neither can copy, like > partition tables and boot blocks. There's a BFI (brute force and ignorance) way of doing it in the base system - dd. Provided your system disk is quiescent (ideally when running from a live CD or all partitions mounted read-only, otherwise pray to the deity of your choice) and the backup disk is a) at least as large as the system disk, and b) has the same sector size, then a simple dd from the system disk to the backup should work. [Greybeard war story:] Going back about 25-30 years, a friend of mine was responsible for running the Unix systems in an EE department of a UK university. He used to back up the disks (probably around 10 MB in those days) to 1/2" tape every night. Eventually he got sick of undergraduates asking him to restore files they'd accidentally deleted, and hit upon the idea of dd'ing the disk to tape, and then if a student wanted a restore, he'd mount the tape as a r/o file system (these were the days of tape block devices and trusting all users) and tell them to use restore to get the files themselves. It took forever, but it was the student's time that was wasted, not his. Most of them learned not to delete wanted files after one or two times of doing this.