0

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.

  1. When I try to create a new file: Unable to write file (NoPermissions (FileSystemError): Error: EACCES: permission denied, open)

  2. 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.

  3. When I try to create a new directory, I get Error: EACCES: permission denied, mkdir

  4. 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:

  1. Change folder permissions and ownership
  2. mkdir "Permission denied' on mounted drive
  3. EACCES: permission denied in VS Code MAC
  4. Failed to save file, EACCESS permision denied
  5. Failed to save 'file': A system error occured (EACCES: permission denied, open 'file path')
  6. 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!

1 Answer 1

0

If you have this issue as well, try mounting your drive using the following command:

sudo mount -o uid=$(id -u),gid=$(id -g),umask=0000 /dev/sda1 ~/src

Source: this answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .