3

UPDATE: I discovered that I could view/extract with the original permissions using the "--numeric-owner" flag on GNU Tar. However, I'd still like to understand exactly what tar is doing here, as it's not clear to me, especially since the "33" user does indeed exist on the Ubuntu 16.04 system.


I have an embedded system running BusyBox v1.01 (2010.02.12-18:03+0000) Built-in shell (ash).

I noticed that when I create a tarball (specifically a gzip'd tarball, tgz), that the ownership of the files do not seem to agree between the embedded system and my Ubuntu 16.04 system (running GNU tar 1.28).

Busy Box System:

# touch my_file
# chown 33:0 my_file
# tar -zcvf /mnt/usb/myfile.tgz my_file
# tar -ztvf /mnt/usb/myfile.tgz
-rw-r--r-- 33/0        12 1970-03-18 21:21:39 my_file

As you can see, when I look at the file again in BusyBox (and indeed, extract it), it has 33/0 ownership.

But when I look at the identical file in Ubuntu 16.04, it shows as having root/root ownership:

Ubuntu 16.04:

# tar -tvf myfile.tgz
-rw-r--r-- root/root        12 1970-03-18 17:21 my_file

Of course, if I extract the file as root, it's owned by root/root, instead of 33/root as I would expect (man page says --same-owner is default when extracting as root).

I've never seen behavior like this in tar before...why is the ownership not preserved when I view the file in Ubuntu?

Also, is there any way to extract the file in Ubuntu, while keeping the original 33/0 permissions from the BusyBox system?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.