I have two linux computers:
- personal (arch, full root access)
- workplace (ubuntu, no root access).
I am using "Unison" to sync some selected directories from one computer to an ext4 USB stick, and then moving the USB stick to the other computer and copying from that USB stick this other computer.
The UID of the user on my personal machine is the same as the UID of the sysadmin on the work machine, and both users got a umask of 0022 (edit: the users also happen to have different usernames).
I did not use any special settings for unison initially, and there have been some issues with permissions between the two computers.
Yesterday I noticed that on my personal machine, I could not open a file created on the work machine. I decided to switch to the perms = 0 setting on my Unison profile, and now things seem rather messed up.
What would be the optimal way to handle this situation here? Should I start syncing anew with perms=0 from the start, or is there another Unison setting (or combination of settings) that would enable this setup to work smoothly? Would it also be beneficial if I change the filesystem of the usb stick to exFAT to avoid such issues?
Update:
Trying to create a reproducible example (without perms=0).
- I have a directory named
test, created on the personal machine with filesystem typeext4, and synced to the flash drive. - I sync it from the flash drive to a
testdir, created on the work machine's home dir, also on anext4filesystem. - Create a simple .odt file on work machine, within the
testdir.
So far, from the work machine, we got:
❯ la /media/u0183918/sandisk256/test # Flash drive total 8.0K drwxrwx--- 2 sysmn gdm 4.0K Nov 26 09:44 figures/ drwxrwx--- 2 sysmn gdm 4.0K Nov 25 14:15 supplementary_code/ u0183918@set-l-lm25udx9w ~ ❯ ls -ld /media/u0183918/sandisk256/test drwxr-xr-x 4 sysmn gdm 4096 Nov 26 09:37 /media/u0183918/sandisk256/test/ ❯ la ~/test total 20K drwxrwx--- 2 u0183918 domain users 4.0K Nov 26 09:44 figures/ drwxrwx--- 2 u0183918 domain users 4.0K Nov 26 09:43 supplementary_code/ -rw-r--r-- 1 u0183918 domain users 8.7K Nov 26 09:46 testfile.odt ❯ ls -ld ~/test drwxr-xr-x 4 u0183918 domain users 4096 Nov 26 09:46 /home/u0183918/test/ - After creating
testfile.odt, I try to sync again:
❯ unison ~/test /media/u0183918/sandisk256/test/ Unison 2.53.7 (ocaml 5.2.0): Contacting server... Looking for changes Reconciling changes u0183918/... sandisk25... new file ----> testfile.odt [f] 1 items will be synced, 0 skipped 8.7 KiB to be synced from u0183918/test to sandisk256/test 0 B to be synced from sandisk256/test to u0183918/test Proceed with propagating updates? [] No default command [type '?' or F1 for help] Proceed with propagating updates? [] y Propagating updates Unison 2.53.7 (ocaml 5.2.0) started propagating changes at 09:56:05.91 on 26 Nov 2025 [BGN] Copying testfile.odt from /home/u0183918/test to /media/u0183918/sandisk256/test Failed [testfile.odt]: Error in copying locally: Permission denied [open(/media/u0183918/sandisk256/test/.unison.testfile.odt.ed66d4eef79419d08dc915c1bfb9a751.unison.tmp)] Unison 2.53.7 (ocaml 5.2.0) finished propagating changes at 09:56:05.91 on 26 Nov 2025, 0.000 s Saving synchronizer state Synchronization incomplete at 09:56:05 (0 items transferred, 0 skipped, 1 failed) failed: testfile.odt Replacing unison with rsync -auv leads to similar permission issues.