Score:0

Correct ownership and permissions of /media folder and folders of external drives

jm flag

I was trying to run a synchronization program to sync files on a drive and on my computer. The synchronization program said it could not access the files on the USB drive. I changed the permissions and ownership of folders and files in /media/ and now I cannot access them or seem to change them. It renders all external media unavailable. Yep I messed up badly. I suppose that I need to set the permissions correctly again, but I am not sure what "correctly" should be.

Some info:

ls -l /media/
     ls: cannot open directory '/media/': Permission denied
sudo ls -l /media/
     total 4
     drw-rw----+ 4 root root 4096 Nov 12 18:16 timothy
sudo ls -l /media/timothy
     total 132
     drwxr-xr-x 25 timothy timothy 1048576 Nov 12 18:16  AVON
     drwxrwxrwx  1 timothy timothy    4096 Jul 27  2018 'Seagate Backup Plus Drive'

and as an example for an external drive:

sudo ls -l /media/timothy/AVON
     drwxr-xr-x   2 timothy timothy

I don't know what these should really be. Thank you in advance for any help! Timothy

cn flag
You forgot to show us the filesystem used on it. If EXT timothy needs to be owned by timothy:timothy doing `sudo chown timothy:timothy timothy` It also needs executable permission for at least the owner `sudo chmod 750 timothy` is a method for that.
Tim X avatar
jm flag
I am not sure what you mean with the filesystem used on it, sorry. The external drive AVON, is an exFAT system, if that is what you mean? The Seagate is an NTFS system. Wait, perhaps you meant under AVON. Well there are lots of files, I just gave you the start to each of the lines: `code` sudo ls -l /media/timothy/AVON drwxr-xr-x 2 timothy timothy 1048576 Feb 18 2022 '$RECYCLE.BIN' ... `code`
cn flag
" I changed the permissions and ownership of folders and files in /media/" is not possible on windows filesystems. Windows filesystems permissions you set when mounting so check your mount settings for this device
Score:0
jm flag

Ok, I solved it.

The permissions for "media" needed to be drwxr-xr-x, which I achieved with:

chmod 750 media

Now everything works alright again. Thanks @Rinzwind, you were right that the problem was not permissions of folders within media but with the permissions of the directory "media" itself.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.