[blfs-support] Complete Backup of {,B}LFS

akhiezer lfs65 at cruziero.com
Sun Dec 22 13:28:23 PST 2013


> Date: Sun, 22 Dec 2013 12:55:15 -0600
> From: Bruce Dubbs <bruce.dubbs at gmail.com>
> To: BLFS Support List <blfs-support at linuxfromscratch.org>
> Subject: Re: [blfs-support] Complete Backup of {,B}LFS
>
	.
	.
> > 1.  Set up and mount a new partition for this system--done
> > 2.  As root in / run: $ find . -xdev -depth -print0 | cpio --null -pd
> > <mount point>
>
> Why not just 'cp -a /  <mount point>'
>


If using cp, then maybe use also '-x' option: else can get problems when cp 
encounters mount-point in its source-tree traversal, per foll example, in 
which src-file ./a/fa doesn't get copied to tgt-path ./a/b/mnt/a/fa :
========
$ mkdir -p ./a/b/{mnt,c/d/e}
$ touch ./a/{fa,b/{fb,c/{fc,d/{fd,e/fe}}}}
$ tree -aF .
.
`-- a/
    |-- b/
    |   |-- c/
    |   |   |-- d/
    |   |   |   |-- e/
    |   |   |   |   `-- fe
    |   |   |   `-- fd
    |   |   `-- fc
    |   |-- fb
    |   `-- mnt/
    `-- fa

6 directories, 5 files
$ cp -a a a/b/mnt/
cp: cannot copy a directory, `a', into itself, `a/b/mnt/a'
$ tree -aF .
.
`-- a/
    |-- b/
    |   |-- c/
    |   |   |-- d/
    |   |   |   |-- e/
    |   |   |   |   `-- fe
    |   |   |   `-- fd
    |   |   `-- fc
    |   |-- fb
    |   `-- mnt/
    |       `-- a/
    |           `-- b/
    |               |-- c/
    |               |   |-- d/
    |               |   |   |-- e/
    |               |   |   |   `-- fe
    |               |   |   `-- fd
    |               |   `-- fc
    |               |-- fb
    |               `-- mnt/
    `-- fa

12 directories, 9 files
$
========
For full-os trees, can be messy and error-prone to patch-up what's missing 
and/or to verify that all is now ok.


> You will want to clean the virtual file systems in any case.  You could 
> also do:  'tar -c --one-file-system - | tar -x -C <mount point>' which 
> will avoid the virtual file system problem (but the virtual file systems 
> mount points need to be created).
>
> If you boot to a 3rd system and do not have the virtual file systems 
> mounted, you can just do:
>
> $ sudo cp -a /mnt/lfs  mnt/lfs2
>
	.
	.
>



rgds,
akhiezer





--



More information about the blfs-support mailing list