Cannot move notes across mount points

Steps to reproduce

Create a new empty folder.

mkdir ~/TheVault

Mount a temporary RAM disk inside a subfolder:

mkdir ~/TheVault/mounted

sudo mount -o size=1M -t tmpfs none ~/TheVault/mounted

Now, open the ~/TheVault as a vault in Obsidian.

In Obsidian create TheVault/mounted/ and try to move it to TheVault/

Did you follow the troubleshooting guide? [Y/N]


Expected result

The note is moved to the target folder.

Actual result

The file is not moved and no error is displayed to the user.


openSUSE Linux, KDE Plasma
Obsidian 1.5.8

Additional information

This problem happens on MacOS and Linux. This reduces the possibility of using the program in combination with network drives, mobile drives, encrypted drives.

Here is a clarification and solution to the problem: Obsidian just have to move files instead of renaming them.

Without that Obsidian does not implement the simplest file operation properly. For a program whose function is to organize notes, it is a drawback.

The link you pointed to refers to low level C system calls, but we are way up the abstraction stack. I am not sure what notejs uses.

There is also the problem of if/how directory watching event work when some subdirectories could be in a different device.

This is beyond what we currently support, so I don’t consider this a bug. You can open a Feature Request. Thanks

  • For me, event watching in Obsidian works quite well, even with such mount points. Changes to files are somehow quickly picked up in the GUI.
  • Moving a file between mount points is extremely simple (1) read the file content into a string (2) save the string to a new file (3) delete the old file. It does not require any low-level calls.
  • Obsidian doesn’t need to detect mount points. If we tried to move the file, but it didn’t move, this is probably the situation for a workaround, so we retry moving by read-write-delete.

I am not sure whether it a new feature. After all, this is not low-level support for sophisticated file systems. Just a fix for a semi-working move operation.

It’s very likely that Obsidian ends up using a low level move operation provided by the operating system, and these in general do not like to move files across mount points.

Although a move could theoretically be moved like you suggest, that would remove some file statistics, and potentially not be atomic changes and thusly allow for race condition issues. There are other reasons, but all in all its better for Obsidian to use the move operation they’re using.

Alas, that leaves you with the workaround of doing this operation manually through copy- paste like you suggest, or using the file system app to move files.

Without actually knowing this internal tidbit of Obsidian, I believe it considers any given vault to be within one file system and behaves accordingly. So having extra mount points within the vault can cause issues/features like this, which aren’t bugs per se, but would need a different base approach related to file handling.