I need help rsyncing Local Disks

Dan Pritts danno at internet2.edu
Tue Jun 15 15:50:33 GMT 2004

On Mon, Jun 14, 2004 at 09:39:04AM -0700, Marshall28 wrote:
> 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.

This script looks like it has assumed that you have four partitions
"rootfs usr data data2".  Probably "rootfs" is really the / partition,
which the script author has somehow (outside the context of this
script) made available under "/rootfs" (a symbolic link /rootfs pointing
to / might do the trick).

It also assumes that the /etc/fstab file has entries for the duplicate
disk, with mount points under /backup.

If you have differently named partitions you would want to put the
names in LIST.  You'll also have to resolve the "rootfs" issue.

Note that one thing that this method will NOT accomplish is to update
your boot loader if you install a new kernel.  

the -x option to rsync tells it not to cross filesystem boundaries,
so that each partition on the master disk is copied to the
same partition on the duplicate disk.

Suggest you get yourself a good system administration book, which
will explain these concepts in good depth.  I recommend "unix system
administration handbook" by nemeth et. al.  I think they now have a
linux-specific version of the book called "linux system administration

> 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:
> #!/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

dan pritts                                       danno at internet2.edu
systems administrator                            734/352-4953 office
internet2                                        734/834-7224 mobile

More information about the rsync mailing list