Re: Write disk image to multiple drives



Check out the "tee" command. It can write its stdin to multiple
output files as well as to stdout. (the output files can be
fifos, and this is the trick you need.)

Anyways, here in short how to do this (not tested):

$ for f in `seq 1 15`; do mkfifo fifo$f; cat fifo$f > cfcard-$f & done
$
$ zcat image.gz | tee fifo1 fifo2 ... fifo15 > cfcard-16
$
$ rm -f fifo1 fifo2 ... fifo15

Thanks for the info; I'd thought about this initially, but
unfortunately the images aren't simply gzip'd; they're in a format used
by Frisbee, which is intended to be used in a multicast-based network
disk imaging environment, and uses non-sequential writes to image the
disk.

I did find another solution, however. From reading the source to
dm-mirror (a painful exercise, given that I'm not a kernel programmer
and nowhere near fluent in C) and a few vague references on the web, I
figured out the table syntax. I'm using something similar to the
following (a bit more complex because I actually have to figure out
which slots have cards in them before starting, but this is the general
idea)

<code>
dmsetup create cfcards <<END
0 1000000 mirror core 1 2048 2 /dev/card1 0 /dev/card2 0
END

imageunzip /path/to/image /dev/mapper/cfcards
</code>

Now my major sticking point is to find some way of identifying the CF
slots; they're usb devices and the device nodes change every time
they're initialized.

I've been using the following udev rule

KERNEL="sd*", SYSFS{model}="USB Storage-CFC ", SYMLINK="cfcards/$k"

but this includes the partition devices as well. Know of a simple way
to

a. modify the udev rule to include the device itself but not match the
partition subdevices, or,

b. prevent the partition table from being scanned at all.

We have no need to actually read/write the partitions on the cards; the
contents are mostlty meaningless to a Linux system anyway. We just want
to slap in some cards, write the entire disk image and yank them out
when it's done. Solution B would be preferred, though solution A would
work if I can figure out how to stop hotplug from automatically
mounting the partitions when it sees them.

Thanks,

--
Phil

.



Relevant Pages

  • Re: Linux community software-update-anarchy polemic
    ... Remember, I'm just a monkey. ... That implies that if you have one disk per partition, ... Trust the kernel or don't trust the kernel, but either way, both ...
    (comp.os.linux.misc)
  • SUMMARY: Moving /usr From Under Root "/" To Its Own Partition
    ... One of the reasons for doing this is to end up with a smaller root ... Install the boot block and boot off the new drive. ... " In order for the root partition to be fscked and remounted ... D> temporarily on the existing disk. ...
    (SunManagers)
  • Re: Two "expert" issues I must solve before upgading
    ... I think backups are different than the other fluff you suggest - more ... out there who had a disk crash and had to start from scratch. ... >image of your current Windows 98 OS partition. ... you can restore the disk image and get back quickly ...
    (microsoft.public.windowsxp.newusers)
  • Re: Found the chkdsk log [STOP error, data unviewable etc...]
    ... The type of the file system is NTFS. ... CHKDSK is recovering lost files. ... 33013543 KB total disk space. ... partition, etc. Oh well... ...
    (microsoft.public.win2000.file_system)
  • Re: Disk Utility to align tracks on a hardware RAID1 system
    ... you should contact you hard disk manufacture for resolution. ... > Microsoft provides RAID 1 based on software method. ... > This newsgroup only focuses on SBS technical issues. ... >>system partition but a separate drive or extended artition. ...
    (microsoft.public.windows.server.sbs)