Rsync & /dev

David Gibson david at gibson.dropbear.id.au
Tue Jan 15 11:40:03 EST 2002


On Tue, Jan 15, 2002 at 10:02:32AM +1100, Howard Lowndes wrote:
> Can anyone advise me whether rsync can sync devices as opposed to
> filesystems.
> 
> I have a set of disk partitions that contain a foreign file system not
> listed in fdisk and I would like to sync them so I need to do something
> like:
> 	rsync /dev/hda1 /dev/hdc1
> where both hda1 and hdc1 will be foreign filesystems.
> 
> Is this possible?

Not easily with rsync.  rsync creates the destination as a new,
temporary file then moves it onto the actual target.  So you can't do
it directly onto a device.  It has to do this because the rsync
algorithm relies on random access to the target's base file.

> Alternatively would dd do it for me?

It would copy it (assuming the second partition is at least as big as
the first), but it would copy the entire partitions's contents.

-- 
David Gibson			| For every complex problem there is a
david at gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.  -- H.L. Mencken
http://www.ozlabs.org/people/dgibson





More information about the linux mailing list