Ticket #2715 (new enhancement)
Copy issue with sparse files
Reported by: | BzF | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Future Releases |
Component: | mc-core | Version: | 4.8.1 |
Keywords: | Cc: | andrey.gursky@… | |
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
If I copy sparse file (created with:
dd if=/dev/zero of=01-sparse.img bs=1 count=0 seek=1M
) using mc built-in copy (F5) then it creates file with allocated size (02-sparse-mc4.8.1.img)
If I use cp (cp 01-sparse.img 03-sparse-cp.img) it keeps the size unallocated:
$ ls -al 01-sparse.img 02-sparse-mc4.8.1.img 03-sparse-cp.img
-rw-r--r-- 1 boris boris 1048576 2012-01-17 23:02 01-sparse.img
-rw-r--r-- 1 boris boris 1048576 2012-01-17 23:02 02-sparse-mc4.8.1.img
-rw-r--r-- 1 boris boris 1048576 2012-01-17 23:03 03-sparse-cp.img
but
$ ls -1 -s 01-sparse.img 02-sparse-mc4.8.1.img 03-sparse-cp.img
0 01-sparse.img
1024 02-sparse-mc4.8.1.img
0 03-sparse-cp.img
Change History
comment:1 Changed 13 years ago by andrew_b
- Type changed from defect to enhancement
- Milestone changed from 4.8 to Future Releases
comment:2 Changed 10 years ago by god12
Note: the enhancement would be not only space savings but significant speed-up as well.
comment:3 Changed 10 years ago by god12
On a related note - is it possible to write an mc plugin which would replace built-in implementation of file-copy with something which actually works with sparse files, like calling external cp command for example?
comment:4 Changed 9 years ago by ag
I've fixed it. But I haven't yet found the time (and fun) to cleanup the patch, thus I can't publish it yet.