Ticket #2715 (new enhancement)

Opened 13 years ago

Last modified 6 years ago

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.

comment:5 Changed 9 years ago by ag

  • Cc andrey.gursky@… added

comment:6 Changed 7 years ago by andrew_b

Ticket #3849 has been marked as a duplicate of this ticket.

comment:7 Changed 6 years ago by TerraNova

Are there any updates for copy/move sparse file handling? I ran into this tonight moving around some qcow2 images.

Note: See TracTickets for help on using tickets.