rsync syntax question
Rick Stevens
rstevens at vitalstream.com
Mon Apr 25 17:28:40 UTC 2005
Scott Mertens wrote:
> I have been told that rsync is much better than dump to copy one drive
> to another. I want to copy sda and sda1 to sdb Both drives on one
> RHEL4 machine. I thought I would use the syntax of
>
> "rsync -avz / /mnt/Backup"
>
> Hers is a problem I'm thinking about, /mnt/Backup is a second drive
> mounted (SDB). I am thinking that as rsync copies the tree - when it
> gets to the mounted drive it is copying from /mnt/Backup to /mnt/Backup.
> This it seems to me would put rsync into an infinite loop?
>
> This second drive is only for backup purposes, so if it can be excluded
> from being backed up, thats OK.
>
> Does the syntax look OK, and will it copy both sda and sda1?
There is a fundamental difference between dump (or dd) and rsync. dump
and dd are _block-level_ dumps (they don't care about filesystems, they
copy raw blocks). rsync is a _file-level_ synchronizer. The idea is
to make the target's filesystem tree look like the source tree.
You need to create filesystems on sdb that are the same size or larger
(if possible) as those on sda and mount them somewhere. Then you
should:
rsync -lrpogx /source/filesystem /destination/filesystem
for each source partition. Remember, this is a file level copy, not
a block level dump!
Also look carefully at the "-l" and related options for symlinks in the
rsync man page...they can bite you if you aren't careful.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer rstevens at vitalstream.com -
- VitalStream, Inc. http://www.vitalstream.com -
- -
- Batteries not included. Offer not valid in some states. -
- Your mileage may vary. Void where prohibited. -
----------------------------------------------------------------------
More information about the Redhat-install-list
mailing list