[pve-devel] tar option sparse broken on nfs

Dietmar Maurer dietmar at proxmox.com
Tue Oct 1 06:53:33 CEST 2013


Option --sparse produces files filled with zeroes when source is on NFS (instead of real content).

see: https://bugzilla.proxmox.com/show_bug.cgi?id=462

The following script shows the bug:

------------------start test script------------------
#!/bin/sh

set -e

# Note: to reproduce the bug. make sure TESTDIR is on NFS
TESTDIR=$(pwd)/testdir

rm -rf ${TESTDIR}
mkdir -p ${TESTDIR}/src
mkdir -p ${TESTDIR}/dst

echo "A SIMPLE TEST FILE" > ${TESTDIR}/src/file1

tar -C ${TESTDIR}/src --sparse -cpf ${TESTDIR}/sparse.tar .
tar -C ${TESTDIR}/dst -xf ${TESTDIR}/sparse.tar

# this fails, because dst/file1 is filled with 0
cmp ${TESTDIR}/src/file1 ${TESTDIR}/dst/file1
------------------end test script------------------

This is releated to the pve kernel, because it works if I use the standard debian kernel.

Any hints or ideas?




More information about the pve-devel mailing list