Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Short answer:</strong> Use <code>bsdtar</code> to create archives, and GNU <code>tar</code> to extract them on another box.</p> <p><strong>Long answer:</strong> There are some requirements for this to work.</p> <p>First, Linux must be at least kernel 3.1 (Ubuntu 12.04 or later would do), so it supports SEEK_HOLE functionality.</p> <p>Then, you need tar utility that can support this syscall. At the moment, GNU <code>tar</code> does not support it, but <code>bsdtar</code> does - install it using <code>sudo apt-get install bsdtar</code>.</p> <p>While <code>bsdtar</code> (which uses <code>libarchive</code>) is awesome, unfortunately, it is not very smart when it comes to untarring - it stupidly requires to have at least as much free space on target drive as untarred file size, without regard to holes. GNU <code>tar</code> will untar such sparse archives efficiently and will not check this condition.</p> <p>This is log from Ubuntu 12.10 (Linux kernel 3.5):</p> <pre><code>$ dd if=/dev/zero of=1tb seek=1T bs=1 count=1 1+0 records in 1+0 records out 1 byte (1 B) copied, 0.000143113 s, 7.0 kB/s $ time bsdtar cvfz sparse.tar.gz 1tb a 1tb real 0m0.362s user 0m0.336s sys 0m0.020s $ ls -l total 8 -rw-rw-r-- 1 autouser autouser 1099511627777 Nov 7 01:43 1tb -rw-rw-r-- 1 autouser autouser 257 Nov 7 01:43 sparse.tar.gz $ </code></pre> <p>Like I said above, unfortunately, untarring with <code>bsdtar</code> will not work unless you have 1TB free space. However, GNU tar works just fine to untar such <code>sparse.tar</code>:</p> <pre><code>$ rm 1tb $ time tar -xvSf sparse.tar.gz 1tb real 0m0.031s user 0m0.016s sys 0m0.016s $ ls -l total 8 -rw-rw-r-- 1 autouser autouser 1099511627777 Nov 7 01:43 1tb -rw-rw-r-- 1 autouser autouser 257 Nov 7 01:43 sparse.tar.gz </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload