using dd with conv=sparse to punch zerosUsing DD for disk cloningCloning an LVM disk with dd?Xen P2V for large physical hosts with much free spaceHow can I split a drive image created with 'dd' into separate files for each partition?Using dd command and running out of space while cloning drive to imgcreate image of a USB drive without unallocated partitionMigrate raw disk image over LANProblems cloning a bootable diskTool for taking disk image that includes NIC driversclonehd takes 2 hours for a 100GB disk. Expected?

What was the idiom for something that we take without a doubt?

Where's this lookout in Nova Scotia?

What to do when you've set the wrong ISO for your film?

Count rotary dial pulses in a phone number (including letters)

Why did the person in charge of a principality not just declare themself king?

C++ forcing function parameter evalution order

Need to understand my home electrical meter to see why bill is so high and/or if neighbor is on same meter

Could a 19.25mm revolver actually exist?

What are these arcade games in Ghostbusters 1984?

Looking for a soft substance that doesn't dissolve underwater

Should one buy new hardware after a system compromise?

What does this symbol on the box of power supply mean?

Externally monitoring CPU/SSD activity without software access

My employer faked my resume to acquire projects

How should I introduce map drawing to my players?

Any advice on creating fictional locations in real places when writing historical fiction?

Why is this Simple Puzzle impossible to solve?

Plot twist where the antagonist wins

Is it true that cut time means "play twice as fast as written"?

Website returning plaintext password

Grammar Question Regarding "Are the" or "Is the" When Referring to Something that May or May not be Plural

Count Even Digits In Number

Sitecore 9.0 works with solr 7.2.1?

How to Pin Point Large File eating space in Fedora 18



using dd with conv=sparse to punch zeros


Using DD for disk cloningCloning an LVM disk with dd?Xen P2V for large physical hosts with much free spaceHow can I split a drive image created with 'dd' into separate files for each partition?Using dd command and running out of space while cloning drive to imgcreate image of a USB drive without unallocated partitionMigrate raw disk image over LANProblems cloning a bootable diskTool for taking disk image that includes NIC driversclonehd takes 2 hours for a 100GB disk. Expected?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am attempting to clone a disk partition to an image file using dd. I want to create the image without zeros to minimize the filesize, and on the other hand I do not want to pipe through gzip. The solution I found consists of writing zeros to a dummy file until the disk is full. The problem I am running into is this is a FAT32 filing system, so I am limited to making these dummy files 4.3GB. Tedious to say the least.



My question: If I have an already zero'd drive with a new partition table and freshly written data to the partition... would I be safe to skip the "filling the free space" step and just go right to running dd using conv=sparse? The entire drive had been zero'd out prior to partition creation, so I am confident that the free space should already be zeros.










share|improve this question






















  • This doesn't exactly answer your question, but maybe you should check out the partclone utility, which seems to "understand" FAT32. It should therefore automatically "leave out" unused space and produce a smaller image than dd.

    – Oliver
    Apr 28 '17 at 14:28











  • I'm not married to dd. It just seems to be quick and effective if used correctly. I will try partclone. I assume if its not a part of my already installed packages, I will obtain and test. Thank you for the timely response, friend!

    – Thomas A Anderson
    Apr 28 '17 at 14:31











  • ># partclone.fat32 -cs /dev/sdb1 -o /media/user0/5acf82c8-507a-479c-adac-a947fc7065d8/sdb1.fat32 done! File system: FAT32 Device size: 125.0 GB = 244197376 Blocks Space in use: 39.9 GB = 77865216 Blocks Free Space: 85.2 GB = 166332160 Blocks I see how it calculates the free space... and I assume it does not image that portion of the partition?

    – Thomas A Anderson
    Apr 28 '17 at 14:55












  • Im noticing the output shows that the total blocks matches the size of the entire partition. "current block: 40730548, total block: 244197376, Complete: 16.68%". I'm hoping it will reach the in use block count and complete. I fear that I missed a switch or argument to exclude free space.

    – Thomas A Anderson
    Apr 28 '17 at 15:07












  • I see... it is processing the entire partition and omitting the free space when it writes the image. The final file size was correct. Thank you Oliver for this wonderful solution!

    – Thomas A Anderson
    Apr 28 '17 at 15:21

















0















I am attempting to clone a disk partition to an image file using dd. I want to create the image without zeros to minimize the filesize, and on the other hand I do not want to pipe through gzip. The solution I found consists of writing zeros to a dummy file until the disk is full. The problem I am running into is this is a FAT32 filing system, so I am limited to making these dummy files 4.3GB. Tedious to say the least.



My question: If I have an already zero'd drive with a new partition table and freshly written data to the partition... would I be safe to skip the "filling the free space" step and just go right to running dd using conv=sparse? The entire drive had been zero'd out prior to partition creation, so I am confident that the free space should already be zeros.










share|improve this question






















  • This doesn't exactly answer your question, but maybe you should check out the partclone utility, which seems to "understand" FAT32. It should therefore automatically "leave out" unused space and produce a smaller image than dd.

    – Oliver
    Apr 28 '17 at 14:28











  • I'm not married to dd. It just seems to be quick and effective if used correctly. I will try partclone. I assume if its not a part of my already installed packages, I will obtain and test. Thank you for the timely response, friend!

    – Thomas A Anderson
    Apr 28 '17 at 14:31











  • ># partclone.fat32 -cs /dev/sdb1 -o /media/user0/5acf82c8-507a-479c-adac-a947fc7065d8/sdb1.fat32 done! File system: FAT32 Device size: 125.0 GB = 244197376 Blocks Space in use: 39.9 GB = 77865216 Blocks Free Space: 85.2 GB = 166332160 Blocks I see how it calculates the free space... and I assume it does not image that portion of the partition?

    – Thomas A Anderson
    Apr 28 '17 at 14:55












  • Im noticing the output shows that the total blocks matches the size of the entire partition. "current block: 40730548, total block: 244197376, Complete: 16.68%". I'm hoping it will reach the in use block count and complete. I fear that I missed a switch or argument to exclude free space.

    – Thomas A Anderson
    Apr 28 '17 at 15:07












  • I see... it is processing the entire partition and omitting the free space when it writes the image. The final file size was correct. Thank you Oliver for this wonderful solution!

    – Thomas A Anderson
    Apr 28 '17 at 15:21













0












0








0








I am attempting to clone a disk partition to an image file using dd. I want to create the image without zeros to minimize the filesize, and on the other hand I do not want to pipe through gzip. The solution I found consists of writing zeros to a dummy file until the disk is full. The problem I am running into is this is a FAT32 filing system, so I am limited to making these dummy files 4.3GB. Tedious to say the least.



My question: If I have an already zero'd drive with a new partition table and freshly written data to the partition... would I be safe to skip the "filling the free space" step and just go right to running dd using conv=sparse? The entire drive had been zero'd out prior to partition creation, so I am confident that the free space should already be zeros.










share|improve this question














I am attempting to clone a disk partition to an image file using dd. I want to create the image without zeros to minimize the filesize, and on the other hand I do not want to pipe through gzip. The solution I found consists of writing zeros to a dummy file until the disk is full. The problem I am running into is this is a FAT32 filing system, so I am limited to making these dummy files 4.3GB. Tedious to say the least.



My question: If I have an already zero'd drive with a new partition table and freshly written data to the partition... would I be safe to skip the "filling the free space" step and just go right to running dd using conv=sparse? The entire drive had been zero'd out prior to partition creation, so I am confident that the free space should already be zeros.







linux disk-image dd fat32






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 28 '17 at 14:17









Thomas A AndersonThomas A Anderson

11




11












  • This doesn't exactly answer your question, but maybe you should check out the partclone utility, which seems to "understand" FAT32. It should therefore automatically "leave out" unused space and produce a smaller image than dd.

    – Oliver
    Apr 28 '17 at 14:28











  • I'm not married to dd. It just seems to be quick and effective if used correctly. I will try partclone. I assume if its not a part of my already installed packages, I will obtain and test. Thank you for the timely response, friend!

    – Thomas A Anderson
    Apr 28 '17 at 14:31











  • ># partclone.fat32 -cs /dev/sdb1 -o /media/user0/5acf82c8-507a-479c-adac-a947fc7065d8/sdb1.fat32 done! File system: FAT32 Device size: 125.0 GB = 244197376 Blocks Space in use: 39.9 GB = 77865216 Blocks Free Space: 85.2 GB = 166332160 Blocks I see how it calculates the free space... and I assume it does not image that portion of the partition?

    – Thomas A Anderson
    Apr 28 '17 at 14:55












  • Im noticing the output shows that the total blocks matches the size of the entire partition. "current block: 40730548, total block: 244197376, Complete: 16.68%". I'm hoping it will reach the in use block count and complete. I fear that I missed a switch or argument to exclude free space.

    – Thomas A Anderson
    Apr 28 '17 at 15:07












  • I see... it is processing the entire partition and omitting the free space when it writes the image. The final file size was correct. Thank you Oliver for this wonderful solution!

    – Thomas A Anderson
    Apr 28 '17 at 15:21

















  • This doesn't exactly answer your question, but maybe you should check out the partclone utility, which seems to "understand" FAT32. It should therefore automatically "leave out" unused space and produce a smaller image than dd.

    – Oliver
    Apr 28 '17 at 14:28











  • I'm not married to dd. It just seems to be quick and effective if used correctly. I will try partclone. I assume if its not a part of my already installed packages, I will obtain and test. Thank you for the timely response, friend!

    – Thomas A Anderson
    Apr 28 '17 at 14:31











  • ># partclone.fat32 -cs /dev/sdb1 -o /media/user0/5acf82c8-507a-479c-adac-a947fc7065d8/sdb1.fat32 done! File system: FAT32 Device size: 125.0 GB = 244197376 Blocks Space in use: 39.9 GB = 77865216 Blocks Free Space: 85.2 GB = 166332160 Blocks I see how it calculates the free space... and I assume it does not image that portion of the partition?

    – Thomas A Anderson
    Apr 28 '17 at 14:55












  • Im noticing the output shows that the total blocks matches the size of the entire partition. "current block: 40730548, total block: 244197376, Complete: 16.68%". I'm hoping it will reach the in use block count and complete. I fear that I missed a switch or argument to exclude free space.

    – Thomas A Anderson
    Apr 28 '17 at 15:07












  • I see... it is processing the entire partition and omitting the free space when it writes the image. The final file size was correct. Thank you Oliver for this wonderful solution!

    – Thomas A Anderson
    Apr 28 '17 at 15:21
















This doesn't exactly answer your question, but maybe you should check out the partclone utility, which seems to "understand" FAT32. It should therefore automatically "leave out" unused space and produce a smaller image than dd.

– Oliver
Apr 28 '17 at 14:28





This doesn't exactly answer your question, but maybe you should check out the partclone utility, which seems to "understand" FAT32. It should therefore automatically "leave out" unused space and produce a smaller image than dd.

– Oliver
Apr 28 '17 at 14:28













I'm not married to dd. It just seems to be quick and effective if used correctly. I will try partclone. I assume if its not a part of my already installed packages, I will obtain and test. Thank you for the timely response, friend!

– Thomas A Anderson
Apr 28 '17 at 14:31





I'm not married to dd. It just seems to be quick and effective if used correctly. I will try partclone. I assume if its not a part of my already installed packages, I will obtain and test. Thank you for the timely response, friend!

– Thomas A Anderson
Apr 28 '17 at 14:31













># partclone.fat32 -cs /dev/sdb1 -o /media/user0/5acf82c8-507a-479c-adac-a947fc7065d8/sdb1.fat32 done! File system: FAT32 Device size: 125.0 GB = 244197376 Blocks Space in use: 39.9 GB = 77865216 Blocks Free Space: 85.2 GB = 166332160 Blocks I see how it calculates the free space... and I assume it does not image that portion of the partition?

– Thomas A Anderson
Apr 28 '17 at 14:55






># partclone.fat32 -cs /dev/sdb1 -o /media/user0/5acf82c8-507a-479c-adac-a947fc7065d8/sdb1.fat32 done! File system: FAT32 Device size: 125.0 GB = 244197376 Blocks Space in use: 39.9 GB = 77865216 Blocks Free Space: 85.2 GB = 166332160 Blocks I see how it calculates the free space... and I assume it does not image that portion of the partition?

– Thomas A Anderson
Apr 28 '17 at 14:55














Im noticing the output shows that the total blocks matches the size of the entire partition. "current block: 40730548, total block: 244197376, Complete: 16.68%". I'm hoping it will reach the in use block count and complete. I fear that I missed a switch or argument to exclude free space.

– Thomas A Anderson
Apr 28 '17 at 15:07






Im noticing the output shows that the total blocks matches the size of the entire partition. "current block: 40730548, total block: 244197376, Complete: 16.68%". I'm hoping it will reach the in use block count and complete. I fear that I missed a switch or argument to exclude free space.

– Thomas A Anderson
Apr 28 '17 at 15:07














I see... it is processing the entire partition and omitting the free space when it writes the image. The final file size was correct. Thank you Oliver for this wonderful solution!

– Thomas A Anderson
Apr 28 '17 at 15:21





I see... it is processing the entire partition and omitting the free space when it writes the image. The final file size was correct. Thank you Oliver for this wonderful solution!

– Thomas A Anderson
Apr 28 '17 at 15:21










1 Answer
1






active

oldest

votes


















0














Rather than trying to will unused space with zeroes, you could check out the partclone utility. This tool understands the FAT32 format (among others) and will automatically leave out unused space so your dump will be much smaller than if you do it with dd.






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f847164%2fusing-dd-with-conv-sparse-to-punch-zeros%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Rather than trying to will unused space with zeroes, you could check out the partclone utility. This tool understands the FAT32 format (among others) and will automatically leave out unused space so your dump will be much smaller than if you do it with dd.






    share|improve this answer



























      0














      Rather than trying to will unused space with zeroes, you could check out the partclone utility. This tool understands the FAT32 format (among others) and will automatically leave out unused space so your dump will be much smaller than if you do it with dd.






      share|improve this answer

























        0












        0








        0







        Rather than trying to will unused space with zeroes, you could check out the partclone utility. This tool understands the FAT32 format (among others) and will automatically leave out unused space so your dump will be much smaller than if you do it with dd.






        share|improve this answer













        Rather than trying to will unused space with zeroes, you could check out the partclone utility. This tool understands the FAT32 format (among others) and will automatically leave out unused space so your dump will be much smaller than if you do it with dd.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 28 '17 at 15:33









        OliverOliver

        5,3201929




        5,3201929



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f847164%2fusing-dd-with-conv-sparse-to-punch-zeros%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

            What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

            Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos