dd: write to multiple disks?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
16
down vote

favorite
5












I have 2 exactly same formatted, same size and same brand SD-cards.
I would like to dd image to /dev/disk2 and to /dev/disk3 at the same time.

Pseudocode



sudo dd bs=1m if=/Users/masi/2016-05-10-raspbian-jessie.img of=/dev/disk2,/dev/disk3



How can you dd from one input to many output SDs?










share|improve this question























  • What's the goal here? Performance? If yes remember the data you read will be cached. So the 2nd dd will you data from your bcache instead of reading (of course you need some free RAM).
    – KWubbufetowicz
    May 20 '16 at 15:42






  • 2




    My simplistic test with GNU coreutils dd ... of=one of=two did not produce two outputs. May need two dd commands. I don't see wording in posix for dd to allow for multiple of's.
    – Jeff Schaller
    May 20 '16 at 15:46










  • @KWubbufetowicz I have 8GB RAM. Possible to get 32GB. Speed is my goal because I have 5 SDs.
    – Léo Léopold Hertz 준영
    May 20 '16 at 15:53















up vote
16
down vote

favorite
5












I have 2 exactly same formatted, same size and same brand SD-cards.
I would like to dd image to /dev/disk2 and to /dev/disk3 at the same time.

Pseudocode



sudo dd bs=1m if=/Users/masi/2016-05-10-raspbian-jessie.img of=/dev/disk2,/dev/disk3



How can you dd from one input to many output SDs?










share|improve this question























  • What's the goal here? Performance? If yes remember the data you read will be cached. So the 2nd dd will you data from your bcache instead of reading (of course you need some free RAM).
    – KWubbufetowicz
    May 20 '16 at 15:42






  • 2




    My simplistic test with GNU coreutils dd ... of=one of=two did not produce two outputs. May need two dd commands. I don't see wording in posix for dd to allow for multiple of's.
    – Jeff Schaller
    May 20 '16 at 15:46










  • @KWubbufetowicz I have 8GB RAM. Possible to get 32GB. Speed is my goal because I have 5 SDs.
    – Léo Léopold Hertz 준영
    May 20 '16 at 15:53













up vote
16
down vote

favorite
5









up vote
16
down vote

favorite
5






5





I have 2 exactly same formatted, same size and same brand SD-cards.
I would like to dd image to /dev/disk2 and to /dev/disk3 at the same time.

Pseudocode



sudo dd bs=1m if=/Users/masi/2016-05-10-raspbian-jessie.img of=/dev/disk2,/dev/disk3



How can you dd from one input to many output SDs?










share|improve this question















I have 2 exactly same formatted, same size and same brand SD-cards.
I would like to dd image to /dev/disk2 and to /dev/disk3 at the same time.

Pseudocode



sudo dd bs=1m if=/Users/masi/2016-05-10-raspbian-jessie.img of=/dev/disk2,/dev/disk3



How can you dd from one input to many output SDs?







files dd output






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 20 '16 at 16:21









don_crissti

48.4k15129158




48.4k15129158










asked May 20 '16 at 15:22









Léo Léopold Hertz 준영

9731144108




9731144108











  • What's the goal here? Performance? If yes remember the data you read will be cached. So the 2nd dd will you data from your bcache instead of reading (of course you need some free RAM).
    – KWubbufetowicz
    May 20 '16 at 15:42






  • 2




    My simplistic test with GNU coreutils dd ... of=one of=two did not produce two outputs. May need two dd commands. I don't see wording in posix for dd to allow for multiple of's.
    – Jeff Schaller
    May 20 '16 at 15:46










  • @KWubbufetowicz I have 8GB RAM. Possible to get 32GB. Speed is my goal because I have 5 SDs.
    – Léo Léopold Hertz 준영
    May 20 '16 at 15:53

















  • What's the goal here? Performance? If yes remember the data you read will be cached. So the 2nd dd will you data from your bcache instead of reading (of course you need some free RAM).
    – KWubbufetowicz
    May 20 '16 at 15:42






  • 2




    My simplistic test with GNU coreutils dd ... of=one of=two did not produce two outputs. May need two dd commands. I don't see wording in posix for dd to allow for multiple of's.
    – Jeff Schaller
    May 20 '16 at 15:46










  • @KWubbufetowicz I have 8GB RAM. Possible to get 32GB. Speed is my goal because I have 5 SDs.
    – Léo Léopold Hertz 준영
    May 20 '16 at 15:53
















What's the goal here? Performance? If yes remember the data you read will be cached. So the 2nd dd will you data from your bcache instead of reading (of course you need some free RAM).
– KWubbufetowicz
May 20 '16 at 15:42




What's the goal here? Performance? If yes remember the data you read will be cached. So the 2nd dd will you data from your bcache instead of reading (of course you need some free RAM).
– KWubbufetowicz
May 20 '16 at 15:42




2




2




My simplistic test with GNU coreutils dd ... of=one of=two did not produce two outputs. May need two dd commands. I don't see wording in posix for dd to allow for multiple of's.
– Jeff Schaller
May 20 '16 at 15:46




My simplistic test with GNU coreutils dd ... of=one of=two did not produce two outputs. May need two dd commands. I don't see wording in posix for dd to allow for multiple of's.
– Jeff Schaller
May 20 '16 at 15:46












@KWubbufetowicz I have 8GB RAM. Possible to get 32GB. Speed is my goal because I have 5 SDs.
– Léo Léopold Hertz 준영
May 20 '16 at 15:53





@KWubbufetowicz I have 8GB RAM. Possible to get 32GB. Speed is my goal because I have 5 SDs.
– Léo Léopold Hertz 준영
May 20 '16 at 15:53











3 Answers
3






active

oldest

votes

















up vote
19
down vote



accepted











  1. Borrowing from don_crissti's answer using tee, but without
    dd or bashisms:



    sudo tee /dev/disk2 /dev/disk3 > /dev/disk4 < masi.img



  2. Using pee from Debian's moreutils package:



    sudo dd if=masi.img | 
    pee "dd of=/dev/disk2" "dd of=/dev/disk3" "dd of=/dev/disk4"


    With bash, ksh, or zsh, that can be abbreviated to:



    sudo dd if=masi.img | pee "dd of=/dev/disk"2..4


    Or even, (if there's no need for dd's useful functions):



    sudo pee "dd of=/dev/disk"2..4 < masi.img


    pee is useful; one may, if required, include, (within each quoted argument), additional distinct dd options, and even other pipes and filters, individually tailored to each output device.



With either method the number of output disks can be extended indefinitely.






share|improve this answer


















  • 1




    Using dd for this isn't necessary. A lot of people believe it's necessary because its usage, specific to copying to or from disk images, is "fossilized" in tutorials written back in the 90s and copied by people who didn't know why. It was used back then to work around a glitch in cp.
    – Random832
    May 20 '16 at 17:26










  • @Random832 It is necessary because it is more stable than cp. Try many formats and different allocation sizes. I have not found enough stable cp for the work. Please, correct me as an answer here if you can argumentate how cp is enough stable.
    – Léo Léopold Hertz 준영
    May 20 '16 at 17:48











  • @Masi It is rarely necessary to explicitly select a format (what do you even mean by "format") and allocation size (you mean the block size?) for the common purpose of writing a disk image to a disk or reading a disk into a disk image. The reason dd became commonly used for this purpose was because of a bug in cp (GNU cp on Linux specifically) in the early 90s that caused it to skip copying blocks that were all-zero-bytes.
    – Random832
    May 20 '16 at 18:23







  • 7




    Bug in cp in the 90s? dd is 20 years older than that. The main reason for using dd was that many devices, especially tape drives, needed to be read/written in fixed block sizes, which is why dd has bs, ibs and obs parameters, and it was the only program that could ensure correct block sizes.
    – Guntram Blohm
    May 20 '16 at 18:57






  • 1




    @Gilles, here tee is indeed preferable to pee, (but dcfldd is best). Still, pee is useful; one may, if required, include, (within each quoted argument), additional 'dd' options, and even other pipes and filters, individually tailored to each output device.
    – agc
    May 21 '16 at 3:49


















up vote
18
down vote













You could try dcfldd

It's an enhanced version of gnu dd and it can output to multiple files or disks at the same time:



dcfldd if=masi.img of=/dev/disk2 of=/dev/disk3 of=/dev/disk4





share|improve this answer






















  • Can you explain your first command. Why pipe only before the last dd? How does the location of the pipe change with four dd?
    – Léo Léopold Hertz 준영
    May 20 '16 at 16:24






  • 3




    dcfldd is the fastest, maybe that should be the first choice.
    – agc
    May 20 '16 at 16:29

















up vote
3
down vote













Also this is possible with tee and process substitution:



dd if=/dev/sda | tee >(dd of=/dev/sdb) >(dd of=/dev/sdc) | dd of=/dev/sdd






share|improve this answer




















  • Can you explain process substitute? How is your answer different from agc's one?
    – Léo Léopold Hertz 준영
    Dec 22 '17 at 20:46










  • yeah sure: process substitution is used when you need to pipe the stdout of one command to multiple commands. Using a simple pipe will let you pipe to just one command. My answer is achieving the same result as agc's, but in a different way :) Also I never used pee before, as I have the tee command on my system.
    – chevallier
    Dec 22 '17 at 21:44











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f284480%2fdd-write-to-multiple-disks%23new-answer', 'question_page');

);

Post as a guest






























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
19
down vote



accepted











  1. Borrowing from don_crissti's answer using tee, but without
    dd or bashisms:



    sudo tee /dev/disk2 /dev/disk3 > /dev/disk4 < masi.img



  2. Using pee from Debian's moreutils package:



    sudo dd if=masi.img | 
    pee "dd of=/dev/disk2" "dd of=/dev/disk3" "dd of=/dev/disk4"


    With bash, ksh, or zsh, that can be abbreviated to:



    sudo dd if=masi.img | pee "dd of=/dev/disk"2..4


    Or even, (if there's no need for dd's useful functions):



    sudo pee "dd of=/dev/disk"2..4 < masi.img


    pee is useful; one may, if required, include, (within each quoted argument), additional distinct dd options, and even other pipes and filters, individually tailored to each output device.



With either method the number of output disks can be extended indefinitely.






share|improve this answer


















  • 1




    Using dd for this isn't necessary. A lot of people believe it's necessary because its usage, specific to copying to or from disk images, is "fossilized" in tutorials written back in the 90s and copied by people who didn't know why. It was used back then to work around a glitch in cp.
    – Random832
    May 20 '16 at 17:26










  • @Random832 It is necessary because it is more stable than cp. Try many formats and different allocation sizes. I have not found enough stable cp for the work. Please, correct me as an answer here if you can argumentate how cp is enough stable.
    – Léo Léopold Hertz 준영
    May 20 '16 at 17:48











  • @Masi It is rarely necessary to explicitly select a format (what do you even mean by "format") and allocation size (you mean the block size?) for the common purpose of writing a disk image to a disk or reading a disk into a disk image. The reason dd became commonly used for this purpose was because of a bug in cp (GNU cp on Linux specifically) in the early 90s that caused it to skip copying blocks that were all-zero-bytes.
    – Random832
    May 20 '16 at 18:23







  • 7




    Bug in cp in the 90s? dd is 20 years older than that. The main reason for using dd was that many devices, especially tape drives, needed to be read/written in fixed block sizes, which is why dd has bs, ibs and obs parameters, and it was the only program that could ensure correct block sizes.
    – Guntram Blohm
    May 20 '16 at 18:57






  • 1




    @Gilles, here tee is indeed preferable to pee, (but dcfldd is best). Still, pee is useful; one may, if required, include, (within each quoted argument), additional 'dd' options, and even other pipes and filters, individually tailored to each output device.
    – agc
    May 21 '16 at 3:49















up vote
19
down vote



accepted











  1. Borrowing from don_crissti's answer using tee, but without
    dd or bashisms:



    sudo tee /dev/disk2 /dev/disk3 > /dev/disk4 < masi.img



  2. Using pee from Debian's moreutils package:



    sudo dd if=masi.img | 
    pee "dd of=/dev/disk2" "dd of=/dev/disk3" "dd of=/dev/disk4"


    With bash, ksh, or zsh, that can be abbreviated to:



    sudo dd if=masi.img | pee "dd of=/dev/disk"2..4


    Or even, (if there's no need for dd's useful functions):



    sudo pee "dd of=/dev/disk"2..4 < masi.img


    pee is useful; one may, if required, include, (within each quoted argument), additional distinct dd options, and even other pipes and filters, individually tailored to each output device.



With either method the number of output disks can be extended indefinitely.






share|improve this answer


















  • 1




    Using dd for this isn't necessary. A lot of people believe it's necessary because its usage, specific to copying to or from disk images, is "fossilized" in tutorials written back in the 90s and copied by people who didn't know why. It was used back then to work around a glitch in cp.
    – Random832
    May 20 '16 at 17:26










  • @Random832 It is necessary because it is more stable than cp. Try many formats and different allocation sizes. I have not found enough stable cp for the work. Please, correct me as an answer here if you can argumentate how cp is enough stable.
    – Léo Léopold Hertz 준영
    May 20 '16 at 17:48











  • @Masi It is rarely necessary to explicitly select a format (what do you even mean by "format") and allocation size (you mean the block size?) for the common purpose of writing a disk image to a disk or reading a disk into a disk image. The reason dd became commonly used for this purpose was because of a bug in cp (GNU cp on Linux specifically) in the early 90s that caused it to skip copying blocks that were all-zero-bytes.
    – Random832
    May 20 '16 at 18:23







  • 7




    Bug in cp in the 90s? dd is 20 years older than that. The main reason for using dd was that many devices, especially tape drives, needed to be read/written in fixed block sizes, which is why dd has bs, ibs and obs parameters, and it was the only program that could ensure correct block sizes.
    – Guntram Blohm
    May 20 '16 at 18:57






  • 1




    @Gilles, here tee is indeed preferable to pee, (but dcfldd is best). Still, pee is useful; one may, if required, include, (within each quoted argument), additional 'dd' options, and even other pipes and filters, individually tailored to each output device.
    – agc
    May 21 '16 at 3:49













up vote
19
down vote



accepted







up vote
19
down vote



accepted







  1. Borrowing from don_crissti's answer using tee, but without
    dd or bashisms:



    sudo tee /dev/disk2 /dev/disk3 > /dev/disk4 < masi.img



  2. Using pee from Debian's moreutils package:



    sudo dd if=masi.img | 
    pee "dd of=/dev/disk2" "dd of=/dev/disk3" "dd of=/dev/disk4"


    With bash, ksh, or zsh, that can be abbreviated to:



    sudo dd if=masi.img | pee "dd of=/dev/disk"2..4


    Or even, (if there's no need for dd's useful functions):



    sudo pee "dd of=/dev/disk"2..4 < masi.img


    pee is useful; one may, if required, include, (within each quoted argument), additional distinct dd options, and even other pipes and filters, individually tailored to each output device.



With either method the number of output disks can be extended indefinitely.






share|improve this answer















  1. Borrowing from don_crissti's answer using tee, but without
    dd or bashisms:



    sudo tee /dev/disk2 /dev/disk3 > /dev/disk4 < masi.img



  2. Using pee from Debian's moreutils package:



    sudo dd if=masi.img | 
    pee "dd of=/dev/disk2" "dd of=/dev/disk3" "dd of=/dev/disk4"


    With bash, ksh, or zsh, that can be abbreviated to:



    sudo dd if=masi.img | pee "dd of=/dev/disk"2..4


    Or even, (if there's no need for dd's useful functions):



    sudo pee "dd of=/dev/disk"2..4 < masi.img


    pee is useful; one may, if required, include, (within each quoted argument), additional distinct dd options, and even other pipes and filters, individually tailored to each output device.



With either method the number of output disks can be extended indefinitely.







share|improve this answer














share|improve this answer



share|improve this answer








edited 1 hour ago

























answered May 20 '16 at 16:27









agc

4,3831935




4,3831935







  • 1




    Using dd for this isn't necessary. A lot of people believe it's necessary because its usage, specific to copying to or from disk images, is "fossilized" in tutorials written back in the 90s and copied by people who didn't know why. It was used back then to work around a glitch in cp.
    – Random832
    May 20 '16 at 17:26










  • @Random832 It is necessary because it is more stable than cp. Try many formats and different allocation sizes. I have not found enough stable cp for the work. Please, correct me as an answer here if you can argumentate how cp is enough stable.
    – Léo Léopold Hertz 준영
    May 20 '16 at 17:48











  • @Masi It is rarely necessary to explicitly select a format (what do you even mean by "format") and allocation size (you mean the block size?) for the common purpose of writing a disk image to a disk or reading a disk into a disk image. The reason dd became commonly used for this purpose was because of a bug in cp (GNU cp on Linux specifically) in the early 90s that caused it to skip copying blocks that were all-zero-bytes.
    – Random832
    May 20 '16 at 18:23







  • 7




    Bug in cp in the 90s? dd is 20 years older than that. The main reason for using dd was that many devices, especially tape drives, needed to be read/written in fixed block sizes, which is why dd has bs, ibs and obs parameters, and it was the only program that could ensure correct block sizes.
    – Guntram Blohm
    May 20 '16 at 18:57






  • 1




    @Gilles, here tee is indeed preferable to pee, (but dcfldd is best). Still, pee is useful; one may, if required, include, (within each quoted argument), additional 'dd' options, and even other pipes and filters, individually tailored to each output device.
    – agc
    May 21 '16 at 3:49













  • 1




    Using dd for this isn't necessary. A lot of people believe it's necessary because its usage, specific to copying to or from disk images, is "fossilized" in tutorials written back in the 90s and copied by people who didn't know why. It was used back then to work around a glitch in cp.
    – Random832
    May 20 '16 at 17:26










  • @Random832 It is necessary because it is more stable than cp. Try many formats and different allocation sizes. I have not found enough stable cp for the work. Please, correct me as an answer here if you can argumentate how cp is enough stable.
    – Léo Léopold Hertz 준영
    May 20 '16 at 17:48











  • @Masi It is rarely necessary to explicitly select a format (what do you even mean by "format") and allocation size (you mean the block size?) for the common purpose of writing a disk image to a disk or reading a disk into a disk image. The reason dd became commonly used for this purpose was because of a bug in cp (GNU cp on Linux specifically) in the early 90s that caused it to skip copying blocks that were all-zero-bytes.
    – Random832
    May 20 '16 at 18:23







  • 7




    Bug in cp in the 90s? dd is 20 years older than that. The main reason for using dd was that many devices, especially tape drives, needed to be read/written in fixed block sizes, which is why dd has bs, ibs and obs parameters, and it was the only program that could ensure correct block sizes.
    – Guntram Blohm
    May 20 '16 at 18:57






  • 1




    @Gilles, here tee is indeed preferable to pee, (but dcfldd is best). Still, pee is useful; one may, if required, include, (within each quoted argument), additional 'dd' options, and even other pipes and filters, individually tailored to each output device.
    – agc
    May 21 '16 at 3:49








1




1




Using dd for this isn't necessary. A lot of people believe it's necessary because its usage, specific to copying to or from disk images, is "fossilized" in tutorials written back in the 90s and copied by people who didn't know why. It was used back then to work around a glitch in cp.
– Random832
May 20 '16 at 17:26




Using dd for this isn't necessary. A lot of people believe it's necessary because its usage, specific to copying to or from disk images, is "fossilized" in tutorials written back in the 90s and copied by people who didn't know why. It was used back then to work around a glitch in cp.
– Random832
May 20 '16 at 17:26












@Random832 It is necessary because it is more stable than cp. Try many formats and different allocation sizes. I have not found enough stable cp for the work. Please, correct me as an answer here if you can argumentate how cp is enough stable.
– Léo Léopold Hertz 준영
May 20 '16 at 17:48





@Random832 It is necessary because it is more stable than cp. Try many formats and different allocation sizes. I have not found enough stable cp for the work. Please, correct me as an answer here if you can argumentate how cp is enough stable.
– Léo Léopold Hertz 준영
May 20 '16 at 17:48













@Masi It is rarely necessary to explicitly select a format (what do you even mean by "format") and allocation size (you mean the block size?) for the common purpose of writing a disk image to a disk or reading a disk into a disk image. The reason dd became commonly used for this purpose was because of a bug in cp (GNU cp on Linux specifically) in the early 90s that caused it to skip copying blocks that were all-zero-bytes.
– Random832
May 20 '16 at 18:23





@Masi It is rarely necessary to explicitly select a format (what do you even mean by "format") and allocation size (you mean the block size?) for the common purpose of writing a disk image to a disk or reading a disk into a disk image. The reason dd became commonly used for this purpose was because of a bug in cp (GNU cp on Linux specifically) in the early 90s that caused it to skip copying blocks that were all-zero-bytes.
– Random832
May 20 '16 at 18:23





7




7




Bug in cp in the 90s? dd is 20 years older than that. The main reason for using dd was that many devices, especially tape drives, needed to be read/written in fixed block sizes, which is why dd has bs, ibs and obs parameters, and it was the only program that could ensure correct block sizes.
– Guntram Blohm
May 20 '16 at 18:57




Bug in cp in the 90s? dd is 20 years older than that. The main reason for using dd was that many devices, especially tape drives, needed to be read/written in fixed block sizes, which is why dd has bs, ibs and obs parameters, and it was the only program that could ensure correct block sizes.
– Guntram Blohm
May 20 '16 at 18:57




1




1




@Gilles, here tee is indeed preferable to pee, (but dcfldd is best). Still, pee is useful; one may, if required, include, (within each quoted argument), additional 'dd' options, and even other pipes and filters, individually tailored to each output device.
– agc
May 21 '16 at 3:49





@Gilles, here tee is indeed preferable to pee, (but dcfldd is best). Still, pee is useful; one may, if required, include, (within each quoted argument), additional 'dd' options, and even other pipes and filters, individually tailored to each output device.
– agc
May 21 '16 at 3:49













up vote
18
down vote













You could try dcfldd

It's an enhanced version of gnu dd and it can output to multiple files or disks at the same time:



dcfldd if=masi.img of=/dev/disk2 of=/dev/disk3 of=/dev/disk4





share|improve this answer






















  • Can you explain your first command. Why pipe only before the last dd? How does the location of the pipe change with four dd?
    – Léo Léopold Hertz 준영
    May 20 '16 at 16:24






  • 3




    dcfldd is the fastest, maybe that should be the first choice.
    – agc
    May 20 '16 at 16:29














up vote
18
down vote













You could try dcfldd

It's an enhanced version of gnu dd and it can output to multiple files or disks at the same time:



dcfldd if=masi.img of=/dev/disk2 of=/dev/disk3 of=/dev/disk4





share|improve this answer






















  • Can you explain your first command. Why pipe only before the last dd? How does the location of the pipe change with four dd?
    – Léo Léopold Hertz 준영
    May 20 '16 at 16:24






  • 3




    dcfldd is the fastest, maybe that should be the first choice.
    – agc
    May 20 '16 at 16:29












up vote
18
down vote










up vote
18
down vote









You could try dcfldd

It's an enhanced version of gnu dd and it can output to multiple files or disks at the same time:



dcfldd if=masi.img of=/dev/disk2 of=/dev/disk3 of=/dev/disk4





share|improve this answer














You could try dcfldd

It's an enhanced version of gnu dd and it can output to multiple files or disks at the same time:



dcfldd if=masi.img of=/dev/disk2 of=/dev/disk3 of=/dev/disk4






share|improve this answer














share|improve this answer



share|improve this answer








edited May 20 '16 at 23:16

























answered May 20 '16 at 16:20









don_crissti

48.4k15129158




48.4k15129158











  • Can you explain your first command. Why pipe only before the last dd? How does the location of the pipe change with four dd?
    – Léo Léopold Hertz 준영
    May 20 '16 at 16:24






  • 3




    dcfldd is the fastest, maybe that should be the first choice.
    – agc
    May 20 '16 at 16:29
















  • Can you explain your first command. Why pipe only before the last dd? How does the location of the pipe change with four dd?
    – Léo Léopold Hertz 준영
    May 20 '16 at 16:24






  • 3




    dcfldd is the fastest, maybe that should be the first choice.
    – agc
    May 20 '16 at 16:29















Can you explain your first command. Why pipe only before the last dd? How does the location of the pipe change with four dd?
– Léo Léopold Hertz 준영
May 20 '16 at 16:24




Can you explain your first command. Why pipe only before the last dd? How does the location of the pipe change with four dd?
– Léo Léopold Hertz 준영
May 20 '16 at 16:24




3




3




dcfldd is the fastest, maybe that should be the first choice.
– agc
May 20 '16 at 16:29




dcfldd is the fastest, maybe that should be the first choice.
– agc
May 20 '16 at 16:29










up vote
3
down vote













Also this is possible with tee and process substitution:



dd if=/dev/sda | tee >(dd of=/dev/sdb) >(dd of=/dev/sdc) | dd of=/dev/sdd






share|improve this answer




















  • Can you explain process substitute? How is your answer different from agc's one?
    – Léo Léopold Hertz 준영
    Dec 22 '17 at 20:46










  • yeah sure: process substitution is used when you need to pipe the stdout of one command to multiple commands. Using a simple pipe will let you pipe to just one command. My answer is achieving the same result as agc's, but in a different way :) Also I never used pee before, as I have the tee command on my system.
    – chevallier
    Dec 22 '17 at 21:44















up vote
3
down vote













Also this is possible with tee and process substitution:



dd if=/dev/sda | tee >(dd of=/dev/sdb) >(dd of=/dev/sdc) | dd of=/dev/sdd






share|improve this answer




















  • Can you explain process substitute? How is your answer different from agc's one?
    – Léo Léopold Hertz 준영
    Dec 22 '17 at 20:46










  • yeah sure: process substitution is used when you need to pipe the stdout of one command to multiple commands. Using a simple pipe will let you pipe to just one command. My answer is achieving the same result as agc's, but in a different way :) Also I never used pee before, as I have the tee command on my system.
    – chevallier
    Dec 22 '17 at 21:44













up vote
3
down vote










up vote
3
down vote









Also this is possible with tee and process substitution:



dd if=/dev/sda | tee >(dd of=/dev/sdb) >(dd of=/dev/sdc) | dd of=/dev/sdd






share|improve this answer












Also this is possible with tee and process substitution:



dd if=/dev/sda | tee >(dd of=/dev/sdb) >(dd of=/dev/sdc) | dd of=/dev/sdd







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 22 '17 at 18:23









chevallier

8791116




8791116











  • Can you explain process substitute? How is your answer different from agc's one?
    – Léo Léopold Hertz 준영
    Dec 22 '17 at 20:46










  • yeah sure: process substitution is used when you need to pipe the stdout of one command to multiple commands. Using a simple pipe will let you pipe to just one command. My answer is achieving the same result as agc's, but in a different way :) Also I never used pee before, as I have the tee command on my system.
    – chevallier
    Dec 22 '17 at 21:44

















  • Can you explain process substitute? How is your answer different from agc's one?
    – Léo Léopold Hertz 준영
    Dec 22 '17 at 20:46










  • yeah sure: process substitution is used when you need to pipe the stdout of one command to multiple commands. Using a simple pipe will let you pipe to just one command. My answer is achieving the same result as agc's, but in a different way :) Also I never used pee before, as I have the tee command on my system.
    – chevallier
    Dec 22 '17 at 21:44
















Can you explain process substitute? How is your answer different from agc's one?
– Léo Léopold Hertz 준영
Dec 22 '17 at 20:46




Can you explain process substitute? How is your answer different from agc's one?
– Léo Léopold Hertz 준영
Dec 22 '17 at 20:46












yeah sure: process substitution is used when you need to pipe the stdout of one command to multiple commands. Using a simple pipe will let you pipe to just one command. My answer is achieving the same result as agc's, but in a different way :) Also I never used pee before, as I have the tee command on my system.
– chevallier
Dec 22 '17 at 21:44





yeah sure: process substitution is used when you need to pipe the stdout of one command to multiple commands. Using a simple pipe will let you pipe to just one command. My answer is achieving the same result as agc's, but in a different way :) Also I never used pee before, as I have the tee command on my system.
– chevallier
Dec 22 '17 at 21:44


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f284480%2fdd-write-to-multiple-disks%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)