1 |
On Sunday 09 January 2011 21:11:02 Alex Schuster wrote: |
2 |
> Mick writes: |
3 |
> > I used: |
4 |
> > tar -X file.list -lcvSf - . | (cd /new_gentoo_partition; tar -xpvf - ) |
5 |
> > |
6 |
> > to clone a gentoo / partition to another partition on the same disk (I |
7 |
> > want to run some tests from it). |
8 |
> > |
9 |
> > The file.list has this is in it: |
10 |
> > |
11 |
> > tmp/* |
12 |
> > proc/* |
13 |
> > sys/* |
14 |
> > dev/* |
15 |
> > etc/mtab |
16 |
> > usr/portage/distfiles/* |
17 |
> |
18 |
> Which also excludes /usr/include/sys, not only /sys. And so on. You |
19 |
> probably have to rewrite this as ./tmp/* , but I did not test this. |
20 |
> |
21 |
> And I just learnt that -l is no longer a synonym for --one-file-system, |
22 |
> at least for tar 1.25. I'd do it with a bind mount this: |
23 |
> |
24 |
> mount -o bind / /mnt |
25 |
> cd /mnt |
26 |
> tar -cvSf - . | (cd /new_gentoo_partition; tar -xpvf - ) |
27 |
> |
28 |
> This way, the original /dev is being copied (including entries console |
29 |
> and null), without the udev stuff that is mounted on top of /dev, while |
30 |
> with --one-file-system only the empty /dev directory would be created. |
31 |
|
32 |
Thanks Wonko, it seems that I fell victim to my regex ignorance. I started |
33 |
with /tmp, but that would also exclude the directories and I didn't fancy |
34 |
creating them manually afterwards. Also dir/* does not include dir/.* |
35 |
|
36 |
What shall I use for excluding all the contents of a directory, but not the |
37 |
directory itself? |
38 |
|
39 |
I'll need to experiment some more. |
40 |
|
41 |
-- |
42 |
Regards, |
43 |
Mick |