On 2025-02-12 12:08, Corinna Vinschen via Cygwin wrote:
On Feb 12 10:54, Brian Inglis via Cygwin wrote:
On 2025-02-12 10:30, Corinna Vinschen via Cygwin wrote:
On Feb 12 17:32, Cedric Blancher via Cygwin wrote:
Checklist:
- Volume has FILE_SUPPORTS_SPARSE_FILES
- Cygwin mount has "sparse" option (mount Y: -o sparse,exec /cygdrive/y)
- source file has FILE_ATTRIBUTE_SPARSE_FILE set

But  cp --sparse=auto ... or any other combination of --sparse does
copy holes, i.e. turns 500GB of hole into 500GB of data (zero bytes).

echo "hello sparse file\n" >testcase17_sparse_begins_with_data && dd
if=/dev/null of=testcase17_sparse_begins_with_data oflag=append bs=1
count=1 seek=$((65536*512)) && echo "endoffile"
testcase17_sparse_begins_with_data

Works for me:

$ uname -r
3.6.0-0.362.g68c13dc92f65.x86_64

$ pwd
/home/corinna/tmp

$ mount | grep tmp
C:/cygwin64/home/corinna/tmp on /home/corinna/tmp type ntfs 
(binary,sparse,user,bind)

$ echo "hello sparse file\n" >testcase17_sparse_begins_with_data && dd if=/dev/null 
of=testcase17_sparse_begins_with_data oflag=append bs=1 count=1 seek=$((65536*512)) && echo "endoffile" 
>>testcase17_sparse_begins_with_data

$ ls -gGsh testcase17*
128K -rw----r--+ 1 33M Feb 12 18:22 testcase17_sparse_begins_with_data

$ cp --sparse=auto testcase17_sparse_begins_with_data 
testcase17_sparse_begins_with_data.copy

$ ls -gGsh testcase17*
128K -rw----r--+ 1 33M Feb 12 18:22 testcase17_sparse_begins_with_data
128K -rw----r--+ 1 33M Feb 12 18:23 testcase17_sparse_begins_with_data.copy

Hi Corinna,

Did you test using coreutils current stable 9.0, test 9.5, or both?

Tested with 9.0.

I just installed 9.5 and the result after cp --sparse=auto is the same:

$ cp --version | head -1
cp (GNU coreutils) 9.5
$ rm testcase17_sparse_begins_with_data.copy
$ cp --sparse=auto testcase17_sparse_begins_with_data 
testcase17_sparse_begins_with_data.copy
$ ls -gGsh testcase17*
128K -rw----r--+ 1 33M Feb 12 18:22 testcase17_sparse_begins_with_data
128K -rw----r--+ 1 33M Feb 12 20:01 testcase17_sparse_begins_with_data.copy

Thanks for testing and reporting results.

The build tests lead me to think that sparse files were not supported, so I need to figure out a way to add a sparse mount which works at home and on scallywag - used ${DISTDIR:-/var/cache}/ in another package so could add tmp to that, mkdir then mount -o ... `cygpath -m .../tmp` .../tmp - are any other commands required for setup other than mount?

--
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher  but when there is no more to cut
                                -- Antoine de Saint-Exupéry

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to