You are not logged in.

#1 2021-09-29 04:18:11

DrLucky
Member
Registered: 2021-09-21
Posts: 23

[Solved]chown : failed to change ownership of {HHD} Operation not perm

I have several internal HHDs auto-mounted with /etc/fstab.
They are all mounted to individual directories inside /mnt.
All HHD files are marked

drwxr-xr-x root root

As a user in the wheel group, I can read from these files fine. I am trying to use chown to change ownership to my user so I can write to them as well.
I have tried chown after manually mounting them, manually mounting them within my /home/{user} directory, with sudo and as root.
Everything I've tried has given me:

chown: changing ownership of {directory}: Operation not permitted
failed to change ownership of {directory} from root to {user}

I feel I'm missing something basic here

Last edited by DrLucky (2021-09-29 19:44:06)

Offline

#2 2021-09-29 05:27:23

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,680

Re: [Solved]chown : failed to change ownership of {HHD} Operation not perm

What filesystem? "DOS" filesystems don't support the notion of ownership and you need to specify the owner as arguments to mount. See the wiki.

Offline

#3 2021-09-29 06:01:34

DrLucky
Member
Registered: 2021-09-21
Posts: 23

Re: [Solved]chown : failed to change ownership of {HHD} Operation not perm

the file system is exfat as these used to be files made on a Windows machine, I set up the drives this way for support between both since I am dual booting Arch and Win10

Last edited by DrLucky (2021-09-29 06:07:48)

Offline

#4 2021-09-29 06:07:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,302

Re: [Solved]chown : failed to change ownership of {HHD} Operation not perm

Pass the uid= and gid= you want the mount to be as part of the mount options

Offline

#5 2021-09-29 06:09:37

DrLucky
Member
Registered: 2021-09-21
Posts: 23

Re: [Solved]chown : failed to change ownership of {HHD} Operation not perm

V1del wrote:

Pass the uid= and gid= you want the mount to be as part of the mount options

In my fstab file, correct?

Offline

#6 2021-09-29 06:22:40

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,302

Re: [Solved]chown : failed to change ownership of {HHD} Operation not perm

yes

Offline

#7 2021-09-29 07:16:50

DrLucky
Member
Registered: 2021-09-21
Posts: 23

Re: [Solved]chown : failed to change ownership of {HHD} Operation not perm

Thank you so much! That worked

I looked up my uid and gid with a simple "id" command

I changed my fstab line from

 /dev/sdb2               /mnt/4tb        exfat     defaults     0 2

to

 /dev/sdb2               /mnt/4tb        exfat           rw,uid=1000,gid=1000,nofail             0 2


(also, I am aware I should be using the UUIDs instead for the partition location, I plan to do that next)

Last edited by DrLucky (2021-09-29 19:43:28)

Offline

Board footer

Powered by FluxBB