Date: Fri, 16 Aug 2002 09:00:34 -0500 From: "Jack L. Stone" <jackstone@sage-one.net> To: "Roger 'Rocky' Vetterberg" <listsub@401.cx>, freebsd-questions@FreeBSD.ORG Subject: Re: syncing local filesystems Message-ID: <3.0.5.32.20020816090034.0189b980@mail.sage-one.net> In-Reply-To: <3D5CE948.6020604@401.cx>
next in thread | previous in thread | raw e-mail | index | archive | help
At 02:00 PM 8.16.2002 +0200, Roger 'Rocky' Vetterberg wrote: >Hi listmembers. > >I have a machine that stores some vital information. >This machine has to be restored asap in case of a failure, so the >usual solution with restoring from backup tapes is too slow to be >usefull here. >Right now, Im testing a machine that has 2 identical drives, ad0 >and ad2. They are both mounted in sleds, so in case of a disk >crash the disk can be replaced in seconds. >I would like a simple way to make ad2 an exact clone of ad0. Ive >tried a few different approaches to accomplish this, all had some >problems that makes me think there must be a better way. > >Any suggestions or ideas are much appreciated. > >-- >R ...a lot snipped out... Rocky: I didn't see any other replies, so here is a script I picked up here the other day and modified, and tested (just as if a crash happened, moved cables to 2nd HD and booted -- worked fine) because I want to do exactly the same thing as you... quick backup of main HD to another one for quick restore by just moving some cables. The script uses dump and is for the initial dump/restore of the WHOLE hard disk ad0s1 to ad1s1 (in my case). Yours would be ad0s1 to ad2s1 of course. Alas, entire HD dump/restore takes twice as long as dd, but as you say, then incrementals can be done afterwards with dump. As a thought, use this script to do the first whole backup, then modify the script for incrementals. As you can see, it knows how to mount/umount the second HD. Let me know if youy try it and what you did to modify for incrementals. I haven't done that yet. Here's the script: sageame@sagec$ more dump.res.1-2 #!/bin/sh ## To backup ad0s1 to ad1s1 # # cd / /sbin/umount /mnt /sbin/fdisk -BI ad1 /sbin/disklabel -w -r -B ad1s1 auto /sbin/disklabel -r ad0 > /usr/local/etc/backups/disk.label /sbin/disklabel -R -B ad1s1 /usr/local/etc/backups/disk.label /sbin/newfs -U /dev/ad1s1a /sbin/newfs -U /dev/ad1s1e /sbin/newfs -U /dev/ad1s1f /sbin/mount -rw /dev/ad1s1a /mnt cd /mnt /sbin/dump -0f - / | /sbin/restore -rf - cd / /sbin/umount /mnt /sbin/mount -rw /dev/ad1s1e /mnt cd /mnt /sbin/dump -0f - /var | /sbin/restore -rf - cd / /sbin/umount /mnt /sbin/mount -rw /dev/ad1s1f /mnt cd /mnt /sbin/dump -0f - /usr | /sbin/restore -rf - cd / /sbin/umount /mnt # # END # Best regards, Jack L. Stone, Administrator SageOne Net http://www.sage-one.net jackstone@sage-one.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.20020816090034.0189b980>