using 'dd' from one source to multiple destinations

John Macdonald john-Z7w/En0MP3xWk0Htik3J/w at public.gmane.org
Mon Jan 24 19:31:04 UTC 2005


On Mon, Jan 24, 2005 at 12:09:36PM -0500, Lennart Sorensen wrote:
> On Mon, Jan 24, 2005 at 11:55:31AM -0500, Madison Kelly wrote:
> > Hi all,
> > 
> >   I am looking to mirror mulptiple disks from a single source. I have 
> > thought about using 'dd' but I can't find anything telling yea or neh if 
> > this will work:
> > 
> > 'dd if=/dev/sda of=/dev/sdb of=/dev/sdc of=/dev/sdd'
> > 
> >   Would this work? If not, can anyone recommend an effective way to 
> > mirrow a disk when the hard drives are identical (so partitions don't 
> > need to be resized)? Thanks all!
> 
> Something like this might work:
> 
> dd if=/dev/sda | tee >(dd of=/dev/sdb) | tee >(dd of=/dev/sdc) | dd of=/dev/sdd
> 
> I didn't test it, but it ought to work.

More simply:

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

You'd only need to have the separate dd processes for each
target if the dd was doing something more than copying the
data, like converting ASCII to EBCDIC, or ensuring that the
output had a specific blocksize (for a tape device, perhaps).

tee copies its input as many times as it needs for the arguments
provided (plus one for its standard output).

-- 
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list