duplicacy icon indicating copy to clipboard operation
duplicacy copied to clipboard

-pref-dir being ignored

Open dave-fl opened this issue 6 years ago • 4 comments

Hi there,

I am trying to backup a read only file system. When using pref-dir it seems like the file is being ignored. Here is the command I am running, note that it is trying to write to the file system. Why?

root@debian-8:/main/documents# duplicacy init -pref-dir /backup/preferences/documents main-documents /backup/test/documents/ Failed to write /main/documents/.duplicacy file inside repository open /main/documents/.duplicacy: read-only file system

dave-fl avatar Mar 09 '18 22:03 dave-fl

Unfortunately this will not work. Duplicacy needs to write the either the ".duplicacy" file or ".duplicacy/" folder in the repository root. The pref-dir will save the prefs in the location defined, but it still needs to create a file (so that it can point to the pref-dir destination) in the repository root. I think you have two options:

  • mount the filesystem as writeable once only, so that init can create its .duplicacy file. Thereafter could be mounted as read only.
  • init your repository in a directory that contains a symlink to your read only file system, that way the .duplicacy file is outside of the intended filesystem.

I hope that makes sense, I know it was a bit confusing to learn myself.

williamgs avatar Mar 09 '18 22:03 williamgs

Symlink should work. But kind of weird! Should support putting the data elsewhere.

dave-fl avatar Mar 09 '18 23:03 dave-fl

I wrote the -pref-dir implementation. Williangs is right

Dealing with readonly "to-be-backup-ed" data would require passing the "pref-dir" location to each and every duplicacy execution related to this repository. so the trade off is mount it rw once for duplicacy init -pref-dir then you can mount it read only for all the other execution

I'd also like to have my source data mounted readonly ( duplicacy runs in a docker container on my system). My current idea is to use the overlayfs filesystem INSIDE the container and "stacking" the source data and the .duplicacy directory before running duplicacy. We'll see where it goes !

ech1965 avatar Mar 12 '18 21:03 ech1965

Is it bad practice to use a single repository for the root of a drive? If not, I'm wondering if macOS Catalina changes anyone's opinion on this.

In Catalina, the root volume is read-only by default, and even root privileges can't be used to remount it as read-write. Instead, you have to boot into a macOS recovery partition and use csrutil to disable system integrity protection, after which can you reboot and remount the root volume as rw. I suppose you could then re-enable SIP, but that doesn't make the workaround any less annoying.

rpendleton avatar Dec 29 '19 05:12 rpendleton