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

akhiezer lfs65 at cruziero.com
Mon Dec 23 09:00:28 PST 2013

> Date: Mon, 23 Dec 2013 07:59:22 -0600
> From: Dan McGhee <beesnees at grm.net>
> To: BLFS Support List <blfs-support at linuxfromscratch.org>
> Subject: Re: [blfs-support] Complete Backup of {,B}LFS
> I am always quite interested in what one word or phrase means to 
> different people. [...]

 - yes, this cropped up in aforenoted earlier thread ... (and indeed muchly 
on mailing-lists).

> When I said "clone" I didn't think about the partition size, where the 
> info was located or the metadata. However, my main concern was 
> preservation of ownership, group and permissions. But with the remarks 
> in this thread, I want the times preserved now--I've used them before in 
> "find" for the tests --newer and !--newer.
> I completed the backup, but now want to do it again to insure all of 
> this. I used <cp -a> the last time because of permissions. The reason I 
> didn't use the find|cpio combination was that ownersip wasn't preserved. 

Did you do the find/cpio as root? As root, you get owner/group/perms/&c all 
preserved ((it would be *nuts* not to be able to)).

> I read the cpio info and saw this--
> > |--no-preserve-owner|
> >     Do not change the ownership of the files; leave them owned by the
> >     user extracting them.
> >
> To me that phrase "leave them owned...." says that the files will be 
> owned by me when I'm done and seems to contradict the first part of the 
> sentence which is what I wanted to have happen.
> If I use "--no-preserve-owner" will the ownership, group and permissions 
> remain as they are, or do they get changed?

For what you want to do, as described, and as understood from here: do the 
find/cpio operation as root. Punkt.

If you're trying to do such stuff as non-root, then you'll encounter issues 
like not being able to access some source-tree objects, or not being able 
to reset access-timestamps back to their original values, &usw.

To address the '--no-preserve-owner' thing more-directly: it's really 
intended to allow users to extract files/&c with user/group set to themselves 
- just like with tar. Probly best if you experiment a little (if not already) 
and of course *carefully* (esp. re tgt-dir) - e.g. compare'n'contrast the 
results from doing following as root then as non-root, each time trying out 
with '--no-preserve-owner' and then without '--no-preserve-owner':

$ mkdir /tmp/tmptst	# Then put some dirs/files in there, and change 
                        # some perms/owns values.
$ mkdir ./tstmnt
$ find /tmp/tmptst -xdev -depth -print0 | \
   cpio -0pdam -v  [--no-preserve-owner] ./tstmnt/
$ mv -i ./tstmnt ./tstmnt.${ROOT_OR_NOT}.${PRESERVE_OWNS_OR_NOT}

This is the sort of thing that one should aim to be comfortable trying out.


> Dan


More information about the blfs-support mailing list