Which is the right way to issue a tar command when you restore your system

grigory

Member
Jan 31, 2016
41
0
66
Hello!

I've recently created a tarball backup of my Ubuntu system (/ and /home partitions both ext4).
When I was creating a backup I booted off Live DVD and I used a tar command.
Now I wonder which would be the best way to untar the gzipped archive in order to restore the system. More specifically, if I should add --numeric-owner switch at the end of the tar command? I heard that it might be needed to preserve an original ownership permissions. Otherwise, I would get those from a storage media and there could be a mismatch.
On the other hand, both times I use Live DVD to boot from, so maybe it's irrelevant in my particular case? Please let me know. Thanks!
 

replica9000

Member
Dec 20, 2014
74
0
0
This is the command I've used to backup my system with tar
Code:
tar --one-file-system -cvpzSf /path/to/tar.gz /

c = create
v = verbose
p = keep permissions
z = gzip archive | j = bz2 | J = xz
S = handle sparce files
f = file name of archive


And the command I've used to restore
Code:
tar -xvpzf /path/to/tar.gz -C /

x = extract archive
-C = specify target directory
 

grigory

Member
Jan 31, 2016
41
0
66
Thanks for your reply!

I see... And how your system restored in the end? Everything works fine after the restoration?
 

replica9000

Member
Dec 20, 2014
74
0
0
Usually. Don't think I've any major issues doing it this way. Are you staying on the same hardware?