I need help rsyncing Local Disks

Chris Shoemaker c.shoemaker at cox.net
Wed Jul 14 21:09:35 GMT 2004

On Mon, Jun 14, 2004 at 09:39:04AM -0700, Marshall28 wrote:
> Recently I've found out about rsync and wanted to use this to mirror local
> disks on one of my servers. I first ran Ghost for Linux to get the exact
> clone I was looking for, and now I'm ready to setup rsync to keep my drives
> mirrored on a continual basis. Here's my setup:
> 1 Seagate 4.6GB SCSI on /dev/sda, mounted like this:
> 	/dev/sda1 ==> /boot - 101M
> 	/dev/sda2 ==> swap - 269M
> 	/dev/sda3 ==> / - 3.9GB
> 1 Seagate 16GB SCSI on /dev/sdb has the same look due to the ghost for linux
> clone but I need help on how I should keep this drive sync'd with the main
> SCSI disk, sda. I saw the script on rsync.samba.org for backing up to a
> spare disk but need some help understanding the coding, as well as knowing
> if this script will provide me with another spare disk that is a replica of
> the primary. From what I can make of this script it doesn't mirror the
> drive, it only mirrors these: rootfs, usr, data, and data2.
> If this script does replicate disks then he first part of it is really what
> I'd be looking to do. In my case I would need to mount /dev/sdb1 as "/boot"
> and /dev/sdb3 as "/" somewhere. Whatever tips/insight you guys can provide
> on this would be much appreciated. Here's the script:

rsync operates on filesystems, not partitions nor disks.  So, yes, you
would need to mount the partitions somewhere, e.g. /mnt/oldroot,
/mnt/oldboot, and rsync between new directories and old.


> #!/bin/sh
>     export PATH=/usr/local/bin:/usr/bin:/bin
>     LIST="rootfs usr data data2"
>     for d in $LIST; do
> 	mount /backup/$d
> 	rsync -ax --exclude fstab --delete /$d/ /backup/$d/
> 	umount /backup/$d
>     done
> thanks
> marshall
> -- 
> To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

More information about the rsync mailing list