[arch-general] A question about using tar... ( -p & --numeric-owner)

Joe(theWordy)Philbrook jtwdyp at ttlc.net
Fri Jul 23 11:24:39 EDT 2010


I'm a multi-linux-distro/multi-boot guy. I always have more than one 
configured linux distro on my grub menu. Whenever I'm considering radical 
changes to one of my working linux I like to back it up. Quite some time 
ago I learned to do this with tar. For example I've got both Arch Linux 
and Xubuntu on this desktop pc. I've decided to attempt using a network 
upgrade process to upgrade the Xubuntu from Karmic to the current Lucid 
release. So first I boot Arch, mount a storage drive on /mnt/other, & mount 
the Xubuntu partition on /mnt/xubuntu. 
Then cd to /mnt/xubuntu. (with a root shell of course)

# tar -czf /mnt/other/xubuntu.tgz -p --numeric-owner .

And of course if it's necessary I can restore the backup to an empty
partition with:

# tar -xzf /mnt/other/xubuntu.tgz -p --numeric-owner .

But I only partially understand the -p and --numeric-owner options.
I do know that -p is supposed to be default for root but I like to make
sure... I think I understand that the reason somebody told me (quite some
time ago) to use --numeric-owner is because (in this example) Arch may have
different user id numbers than Xubuntu which could have bad results if it
tried to apply permissions based on user names (especially if it involves a
"system account")...

What I don't know is if either of these options are necessary during the
"tar -czf" operation, or if I only need to bother with them when/if I
restore a file system with "tar -xzf" ???

I know it does work the way I expect it to when I use the options for both
the "-czf" & the "-xzf" operations. And that I don't get any error messages
from tar when I do it that way. But I don't know if using them for the "-czf"
operation makes any difference or not.

Would someone be so kind as to set me straight on this???

-- 
|  ~^~   ~^~
|  <?>   <?>       Joe (theWordy) Philbrook
|      ^                J(tWdy)P
|    \___/         <<jtwdyp at ttlc.net>>



More information about the arch-general mailing list