Change Ownership of Disks

Simple question. I have a couple of internal ExFAT drives used in Windows, but I can’t write to the disks, it says that root has ownership, and when I try to use CHOWN to change ownership I get “Operation Not Permitted” the drive is mounted at /var/home/USER/Drives/DISK1

What gives?

edit: even logging in as root and trying to change the permission to user doesn’t work

Also just to add, I am really not trying ot be a jerk, this is a genuine question, and I am probably doing some stuff wrong: why would you in Linux by default make a mounted internal drive read only? Is there a reason for that? As a Mac and Windows user it is hard for me to wrap my head around.

Check that your drive is not mounted read-only (ro) using the mount command from the command line. If it is, remount it with read-write (rw) permissions.

On Atomic Desktops mounting volumes read-only is a key feature. This is how the ostree tools can assure data integrity when doing an update or rebase.

For a user (non-system) volume you can control “how” it is mounted (more than just permissions and mode) via its entry in /etc/fstab.

Take a look at man 5 fstab. What you want is the section titled The fourth field (fs_mntops).

There you can specify defaults, user, owner, etc.

The other fields are important to get right as well, but the 4th field is where the options I believe for which you are looking are specified.

Hope that helps.

2 Likes

When I connect external drives they are mounted read-write, so RO mounting isn’t intrinsic to atomic distros.
Perhaps it is because they are internal drives, or ExFAT and internal, that they are treated differently.

ChatGPT says add fstab entry like this. Change device, mount point, and uid,gid,dmode,fmode as necessary.
/dev/sdXn /mnt/exfat exfat defaults,uid=1000,gid=1000,dmode=775,fmode=664 0 0

Thanks for the great replies I will try them out.

uid and gid = 1000 worked, so that is great. Thank you all!

1 Like