I have setup a partition on both drives with exactly same same number of blocks. Both 
drive are the same model/type.
/dev/sda1 & /dev/sdb1

I have a cronjob that runs each night as root and does a:
dd if=/dev/sda1 of=/dev/sdb1 bs=1024

Since both partitions are exactly the same in size & type they there is no worry about 
loosing any data or overwriting the partition boundary.

By doing this each night the mirror is always a day old. If the first drive breaks at 
6PM and I did the mirror at 1AM then I've lost any new data writing to the first drive 
since 1AM.
The only catch with doing a dd over using RAID-1 is that each night it needs to copy 
the whole partition over to the other drive. If I was using RAID-1 and only the passwd 
& shadow files were being updated then only those two files would get updated on the 
other drive. Of course both drives are Ultra2 Wide LVD so
it doesn't take very long to copy 400MB's over to the other drive.

There is also one other catch with dd, If a file was being written to the drive while 
dd was copying it's data the file may become corrupt! With me the only files that get 
changed on the root drive is /etc stuff and it's highly unlikely that anyone is going 
to edit those at 1AM:-) Even if they did it would only
be corrupted for one night.

To put this dd program in your cron you would need to do a:
'crontab -e' as root
then in vi (which crontab starts for you)
1 1 * * *    dd if=/dev/sda1 of=/dev/sdb1 bs=1024
then save & quit.





Steve McPherson wrote:

> David, in one of your posts, you mentioned that you simply did a cronjob -copying 
>the contents of one drive to another.  The only thing you lost were the password 
>changes for the day.  Can you explain to me how to do that?  I have a book, but it 
>doesn't go into much detail on dd or cron.  Sorry to bother you!!
>      -Steve

Reply via email to