You can use cp –sparse=WHEN control copy a sparse file. By default cp supports sparse file copy but the source file system should support sperse file. The cp –sparse=always is useful when source does not support sperse files but has long sequence of zero in it and the target file system supports sperse files.
1 2 3 4 5 6 |
## Create a sparse file dd if=/dev/zero of=myfile1 bs=1 count=0 seek=10M cp --sparse=never myfile1 myfile2 ## copy the sparse file ls -lhs myfile1 myfile2 rm my* |