Problem changing owner and permissions on new external drive
I just installed a new 2TB external drive (Ubuntu 20.04), created one partition, and formatted it to ext4. I mounted it to /mnt/ssk2TB. Now the drive shows in my Nautilus file explorer, but when I use copy-paste to copy a file to the new drive, I get "permissions do now allow copy-paste."
So I changed the owner from root to my sudo user:
chown -R mpxt /mnt/ssk2TB
root@mpxt-Vostro-3400:/mnt/ssk2TB# ls -l
total 16
drwx------ 2 mpxt root 16384 Nov 20 10:07 lost+found
So now the drive is owned by mpxt, not root. Next I changed the permissions:
chmod -R 755 /mnt/ssk2TB
root@mpxt-Vostro-3400:/mnt/ssk2TB# ls -l
total 16
drwxr-xr-x 2 mpxt root 16384 Nov 20 10:07 lost+found
root@mpxt
So now the permissions have been expanded. BUT I still am not allowed to copy-paste from Nautilus.
What else do I need to do?
Check this:
$ cat /etc/group | sed -nre "s/$USER:.*:([0-9]+)./$USER:1/p"
Extract the single line that contains a numeric group ID attached to your user name
I’d guess it will print
mpxt:1000
With that knowledge, do
$ sudo chown -R mpxt:1000 /mnt/ssk2TB
…. replace mpxt:1000
with what actually was printed above.
For purists:
$ sed -nre "s/$USER:.*:([0-9]+)./$USER:1/p" < /etc/group
Works just as well as that first line. But requires slightly more Linux/Bash knowledge.