Restoring from a tarball

Ian Malone ibmalone at gmail.com
Tue Oct 18 20:18:06 UTC 2011


On 18 October 2011 19:59, Todd Zullinger <tmz at pobox.com> wrote:
> Frank Cox wrote:
>> The problem you're going to run into is the initial / that you used
>> before home/marcia when you created the tarball.  Tar won't restore
>> the initial / so when you extract the files they will end up in
>> home/marcia under whatever directory you're currently in at that
>> time.
>>
>> The easiest solution is to extract the tarball and move (with the mv
>> command) the marcia directory into /home on completion.
>
> Or use the --absolute-names (-P) option to tar.  That's for "don’t
> strip leading ‘/’s from file names."
>

Yes by default it will have stripped them on archiving. Since they
were archived with the full path otherwise you can using -C / will get
the original full path back:
tar xf marcia.tar.bz2 -C /
Do this as user 'marcia' and you should be okay for UIDs on extraction
(it will also prevent it accidentally extracting somewhere else on the
filesystem). Group IDs if there are any particular ones will need to
be created on the new system and marcia added to them.

-- 
imalone


More information about the users mailing list