Welcome to Server Circle. It's a friendly site and all levels of experience are welcome. Be aware that we use cookies for your login.
Server Circle - Ask questions about Servers and get answers from experts.
Beta (0.51 sec)
Mirror a drive in Ubuntu Server without using RAID

I have an Ubuntu Server running Lucid Lynx with two drives in it.

I backup changing data offsite and I don't want the complexities of using RAID.

I'd like to use rsync to copy the entire contents of the primary drive to the identical second drive every now and again in case something on the OS fails or gets corrupted (or the primary drive just fails). Then I can just boot off the secondary drive as if everything was still the same (at the time of the last rsync copy).

How do I go about doing this ? Help much appreciated.

Asked by:
JackFlash
378 points
 Report Abuse
 Share Page - Category: Ubuntu Linux - Tags: Mirror a drive in Ubuntu Server without using RAID
 Enter your response
Please use Pastie.org to paste lengthy code or to fix formatting issues with code
  • Responses in reverse (1)

Best Answer

Working on the basis that you've got your backup drive mounted on /backup you'll probably want something like:

rsync -ar --exclude "/backup/*" --exclude "/proc/* --exclude "/sys/*" / /backup/

This will generate the backup.

Grub only needs setting up once on the drive as it reads from /boot/grub to get the settings, unlike lilo which writes the config to the boot sector.

Running grub and getting the grub console you should be able to do:

grub> root (hd1,0)

grub> setup (hd1)

grub> quit

This will set your 2nd drive to boot from its 1st partition.

You can then run the rsync whenever you want, if you update grub I'd recommend running the grub procedure again.

Response by:
_SteveWilson ...
4290 points


  • Related Questions
About Us : Contact Us : Etiquette : Terms : CDN Failover : ShorterURL : CDN Fallback : © 2014 Server Circle