Unix Imaging for Redundancy

I'm trying to come up with an "imaging" type solution (a.k.a. Norton Ghost, Imagecast) with standard unix utils. I'd like to just image one of our FreeBSD servers so I can use the hot swap HD's. If one fails, I could slide in an exact duplicate HD and the server would be back up. I've tried just doing something with dd like: dd if=(hd1) of=(hd2) but it's not going to be that simple. I don't think dd is happy about not having a filesystem on hd2 (it's a blank unused drive). I have had luck with tarring up the whole drive, installing a minimal FreeBSD install on the second drive, renaming the kernel, dropping to single user mode, and then untarring, but that takes away the point of having something quick and ready to deploy.

I've also thought about running two mirrored drives (just like scsi+raid) but in an IDE system. Then having the secondary drive deactivated, but ready to go in case the first one fails. Then just tell the bios (through remote console interface) to boot from the slave drive. Thanks in advance for any ideas.

Well, I figured out the imaging part. The dd command does work, it just takes such a long time I didn't think it was working. I let it run overnight and it finished. Must have taken several hours though. So it looks like using dd for imaging hard drives is possible, just not very practicle.

Having tried a emulating a raid setup with IDE yet. I'll get to that as soon as I have the time and resources. If anyone else has tried it let me know!

Well-

  you tried my favorite already, "dd" is great, but how about a "dd" once a month, for a "Full image" mirror, and then using a *fsdump command to dump over the slices of the fs for the rest of the month?  this is faster, but not as strenuous or inclusive as "dd".  Is this a heavily used server 24/7?  If not, the "dd" on a nightly or weekly basis should be fine.  If the data is pretty static, like some static web pages with a separate database for info storage, then I'd say that a weekly "dd", and another whenever any major revisions are made would be good, but it really comes down to the state of your data.  Since you are only looking at the mirror to maintain uptime, I am assuming this is some sort of webserver.  If not, I'd look at getting something off to tape as well asap, you can never have too many backups to a removable media source.  I'll also go with the hardline approach on this one, buy a good tape drive if you are using one, a good way to determine the value of your data is to see how much you put into your backup system.  If you backup to a $10 DDS1 DAT drive, that must be all your data is worth to you.  
  My old place of work used to backup our webserver like this:

-weekly "dd" to an IDENTICAL drive as that in the server itself
-nightly ufsdump of the critical filesystems over to the mirror drive
-daily tape backup to a DLT, incremental and a monthly full image

This worked on a Solaris box, it was a Sparc, they flip IDs 0 and 1 (if I remember right) on boot, so we just set the mirror at ID2. This was a great setup, and it worked quite well until one of the drives died and someone (not me, I swear) tried to "dd" to the replacement from the production drive. They crossed-up the "if" and "of" args, so we copied a nice, formatted disk with a spanking new drive label on it over to our produciton webserver drive, that was a bad day. Luckily, the tape was there, and so I say again, get your data on a removable media, keep at least two copies and one HAS to be off-site. I may sound paranoid, but these are reasonable measures for a business that places value on it's data. If your computer makes you any sort of income (tangible or not), the data on that computer is worth, at minimum, what you make off of it, sometimes much more....

Later,

loadc

Yes, our backups are pretty important to us. We backup strenuously every night. Copies are kept in a lock box at a bank that only 2 people in the company can get to and updated every week. We actually rely on 4 different types of servers (that all take heavy loads) on our production network. Web, Database, Mail, and Citrix. Each type is configured in farms. What I'd like is to change everything I can to Linux, and use kickstart + Raid in all the systems. Need another DB server in the farm? Give me 5 minutes!

After I do my fresh installs I take a snapshot of them using systemimager . It works like a charm. No dd required.

Your system must support rsync for this option to work,...and if you're live on the internet, then maybe you may want to review your security concerns regarding having this daemon working on your server.

Good Luck. Hope this helps.

VJ