pax command and sparse files

Fbsd8 fbsd8 at a1poweruser.com
Sat Jan 12 15:52:32 UTC 2013


I have a sparse file allocated to 1G
ls -lh test.img   shows 1.0G
du -h  test.img   shows 5.9M

This is what I was expecting.

Now after pax on that single test.img file

ls -lh test.img.tar.gz   shows 1.4M
du -h  test.img.tar.gz   shows 1.4M

This is what I was expecting.

Here is the problem:
Running pax on a native directory tree takes 2 seconds to archive it.
I put that same directory tree into a sparse file
and now pax takes 35 seconds to archive it.

The resulting archive file is good and restores correctlly.

Why does pax take so long to archive a sparse file?




More information about the freebsd-questions mailing list