From owner-freebsd-questions@FreeBSD.ORG Fri Oct 31 16:12:48 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 800F91065672 for ; Fri, 31 Oct 2008 16:12:48 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 3E10A8FC19 for ; Fri, 31 Oct 2008 16:12:48 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id m9VG9YWT018267; Fri, 31 Oct 2008 12:09:34 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id m9VG9YjJ018266; Fri, 31 Oct 2008 12:09:34 -0400 (EDT) (envelope-from jerrymc) Date: Fri, 31 Oct 2008 12:09:34 -0400 From: Jerry McAllister To: Christoph Kukulies Message-ID: <20081031160934.GA18219@gizmo.acns.msu.edu> References: <490AC650.3000904@kukulies.org> <20081031153709.GC17878@gizmo.acns.msu.edu> <490B28D0.8070206@kukulies.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <490B28D0.8070206@kukulies.org> User-Agent: Mutt/1.4.2.2i Cc: Jerry McAllister , freebsd-questions@freebsd.org Subject: Re: fastest raw device copy? 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: Fri, 31 Oct 2008 16:12:48 -0000 On Fri, Oct 31, 2008 at 04:48:32PM +0100, Christoph Kukulies wrote: > Jerry McAllister schrieb: > >On Fri, Oct 31, 2008 at 09:48:16AM +0100, Christoph Kukulies wrote: > > > > > >>Hi list, > >> > >>I'm considering using a bootable USB stick with FreeBSD to perform a > >>backup of my notebooks' > >>500 GB hard disk to a physically identical (same make, same type, same > >>size) hard disk attached to USB. > >> > >>What would be the fastest way to do that sector by sector copy? I'm > >>using dd right now, > >> > >>dd if=/dev/ad0 of=/dev/da0 bs=10000000 > >> > >>but maybe there is a utility which does this faster or a larger buffer > >>size? Probably the limit will be > >>the USB 2.0 bus speed anyway? > >> > > > >Are you sure you want to do a sector-by-sector copy? > >That won't get you much that is useful in terms of a backup. > > > >Can't you use dump/restore instead? > > > >Dump each file system on /dev/ad0 to a file on /dev/da0. > > > >Create a file system on /dev/da0 using newfs first. You may or > >may not want to create a FreeBSD slice and partition there before > >doing the newfs. > >Make a mount point and mount it. > > > >mkdir /bkmnt > >mount /dev/da0 /bkmnt Or if you created slice and partition in /dev/da0 > > mount /dev/da0s1a /bkmnt > > > >Then do the dumps > > > > dump 0af /bkmnt/rootbackup / > > dump 0af /bkmnt/usrbackup /usr > > dump 0af /bkmnt/homehackup /home > > > >etc for whatever file systems you want to back up. > > > >You will be much better off than with a sector by sector copy. > > > >////jerry > > > > The idea was to have a drop in backup for my notebook that allows me to > continue working with a minimum of delay. (requires a philips > screwdriver though :-) > > Of course a failure of the source disk while doing the image copy as the > worst case scenario > would leave me with empty hands :-) > > There are a couple of partitions with different OSs on that hard drive. Still, that is not really the best way to do backups. For the FreeBSD, you can build the slice and partitions in it and back up each appropriately. Make mount points as needed mkdir /bkroot mkdir /bkusr mkdir /bkhome etc Do the mounts mount /dev/da0s1a /bkroot mount /dev/da0s1d /bkusr mount /dev/da0s1g /bkhome etc as appropriate Make sure those filesystems on the USB are empty. Then use dump/retore to make the copies cd /bkroot dump 0af - / | restore -rf - cd /bkusr dump 0af - /usr | restore -rf - cd /bkhome dump 0af - /home | restore -rf - etc as appropriate This makes a much more reliable backup that the sector by sector thing. If you make the slice bootable and have an MBR, it can be bootable. It takes care of any difference in device size/block counts and dealing with back blocks transparently. If you have more than one slice and each has a different OS, then you need to make an equivalent backup for each OS to the appropriate slice on the USB. ////jerry > > -- > Christoph > > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"