How to set the owner of a mounted partition in Linux?
You should NOT touch /dev/sd* permissions (I'm not talking about /media/sda4
). If you did change them, please undo your changes and use the default permissions, because it can interfere with other programs. (I think the default owner/group are root:disk
)
You have to unmount the disk first in order to change the permissions of the mount folder /media/Disk
.
umount /media/Disk
chown aswin:aswin /media/Disk
mount -va
In order to mount the disk contents with a specific user/group id, you can set a specific uid/gid (User ID and Group ID) within /etc/fstab
. See Linux - Mount device with specific user rights
Also, you have other solutions other than fstab, meaning GUI-based gnome environment:
gvfs-mount -d /dev/sdXY
...where it mounts the sdXY (change "X" and "Y" with the appropriate letter&number) partition and sets the user as the owner. Gnome environment also allows to click on a partition on the left side menu of nautilus (the file manager) and it auto-mounts the partition.