From owner-freebsd-questions@FreeBSD.ORG Mon Oct 29 00:24:36 2007 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 46D0D16A41A for ; Mon, 29 Oct 2007 00:24:36 +0000 (UTC) (envelope-from hamilton@pobox.com) Received: from ms-smtp-01.rdc-kc.rr.com (ms-smtp-01.rdc-kc.rr.com [24.94.166.115]) by mx1.freebsd.org (Postfix) with ESMTP id DA82813C4A7 for ; Mon, 29 Oct 2007 00:24:35 +0000 (UTC) (envelope-from hamilton@pobox.com) Received: from woodstock.nethamilton.net (CPE-72-135-240-24.wi.res.rr.com [72.135.240.24]) by ms-smtp-01.rdc-kc.rr.com (8.13.6/8.13.6) with ESMTP id l9SNUfNt027224; Sun, 28 Oct 2007 18:30:41 -0500 (CDT) Received: by woodstock.nethamilton.net (Postfix, from userid 500) id 4A1A925C5137; Sun, 28 Oct 2007 18:34:22 -0500 (CDT) Date: Sun, 28 Oct 2007 18:34:22 -0500 From: Jon Hamilton To: Gary Kline Message-ID: <20071028233422.GC2196@woodstock.nethamilton.net> References: <20071028215454.GA52631@thought.org> <20071028230203.GA13943@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071028230203.GA13943@thought.org> X-Virus-Scanned: Symantec AntiVirus Scan Engine Cc: FreeBSD Mailing List Subject: Re: What's best way to copy a filesystem? [was: Re: slight emergency here...] 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: Mon, 29 Oct 2007 00:24:36 -0000 Gary Kline , said on Sun Oct 28, 2007 [03:02:03 PM]: } > At any rate, how do i as root, single user, cp -rp all of /var to } > elsewhere (/storage) and rmdir /var, them mkdir /var and copy } > everything back?? I've forgotten the cpio magic command. } > } The nutshelll of this posting could be: What's the best tool } to copy a /FILESYSTEM to /storage/FILESYSTEM? The best tool is the one you use successfully. If you're really talking about a whole filesystem, dump and restore may contain the least surprises in unusual situations: $ newfs /dev/whatever $ mount /dev/whatever /mnt $ cd /dev/whatever $ dump 0af - /old_filesystem | restore -rf - Then delete /mnt/restoresymtable when it's all done. Of course you can use tar, cpio, cpdup if you have it, or even cp. At different points in time historically some of those have had problems with some situations like sparse files, "extra" hard links, symlinks, etc. -- Jon Hamilton hamilton@pobox.com