Mongodb – Share mongo database between two OS on dual boot

linuxmongodbwindows

Now I have two OS on my computer: Windows 10 and Linux (arch). Sometimes I use Linux but I also use windows because of gaming, and I want to create a small application that is going to work on both OS. I want to know if it is possible to share a Mongo database with all its collections and indexes between the two OS.

This is something I want on my computer for personal usage, it is just a small application, but it creates a lot of documents and some indexes. Also, I will be adding Indexes frequently.

I can not use any external server or machines to store the DB, because the application should work offline. I don't want to migrate the DB from one system to another every time I boot my computer using mongoexport because that takes time and recreates the indexes.

Best Answer

In theory, YES... If your mongod dbpath is at partition what both sides can read and write. So, you cannot use linux partitions (ext2,ext3,ext4,...) because your windows don't know how to handle. It's better not to use ntfs at windows side, because linux don't always handle ntfs right. So, solution is use older vfat32 partition type. Both sides can handle that well.