0

This is an ext4 fs and I am unable to gain permissions over the directory with the postgres user:

mud@mud-i7-32gb:~$ sudo mount /dev/sdc1 /media/mud/ssd128

mud@mud-i7-32gb:~$ ls -l /media/mud/ssd128/

total 20

drwxr-xr-x 2 root root 16384 דצמ 20 22:15 lost+found

drwxr-xr-x 2 postgres postgres 4096 דצמ 21 10:45 pgdata

mud@mud-i7-32gb:~$ sudo chown postgres:postgres /media/mud/ssd128/pgdata

mud@mud-i7-32gb:~$ sudo su postgres

postgres@mud-i7-32gb:/home/mud$ ls -l /media/mud/ssd128/pgdata

ls: cannot access /media/mud/ssd128/pgdata: Permission denied

What did I do wrong?

Avia
  • 121
  • 3

2 Answers2

0

Please try below method to mount disk

Find drive UUID with below command

blkid /dev/sdc1

Then Open /etc/fstab

gksu gedit /etc/fstab

Append below line at the end (replace UUID in below command with your UUID got from blkid command)

UUID=12102C02102CEB83 /media/mud/ssd128 ntfs-3g auto,users,permissions 0 0

Save and close the file and execute the mount command to mount disk.

mount -a

Now try to change permissions/owner. it should work for you

Vaibhav Panmand
  • 1,038
  • 7
  • 17
0

EDIT - due to unclear answer

What eventually worked was:

The /media/mud/ssd128 was under root :( - I changed it to my user which is mud instead of root

Avia
  • 121
  • 3