LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 09-17-2022, 05:06 PM   #1
mstrimel
Member
 
Registered: Apr 2004
Location: USA
Distribution: Mint 19 Cinnamon
Posts: 75

Rep: Reputation: 0
Can't change ownership of file, even using sudo


Hello,
I have an external USB drive on which I created a exFAT partition. I mounted it at /media/filestogo and after chmod'ing that directory to 777. When I try to copy files to that directory in Nautilus, I get the error that I do not have permission. So, I tried to chown the directory /media/filestogo to user mary. However I get an error:
Code:
mary@mythbox:~]$ ls -la /media/filestogo
total 132
drwxr-xr-x. 2 root root 131072 Sep 17 17:52 .
drwxr-xr-x. 9 root mary   4096 Sep 17 17:50 ..
[Sat Sep 17 18:05:12]
mary@mythbox:~]$ sudo chown mary /media/filestogo
chown: changing ownership of '/media/filestogo': Operation not permitted
[Sat Sep 17 18:05:22]
What am I doing wrong? I checked the mount options of the USB drive and it is mounted rw.
Thanks,
Mary
 
Old 09-17-2022, 05:17 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
I'd suspect exFAT does not support UNIX style permissions and ownership. Perhaps you can mount it as user mary, then ownership should change, methinks.
 
Old 09-17-2022, 05:19 PM   #3
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Can't change ownership of file, even using sudo

What options did you use in your mount command?
 
Old 09-17-2022, 06:42 PM   #4
mstrimel
Member
 
Registered: Apr 2004
Location: USA
Distribution: Mint 19 Cinnamon
Posts: 75

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Emerson View Post
I'd suspect exFAT does not support UNIX style permissions and ownership. Perhaps you can mount it as user mary, then ownership should change, methinks.
Thank you, that was the solution. I changed the /etc/fstab file to specify "user" as an option.
 
Old 09-17-2022, 09:05 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Just as an aside, Emerson is correct. Non-*nix filesystems do not recognize/support Linux permissions.

Last edited by frankbell; 09-17-2022 at 09:07 PM.
 
Old 09-17-2022, 09:19 PM   #6
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
I haven't used non-nix filesystems for so long (15+ years) I really wasn't sure what is the best way to solve this and I had nothing to try it on.
 
Old 09-17-2022, 09:42 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
It's something I learned along the way, but so long ago I can't cite a source.
 
Old 09-17-2022, 11:44 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
FAT/exFAT and NTFS (Microsoft) file systems don't support Linux user and group permissions. These are essentially faked by the kernel when mounted.

For more info refer
Code:
man mount.exfat
https://www.systutorials.com/docs/li...8-mount.exfat/
Code:
man mount.ntfs
https://www.systutorials.com/docs/li.../8-mount.ntfs/
 
Old 09-25-2022, 08:25 AM   #9
shevegen
Member
 
Registered: May 2004
Distribution: Slackware / GoboLinux / LFS / VoidLinux
Posts: 145

Rep: Reputation: 26
Interesting - I never knew about mount.exfat. This may
explain similar errors I got in the past.

I found the thread here via a google search.

Would be great if the whole Linux stack would be more
"clever"; would help avoid me having to google, with
a better "live" documentation system as-is.
 
Old 09-25-2022, 09:48 AM   #10
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
'mount' command calls 'mount.<filesystem>', you will be using mount.exfat when you mount exfat filesystem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Differences between Su, Sudo Su, Sudo -s and Sudo -i LXer Syndicated Linux News 0 09-15-2022 07:47 PM
LXer: The Ultimate Sudo FAQ — To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
Root ownership vs wheel ownership StupidNewbie Linux - Security 2 08-08-2012 12:52 PM
[SOLVED] How can I change file permissions in windows ntfs partition.Even root can't change it e3399 Linux - Newbie 3 03-02-2011 10:54 PM
sudo: How can i change the ownership of particular files? anoopp Linux - Security 1 03-18-2005 02:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration