Scott H wrote: > > > From: George Toft > > > Scott H wrote: > > > > > > I am working on methods for recovery of a > > Linux > > > server, and I wanted to run this by the group > > for > > > comments or recommendations, since I'm new to > > > this. I have a server which acts as an email > > > relay, storing no mail locally. It also > > stores > > > no other data, besides the configuration data > > for > > > its mail systems. I plan to set up an > > automated, > > > regular complete backup for it, but I was > > also > > > considering this: Say I have among my > > partitions > > > on this box: > > > > > > sda2 / > > > sda3 /backups > > > sda5 /var/log > > > sda7 /var/spool > > > > > > Let's say I set up mirrordir to keep /backups > > > (sda3) mirrored from / (sda2) maybe once per > > > night or week. Then, if I manage to mess up > > the > > > OS (as I recently did, running tripwire and > > > up2date at the same time - don't ask) and the > > > machine won't boot, I wouldn't have to resort > > to > > > a rebuild and the tape backup. I could boot > > the > > > box to my LNX-BBC CD (or a Tom's root boot), > > > change fstab to mount sda3 as / and sda2 as > > > /backups, and reboot the box. As long as > > > mirrordir hadn't yet copied whatever > > corruption > > > was in the OS, I should be able to boot and > > go > > > just as things were the last time mirrordir > > ran, > > > right????????? Better ways to do this? > > > > > > Scott > > > > > > Hi Scott, > > > > Here's what I did at a web hosting company. I > > had another drive > > installed that mounted on /backup at midnight > > (maybe later, depending on > > server load at midnight). My backup script > > copied /etc, /root, /home, > > and /var. That was it. Everything else could > > be rebuilt from the > > master image. > > > > You could follow this same scheme (if using Red > > Hat). If you hose your > > OS, or the drive fails, reinstall using your > > kickstart config file > > (located in /root), then restore your data from > > the other drive. I use > > this method for my firewall, and I tested it > > (bare metal recovery). The > > scripts to do this are on my site > > (georgetoft.com - linux - cool shell > > scripts). > > > > Your idea is pretty slick, though - switch > > partitions in fstab, reboot > > and go. Keep in mind what happens if your > > drive fails. > > Thanks for your comments, George. One other > question: Is there any problem with using > mirrordir for the entire / partition? I mean, > there are undoutedly files that are open (and > locked?) by the OS at all times. Might mirrordir > not be able to copy these? Has anyone actually > mirrored the partition mounted at / ? > > . > > __________________________________________________ > Do you Yahoo!? > HotJobs - Search new jobs daily now > http://hotjobs.yahoo.com/ > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us > To subscribe, unsubscribe, or to change you mail settings: > http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss Locked files? I've heard of them in Unix, but I have never seen one in over 5 years of Unix/Linux use. The strategy I outlined worked well in several Bare Metal Recovery situations, with the only loss being a few hours of Apache logs. I used to copy mySQL files directly from /var/lib/mysql - now I'm smarter and use mysqldump. Still, if any file is open, it would be those - no problems encountered. I would try to be smart about what I mirror. You don't need to copy a file that hasn't changed, so I would run find / -ctime -1 to get a list of files whose status has changed in the last day, and mirror those. Next, you have to account for deleted files. I can think of a few ways. The one I used was running find periodically and using diff to see what is missing from the last time I ran it. Delete those files. I synced 4 servers every 20 minutes this way. Fortunately, the filesystems were small so find didn't kill the system. George -- __ __ ___ __ __ __ ___ ___ | | | | | \ | | | | | | \ \ / / -o) | | | | | \| | | | | | \ \/ / (o- /\\ | |__ | | | |\ | | |_| | / /\ \ //\ _\_v |_____||__| |__| \___| \_______| /__/ \__\ v_/_ Don't Fear The Penguins