Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Best way to copy /* ?
Date: Tue, 28 Dec 2010 13:22:07
Message-Id: 201012281420.14054.wonko@wonkology.org
In Reply to: Re: [gentoo-user] Best way to copy /* ? by Mike Edenfield
1 Mike Edenfield writes:
2
3 > The tar method you're looking for is:
4 >
5 > tar -C /old cpf - | tar -C /new xvpf -
6 >
7 > You'll probably not want to do the entire / in a single go,
8 > since /proc, /sys, and /dev (at least) should be skipped.
9 > Copy /old/sbin -> /new/sbin, etc. for all of the root
10 > folders that aren't their own partitions. The rest you can
11 > do the entire mount point at once, though I'm not sure you
12 > really need to copy /tmp either.
13
14 Or bind mount root to somewhere else:
15 mount -o bind / /new
16 /new then contains all of / , but without the filesystems mounted at root.
17 It also has has the original /dev with its necessary entries console and
18 null, but without the stuff udev added.
19
20 It also takes care of /tmp. Its contents are unimportant, but the
21 permissions of the directory itself matter, the sticky bit needs to be set.
22
23 Wonko