Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Aug 2002 14:00:08 +0200
From:      "Roger 'Rocky' Vetterberg" <listsub@401.cx>
To:        freebsd-questions@FreeBSD.ORG
Subject:   syncing local filesystems
Message-ID:  <3D5CE948.6020604@401.cx>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D5CE948.6020604>