Context
I do programming on a) a Mac computer, and b) an Ubuntu computer running off a 1 TB HDD that I boot from the Mac via USB. This works completely fine. However, I have my code on a 16GB FAT32 partition so I can write code from both computers. This works fine on the Mac, but I run into a problem on Ubuntu.
Problem
In VSCode on Ubuntu, when I attempt to do anything to the mounted partition (edit, rename, create, etc.) I get some sort of error.
When I try to create a new file:
Unable to write file (NoPermissions (FileSystemError): Error: EACCES: permission denied, open)
When I try to edit a file, I am prompted to "Retry as sudo," which works, but I have to enter my password anytime I edit any file, which is extremely inconvenient.
When I try to create a new directory, I get
Error: EACCES: permission denied, mkdir
et cetera
Details
I used sudo mount /dev/sda1 ~/src
to mount the drive.
I am running Ubuntu 20.04.
My VSCode version is 1.46.1
Attempts to resolve
I tried the following:
sudo chmod a+rw ~/src
This above one doesn't throw any error, but it doesn't solve the problem either.
In: sudo chown $USER:$USER -R ~/src
Out: "chown: changing ownership of '~/src': Operation not permitted"
When I tried these solutions, I unmounted and remounted the drive and restarted VSCode but they still didn't do anything.
I also read the following related questions:
- Change folder permissions and ownership
- mkdir "Permission denied' on mounted drive
- EACCES: permission denied in VS Code MAC
- Failed to save file, EACCESS permision denied
- Failed to save 'file': A system error occured (EACCES: permission denied, open 'file path')
- ERROR: "Failed to save. Insufficient permissions." When trying to save changes in VS Code
Running VSCode as sudo does work, but this is rather tedious and, from all the warnings I get when trying to do it, I imagine it's probably not a good idea.
Any help would be greatly appreciated and I am happy to answer any questions. Thanks!