From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PXZV2-0007cK-LP for garchives@archives.gentoo.org; Tue, 28 Dec 2010 13:22:07 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 099C2E0720; Tue, 28 Dec 2010 13:20:15 +0000 (UTC) Received: from mx.virtyou.com (mx.virtyou.com [94.23.166.77]) by pigeon.gentoo.org (Postfix) with ESMTP id BD366E0720 for ; Tue, 28 Dec 2010 13:20:15 +0000 (UTC) Received: from weird.localnet (static-87-79-89-40.netcologne.de [87.79.89.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx.virtyou.com (Postfix) with ESMTPSA id EBCBD39A018 for ; Tue, 28 Dec 2010 14:20:14 +0100 (CET) From: Alex Schuster To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Best way to copy /* ? Date: Tue, 28 Dec 2010 14:20:13 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.36-ck-r3; KDE/4.5.4; x86_64; ; ) References: <4D196F67.1010400@kutulu.org> In-Reply-To: <4D196F67.1010400@kutulu.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201012281420.14054.wonko@wonkology.org> X-Archives-Salt: 7badb20a-9135-4f69-8540-1af8adf7b748 X-Archives-Hash: 6de97034ff00a4816075371e1e510a44 Mike Edenfield writes: > The tar method you're looking for is: > > tar -C /old cpf - | tar -C /new xvpf - > > You'll probably not want to do the entire / in a single go, > since /proc, /sys, and /dev (at least) should be skipped. > Copy /old/sbin -> /new/sbin, etc. for all of the root > folders that aren't their own partitions. The rest you can > do the entire mount point at once, though I'm not sure you > really need to copy /tmp either. Or bind mount root to somewhere else: mount -o bind / /new /new then contains all of / , but without the filesystems mounted at root. It also has has the original /dev with its necessary entries console and null, but without the stuff udev added. It also takes care of /tmp. Its contents are unimportant, but the permissions of the directory itself matter, the sticky bit needs to be set. Wonko