Can Rsync Mirror A Drive?

  • Hi all, I have OMV 6 running on a Raspberry Pi with dual SSDs to backup a few laptops. One drive is shared on the network, the other is intended to be a mirror and is not shared. The drives are connected via USB so I'm using Rsync to pass updates. The Rsync job is scheduled to run once daily, and I just noticed that the destination drive now holds more data than the source drive, which I wasn't expecting. The shared drive contains ~650GB and the destination drive is now at ~690GB.


    Is it possible to use Rsync to basically mirror a drive? And if so, what config changes do I need to make? Any tips or documentation would be helpful.

  • votdev

    Approved the thread.
  • Hi all, I have OMV 6 running on a Raspberry Pi with dual SSDs to backup a few laptops. One drive is shared on the network, the other is intended to be a mirror and is not shared. The drives are connected via USB so I'm using Rsync to pass updates. The Rsync job is scheduled to run once daily, and I just noticed that the destination drive now holds more data than the source drive, which I wasn't expecting. The shared drive contains ~650GB and the destination drive is now at ~690GB.


    Is it possible to use Rsync to basically mirror a drive? And if so, what config changes do I need to make? Any tips or documentation would be helpful.

    It could still have "stuff" you deleted on the main drive. which rSync once transfered


    I deleted a folder the other day about 500gb so my Media drive shows 10.6TB my media Backup shows 12TB im guessing there is stuff ive deleted in the past still on it.

    • Official Post

    Thanks, I believe you're right. Do you know of a way to prevent this? I basically want a mirror if that's possible. Otherwise I'm going to run out of capacity on the secondary drive.

    To keep the drives 100% in sync, you would have to enable the delete trigger on the job.


    When the job runs, anything that is not in the "source" folder, would be deleted in the "destination"

    • Official Post

    In the rsync setup there is an option Delete -> Delete files on the receiving side that don't exist on sender


    That would solve the additional space, however, the objective of rsync is to backup from one location to another, so if you set that the file is deleted from both sides.

    • Official Post

    In the rsync setup there is an option Delete -> Delete files on the receiving side that don't exist on sender


    That would solve the additional space, however, the objective of rsync is to backup from one location to another, so if you set that the file is deleted from both sides.

    Agree.


    I use rsync a lot, and I leave the delete trigger off. If I start to notice a large disparity between the two filesystems, I just log in, enable the delete trigger, and manually run it... when it's done, I disable it again.


    This provides an added benefit if I accidentally delete something.. even if the rsync job has already ran... I can just SSH in, copy the file from my backup, to my source, and problem solved (I do not expose my backup drive to anything but rsync.. no SMB, no NFS, etc.)

    • Official Post

    I use rsync a lot, and I leave the delete trigger off. If I start to notice a large disparity between the two filesystems, I just log in, enable the delete trigger, and manually run it... when it's done, I disable it again

    (I do not expose my backup drive to anything but rsync.. no SMB, no NFS, etc.)

    8| that's exactly what I do, I never realised it was so obvious until now :D :D

  • That would solve the additional space, however, the objective of rsync is to backup from one location to another, so if you set that the file is deleted from both sides.

    Thanks for all of the replies. It's helpful to think through this. This wasn't what I had in mind when I created the NAS, but I'm new to this so still learning. I'll let it run as-is for a couple of weeks to assess how quickly the slave drive is filling up.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!