From owner-freebsd-questions Fri Aug 16 4:58: 6 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 159BB37B400 for ; Fri, 16 Aug 2002 04:58:02 -0700 (PDT) Received: from mailb.telia.com (mailb.telia.com [194.22.194.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CD5E43E6E for ; Fri, 16 Aug 2002 04:58:01 -0700 (PDT) (envelope-from listsub@401.cx) Received: from 401.cx (jenny.twenty4help.se [62.20.102.59]) by mailb.telia.com (8.12.5/8.12.5) with ESMTP id g7GBw4el006144 for ; Fri, 16 Aug 2002 13:58:04 +0200 (CEST) X-Original-Recipient: Message-ID: <3D5CE948.6020604@401.cx> Date: Fri, 16 Aug 2002 14:00:08 +0200 From: "Roger 'Rocky' Vetterberg" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc2) Gecko/20020512 Netscape/7.0b1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: syncing local filesystems Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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. First, I tried the most logical approach and used dd to copy the drives using a command like 'dd if=/dev/ad0 of=/dev/ad2 bs=n' where n equals different values. This works, but it takes way to long since both drives are 80 gig drives. Different values of n does help the performance a bit, but its still way to slow. I have also experienced problems with the biggest partition, /usr, being corrupted if I use dd to copy it. This could simple be bad hardware, since the machine Im using for testing is not what you would call top-of-the-line hardware. The really big advantage of this method is that I can take a totally blank drive, no formatting or partitioning needed, put it in a sled and copy the other drive to it directly. The downside is that it takes way to long. I also tried dump and pipe it to restore. This also works, but the downsides are that I have to have a drive with exactly the same partitioning as the first drive, and the drive has to be mounted or restore wont write to it. (Is this correct? I have been unable to find a way to make restore write to a drive that is currently not mounted anywhere, maybe someone knows a way to accomplish this?) The good thing about dump is that it can decide which files has already been backed up and only copy new or changed files. Since the changes in the filesystem are very small (I would estimate something like 5-15megs of new data and maybe 10 changed files between dumps) Ive been looking at utilities such as rsync and ssync. rsync seems to be mostly aimed at network replication, and ssync seems to be just fine if you want to sync directories, but not entire drives. Different combinations of raid would be the easiest way, I know, but for reason I dont care to go into the hardware used can not be changed and it does not include any kind of scsi or raid solution. Vinum would be an option, except you cant boot on a vinum volume, and afaik you cant give vinum a totally empty disk and tell it to use it, it has to be formatted and partitioned (Please correct me if Im wrong). To put it short: whats the easiest way to make an identical copy of a drive, preferably by copy only the differences between the two drives? If dd had a flag similar to "copy only new or changed files", it would be the ultimate solution. However, this is not the nature of dd, since it is a 'data doubler' not 'data synchronizer'. To aviod unnecessary comments about backing up your important data; yes, the machine is also backed up by two different tape libraries in physically remote locations. This is just to get a quick and dirty way of immediatly being able to bring it back online in case of hardware failure. Any suggestions or ideas are much appreciated. -- R To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message