I use two Linux Fedora notebooks and use a USB drive to access my Obsidian database on both of them. The USB drive is formatted with Ext4, which I use to keep the files password protected. The problem is that when I create a file on one PC, the other PC refuses to make any changes to it. I can partially bypass this issue by setting the permissions for enclosed files to allow others to access and modify them. However, when I create new files/notes on one PC, the other PC won’t change them because they don’t inherit the permissions I set for the previous files. Is there a way to solve this problem?
Using a device this way works best when the following config is done.
User ID is the same on both PCs (default on fedora is 1000 for the first user created)
The SELinux context is the same on both PCs for the mount point being used.
If the mount point is under /run/media/$USER/ then it should be mounted the same on both PCs. Often done with a file system label or uuid.
If mounted at a location under the users home directory the same applies.
We really cannot provide actual details since you did not provide information about the permissions on each pc with the shared device.
For better answers please provide the following for that device when mounted on each PC. ls -lhZ <mount point>/ so the ownership and selinux context of files may be seen. Also show the status of selinux with getenforce for each pc.
I’ll be interested in this post, since I also have an Obsidian database I’m building but will soon have multiple devices like your build. My idea was to :
Use syncthing so i can also add my Laptop, Desktop & phone into the mix
The device I use to connect to the other notebook is under user ID 1000, while the target user on the other notebook has user ID 1002. To ensure smooth data transfer, both users need to have the same username and user ID (1000); this will allow them to work without issues. Do I understand it correctly?
When it comes to syncing Obsidian, I prefer to handle it myself. Even though I have nothing to hide, I don’t want anyone else to access or store my data.
I have created two databases: one on my PC for my knowledge base and another on my smartphone for my projects and assignments. The community plugin KANBAN makes it very easy to create project lists with chronological assignment lists within the projects themselves. This means I essentially have two databases: one for knowledge and one for projects and assignments.
Why keep the projects and assignments database on my phone? Because I often need to manage tasks on the go, which allows me to mark assignments as finished and update project statuses wherever I am. Completing one assignment often provides additional information that helps complete the entire project. Since this usually happens while I’m out and about, my phone is my primary tool for managing assignments.
User name is really immaterial since that is used to map the name to the UID. UID is critical to allow both access without permission issues. The system uses UID to identify permissions and ownership.
If you have both users with the same UID then they both can access the content of that device with the same permissions.
Using ls -ln you can see the user and group IDs instead of the user & group names displayed.
Usually a file owned by a user with UID 1002 would not be accessible to a user with UID 1000 (and vice versa)
The same applies to group GIDs for ownership and permissions.
On whichever system you are changing the UID, you will need to be certain that their home directory content ownership has been changed to match as well or there will be other problems.
You also will need to change the content of the device containing the shared files so all the files have the same ownership (user & group) as well.
Read the man page for the chown command to see how that can be done easily
Thanks, L.S., for your contributions. I’ll save the guide and the website you provided for later. For now, I plan to reinstall Fedora on one of the notebooks, as I’m working on a step-by-step setup and tweak Linux guide for my Obsidian database. Its long overdue, and now I have a reason to do it.
Yeah, this is why I am looking strongly at syncthing again. This way I have control of the Obsidian files. As for the encryption, I disagree. We should all be encrypting our files, documents, thoughts, projects, Fictional stories you someday wish to publish. Especially on Smartphones ! GPG offers that simpicity and can be easily configured.
That’s a really great workflow ! Wish you all the best !
Hey Hammerhead, I overlooked the first time you mentioned that Syncthing is an actual app. I took a quick look at the description on the Syncthing website. Does it really only sync the devices you connect with each other? Until now, I knew nothing about such open-source solutions. This might be the compromise I’m willing to accept—syncing my devices directly without any corporate intermediaries or other parties involved. I know it’s a bit off-topic, but can you tell me more about the app and your experiences with it?
In the Linux App store there are 3 variants of the mentioned app:
Oh my friend. . . Syncthing is very good tool. So you basically install syncthing, on all the devices you need. and trhough the interface link them together. I’m giving you the 30,000m view btw. . .
For example : I had 2 machines. 1 machine sync’s the directories to the other machine ( The Living room workstation → ← Bed Room Workstation ) No matter the project the files were always in sync. So picking up at either place I knew where I was.
But. . . I set up a 3rd machine. It only received from the Living Room. it cannot talk back to update unless i set it up for back up purposes. So having a Home Obsidian sync a Phone Obsidian is easy. The cool back up is the 3rd machine wherever you have it. Personal cloud etc.
Right now, i would go with the .rpm because the flatpak has had issues with the update process. SyncthingGTK was the one I had many moons ago. The GUI was good to use.
dnf info syncthing
Available Packages
Name : syncthing
Version : 1.27.7
Release : 1.fc40
Architecture : x86_64
Size : 8.8 M
Source : syncthing-1.27.7-1.fc40.src.rpm
Repository : updates
Summary : Continuous File Synchronization
URL : https://syncthing.net
License : MPL-2.0 AND Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND CC-BY-3.0 AND ISC AND MIT AND OFL-1.1
Description : Syncthing replaces other file synchronization services with something
: open, trustworthy and decentralized. Your data is your data alone and
: you deserve to choose where it is stored, if it is shared with some
: third party and how it's transmitted over the Internet. Using syncthing,
: that control is returned to you.
:
: This package contains the syncthing client binary and systemd services.