1

I have a strange problem with tar gz compression.

I used to have SD card mounted as a fat32 partition. However, now I changed it so that external sdcard is being mounted under /data/media/0 and is formatted to ext4 (or f2fs - makes no difference, because this error happens on either).

In the old setup, I could run

tar cvzf

on a folder in this partition without any issue.

However, in this new setup if I run it, I get

tar cvzf
Segmentation fault.

I discovered, that if I remove the z parameter, it proceeds just fine. But he resulting tar file is not gz-compressed and hence unfit to my applications.

I confirmed this behaviour on two different ROMs so far: CarbonRom JB 4.3.1 and CarbonRom KK 4.4.4.

Does anyone have any idea what could be amiss here? Is android unable to tar.gz files on non-fat32 partitions, or is it cause by some other problem?

2
  • Where is your tar binary from? Likely the zlib library wasn't compiled in properly or is missing.
    – Dan Hulme
    Commented Nov 4, 2014 at 9:00
  • 1
    From the rom itself. As I said, the command TAR works just fine when used on a folder on a fat32 partition mounted under /storage/sdcard1. The very same TAR binary and system exhibits this issue when trying to do the exact same operation on the ext4 partition mounted at /data/media/0.
    – lockheed
    Commented Nov 5, 2014 at 9:00

1 Answer 1

1

I still have no idea what is causing the problem, but I did find a solution / workaround, which does the same thing.

Instead of directly calling gzip from tar like so:

tar cvzf

I pipe tar's output to gzip like so:

tar -cv directory/ | gzip > archive.tar.gz

and the segmentation fault is no more.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .