0
I created a sparse file with
truncate -s 4T image.img
on an ext4 file system which I mount over NFS. The following test shows that the system has trouble with the recognition of sparse files: both
cp --sparse=always /mnt/data_extension/a.img /tmp/a.img # where a.img is created the same way image.img is
rsync --sparse /mnt/data_extension/a.img /tmp/a.img
take a long time and I never let it finish as taking more than a second for the command shows that the sparse file isnt't recognized as such and copying/moving holes consumes I/O which shouldn't be the case.
tar --sparse -c -v -f /tmp/a.tar /mnt/data_extension/a.img
returns immediately and produces a tar which can be untared if a.img is empty, if I write something inside (e.g. create a bogus btrfs file system with sudo mkfs.btrfs /mnt/data_extension/a.img
), it stops working, i.e. takes forever like the commands above.
Everything works well on the local target ext4 file system, i.e copying and moving the demo image a.img
happens in 1 second or much less.
When I apply the above commands to the actual image image.img
and watch du -h /local/image.img
the size of 0 is never updated, but it should after the first byte has been written.
mount information for /mnt/data_extension
:
$ mount | grep /mnt/data_extension
192.168.178.76:/volume1/data_extension on /mnt/data_extension type nfs (rw,addr=192.168.178.76)
How can I move/copy image.img
from the NFS mount to a local filesystem without the necessity to read 4TB?!
EDIT: specifying sparse-version=1.0
makes tar
work on client, but not over NFS (and cifs
which I tried meanwhile with the same behavior). This allows at least to tar the sparse file on server and transfer the result with the cost of one unnecessary untar action on client.