Change dbPath on Ubuntu

What are the permissions on the /media/[user]/[win10 partition]/data/db folder? My guess is they are wide open as well, but worth checking.

MongoDB is trying to access the lock file but it can’t because the permissions of the file are rw by the owner only. You could try removing the mongod.lock file to see if you can start the service in Linux. I am not sure how that would affect things when you go back to your Windows version however.

I get what you’re trying to do having MongoDB available no matter whether you boot into Windows or Linux, but I’m not sure that’s going to work well. If you have Windows 10 and enabled WSL this might work a little more smoothly as you’d have the same permissions and owners between the two systems. Trying to get the permissions on the files correctly and in a way that doesn’t affect the other OS might be more hassle than it’s worth.

A couple of options that might be a better choice:

  • If your database is going to stay smaller than 512MB you could get a free tier M0 Atlas cluster.
  • You could run docker containers on both Windows and Ubuntu and use a persistent volume that is stored in a path that is accessible to both operating systems.

Unfortunately I don’t have a dual boot Windows machine so I’m not able to test things out to see what would be needed to make this work on your set up.

2 Likes