From owner-freebsd-questions@FreeBSD.ORG Tue Oct 24 20:01:50 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 EBC6516A403 for ; Tue, 24 Oct 2006 20:01:49 +0000 (UTC) (envelope-from heli@mikestammer.com) Received: from smtp110.sbc.mail.mud.yahoo.com (smtp110.sbc.mail.mud.yahoo.com [68.142.198.209]) by mx1.FreeBSD.org (Postfix) with SMTP id 80CE543D49 for ; Tue, 24 Oct 2006 20:01:49 +0000 (GMT) (envelope-from heli@mikestammer.com) Received: (qmail 58028 invoked from network); 24 Oct 2006 20:01:46 -0000 Received: from unknown (HELO mail.mikestammer.com) (mikestammer@sbcglobal.net@70.131.98.204 with login) by smtp110.sbc.mail.mud.yahoo.com with SMTP; 24 Oct 2006 20:01:45 -0000 Received: from localhost (localhost [127.0.0.1]) by mail.mikestammer.com (Postfix) with ESMTP id D4CBD5D; Tue, 24 Oct 2006 15:01:41 -0500 (CDT) X-Virus-Scanned: amavisd-new at mikestammer.com Received: from mail.mikestammer.com ([127.0.0.1]) by localhost (gondolin.middleearth.mikestammer.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HEGqLuI8rRUv; Tue, 24 Oct 2006 15:01:39 -0500 (CDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eric) by mail.mikestammer.com (Postfix) with ESMTP id 55DD84A; Tue, 24 Oct 2006 15:01:38 -0500 (CDT) Message-ID: <453E7121.9090105@mikestammer.com> Date: Tue, 24 Oct 2006 15:01:37 -0500 From: Eric User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: James Smallacombe References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Copying binaries to new server 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: Tue, 24 Oct 2006 20:01:50 -0000 James Smallacombe wrote: > On Tue, 24 Oct 2006, Jerry McAllister wrote: >> True, but I think the poster was suggesting that dump/restore is >> a better way than using tar. > > I'm not as familiar with BSD dump...does it compress well? Also, what's this? > > su-2.05b# dump -0L -f ns1.usr.dump /usr > DUMP: Date of this level 0 dump: Tue Oct 24 15:52:01 2006 > DUMP: Date of last level 0 dump: the epoch > DUMP: Dumping snapshot of /dev/da0s1d (/usr) to ns1.usr.dump > DUMP: mapping (Pass I) [regular files] > DUMP: mapping (Pass II) [directories] > DUMP: estimated 3077070 tape blocks on 79.03 tape(s). > DUMP: dumping (Pass III) [directories] > DUMP: Closing ns1.usr.dump > DUMP: Change Volumes: Mount volume #2 > DUMP: Is the new volume mounted and ready to go?: ("yes" or "no") yes > DUMP: Volume 2 begins with blocks from inode 149561 > DUMP: Closing ns1.usr.dump > DUMP: Change Volumes: Mount volume #3 > DUMP: Is the new volume mounted and ready to go?: ("yes" or "no") > > What volume? The one I'm dumping? If so, why does it keep asking whether > it's mounted? What are all these different volume numbers? I just want to > dump /usr to one file, compressing and preserving permissions and symlinks as > much as possible, so I can restore it to a new server. > i have never seen the volume messages when i backup. this is how i do it: Take a dump dump -0uanLf - /var | bzip2 | dd of=/some/path/dump-var-level0.bz2 dump -0uanLf - / | bzip2 | dd of=/some/path/dump-root-level0.bz2 dump -0uanLf - /usr | bzip2 | dd of=/some/path/dump-usr-level0.bz2 Restore a dump To Restore Interactively * First bunzip, make sure you have disk space. * restore -i -f filename.dump0 * or bzcat filename.dump0.bz2 | restore -i -f - without bunziping first. By the way bzcat filename.dump0.bz2 | ssh computer.bei$ * Navigage using cd, ls, etc. Use the verbose command to make things more verbose. * use add to add to list of stuff to extract. Will extract in CWD. * use delete to remove from list of stuff to extract. * When ready use the extract command to restore. Should look something like the following: restore > extract Extract requested files You have not read any tapes yet. If you are extracting just a few files, start with the last volume and work towards the first; restore can quickly skip tapes that have no further files to extract. Otherwise, begin with volume 1. Specify next volume #: 1 Mount tape volume 1 Enter ``none'' if there are no more tapes otherwise enter tape name (default: filename.dump0) extract file ./foobar/public_html/somefile.html Add links Set directory mode, owner, and times. set owner/mode for '.'? [yn] n restore > quit To Restore Entire Disk * Plug in fresh drive * /stand/sysinstall * fdisk, add bootloader, disklabel * Mount new drive somewhere, i.e. /mnt-root * Mount backups * cd /mnt-root; bzcat /backups/server/dump-root-level0.bz2 | restore -f -