4A. Best method to duplicate the CF card live while the system
is running.

Best method I now which is near effort-less, but requires preparation is to setup your drive initially as a RAID-1 mirror but force it to have only one drive (if you don't want it mirrored all the time).

Then, add a new drive to the RAID-1 and watch the synchronization. Once finished, take the drive out by failing it cleanly then by removing it, and you have an integral raid-mirrored copy of your original drive while it was running.

On my own home-gateway, I used this to "burn" the latest state of the system to disk, and I used usb keys as main drives. At boot, it would pick up which ever is in most current state and update the other. And later in my local script, I would fail the hard drive so this gateway would become completely silent, except for the fan. (Noise was a big factor in my setup as it uses real old hardware)

You could do exactly the same using a device in ram to avoid witting to the compact flash. It would boot from the single-mirror on your drive, sync with a device-in-ram (see ramfs and losetup, quite a hack but always worked for me), then fail the physical drive and run only on ram. Then in your local.stop script re-sync with the physical drive.

The biggest problem with this method and flash cards is with the write limit. The RAID sync will overwrite every single byte on the card, so every physical sector will decrease in lifespan. Where is you used an intelligent copy program such as rsync, sector lifespan would increase more randomly and more slowly.

I do not recommend the use of flash cards for anything else than read-only data (that you can change sometimes). I compare it to a better-cd-rw.

Simon

Reply via email to