Am Sonntag 13 September 2009 04:32:43 schrieb James: > I guess I should use 'dd' to copy the entire contents > of one CF drive to another? Any example syntax with dd > is welcome.
What about "man dd"? > Should I keep a machine around to run fdisk on a new CF > module, or is there a way, I can just plug the CF module > into a reader/writer and burn the image onto > the CF module directly, and not have to use fdisk to format > first? No, just use dd. > What about grub and the mbr. Will dd copy over all of that information, > or do I have to run grub (grub install) manually to ensure the MBR > is set properly. If you create an image of your entire device, then no. However, you will loose the ability to mount and modify the image. But you could easily write a small script for writing the MBR. I've never done this, but I'd bet that fdisk (or one of it's many cousins) can be used in scripts to setup the partitions on the fly. So let's assume your CF card USB stick or whatever is has one partition and is detected as /dev/sda. You can then first take an image of the partition: dd if=/dev/sda1 of=firewall.img This image can then be mounted and modified as needed: mkdir /mnt/firewall mount -t ext2 -oloop firewall.img /mnt/firewall [do modifications inside /mnt/firewall] umount /mnt/firewall then write it back to as many other CF cards you need: dd if=firewall.img of=/dev/sdX1 (replace X as appropriate) There should also be a possibility to copy the MBR with dd, something like dd if=/dev/sda of=mbr.img count=512 (not sure about the count value, though). and write it back with dd if=mbr.img of=/dev/sda. The only thing left is the automatic partitioning. HTH... Dirk