[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [dd] conv=sparse option
From: |
Jim Meyering |
Subject: |
Re: [dd] conv=sparse option |
Date: |
Sun, 30 Dec 2007 09:21:14 +0100 |
Samuel Thibault <address@hidden> wrote:
> Some time ago, I wrote a conv=sparse option for dd, attached is the
> patch. The goal is to recreate a sparse file from a file with 0s.
> Typically, I use it to do this:
>
> # mount /dev/hda6 /mnt/mnt
> # dd bs=1M < /dev/zero > /mnt/mnt/foo
> # rm -f /mnt/mnt/foo
> # umount /mnt/mnt
> # dd bs=1M conv=sparse < /dev/hda6 > /mnt/savhda6
>
> Which creates a sparse file out of my not-so-filled partition. Of
> course, there may be other uses: re-sparsing a qemu image before tarring
> it for public download, etc.
>
> Maybe it could be useful to apply it mainstream?
Hi Samuel,
I like the idea.
Are you willing to do more work on it and assign copyright to the FSF?
E.g.,
- update the texinfo documentation, including an example like the above
- add tests to exercise the new functionality
Some superficial comments on the patch:
- any new globals must have file-"static" scope
- use xcalloc, not calloc
- use ST_BLKSIZE, not stat.st_blksize
- update dd's --help output
- use the same indentation/formatting style as in the rest of the code
- make your changes relative to the latest sources from git:
i.e., do this to get the latest sources:
git clone git://git.sv.gnu.org/coreutils