I use rsync to clone my internal hdd to an external disk. My system is Arch Linux.

I have two partitions:

  • /
  • /data

I am using the following rsync command:

rsync -avzxt --progress --delete --exclude="/mnt/" --exclude="/media/" / /mnt/backup/bakmir02/

(actually I had some more excludes like tmp etc., but I removed most of them to be able to localize the mistake, so just for testing purposes -- I will readd them later)

It copies the root directory just as it is supposed to; but it ignores the content of my data partition. It creates the directory on the target drive, but it stays empty.

The reason does not seem to be an exclude as I have removed all of them except for the mnt and media directories which would not be very nice to clone ...

What could be the reason for this strange behaviour? I have used rsync on many systems for backups already and never had such a problem.

Edit Running

rsync -avzxt --progress --delete /data /mnt/backup/bakmir02/

is working. Still I do not understand the reason of this behaviour; especially I am thinking about if rsync is ignoring other files also.

  • just a guess, try adding /data after / in command line. – Archemar Feb 1 '15 at 10:04
  • I've tried that and that works. Would be an option to run a second rsync command; but still I do not understand this behaviour of rsync. – PDev Feb 1 '15 at 10:10
  • maybe rsync use find -xdev ... and thus; will not cross mount point. (I've tried looking at man rsync on my OpensSuse 13.1 but that is unclear) – Archemar Feb 1 '15 at 10:13
  • on my old system I had a data partition too, and never had any problems with rsync; but there it was an ntfs partition, now it is ext4 -- could that be the reason? – PDev Feb 1 '15 at 10:15
  • 1
    Please don't add solutions to the question, make up an answer, answering own questions is perfectly fine. – bummi Feb 1 '15 at 10:20

Problem was the parameter -x which is alias to the parameter --one-file-system. That parameter prevents rsync from copying other partitions mounted somewhere in the location which should be copied.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.