[SOLVED]caja 1.6.1: Error while copying: Dest is read-only

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
beausoleil

[SOLVED]caja 1.6.1: Error while copying: Dest is read-only

Post by beausoleil »

In Mint 15 with MATE, Caja 1.6.1 is giving a destination read-only error when copying files to an SD memory card formatted with exfat in my Dell Latitude E6500. The automount process is mounting the card as owned by root. I went ahead and added the following to /etc/fstab, then unmounted, removed and re-inserted the card.

Code: Select all

UUID=985A-5552  /media/USER/LABEL exfat user,uid=1000,gid=100,dmask=027,fmask=137  0  0
The card mounted as owned by me, with group "users". But caja would still give the same error message - even though I could copy and create files from the bash command line.

The really weird thing happened next: I unmounted the card and logged out. I re-logged in, but this time with XFCE. I commented out the line above in /etc/fstab, then re-inserted the card.

Code: Select all

/dev/mmcblk0p1 on /media/USER/LABEL type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
The card mounted owned by root - but Thunar copied files to it without a problem.

What should the file permissions be of /media/USER? Right now, it's owned by root, and there are extended attributes (+):

Code: Select all

USER@USER-Latitude /media/USER $ ls -la
total 40
drwxr-x---+ 3 root root  4096 Dec  3 09:33 .
drwxr-xr-x  5 root root  4096 Oct 16 10:08 ..
drwxr-xr-x  1 root root 32768 Dec  3 09:34 LABEL
Further, all directories and files on the card are owned by root, yet Thunar lets me copy files to it.

I used getfacl to see the ACL - my userid has "r-x" What gives? I have read privileges, but Thunar seems to ignore them...

Things were working fine a couple of weeks ago. The only thing I can think of was my nephew tried mounting the card on his MacBook Pro, but since he didn't have an exfat driver installed, he couldn't mount or read it. Nothing other than recent updates to Mint 15 had been done. Does Thunar ignore ACLs? Does an ACL on the mount point carry down into the directory structure? I didn't think exfat supported ACLs.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: caja 1.6.1: Error while copying: Destination is read-onl

Post by altair4 »

I've never mounted anything as exfat before so I can't comment on that but /media/$USER is a system generated directory and it's permissions are set by using ACL's to allow only the user specified as $USER access to whatever is under it.

It's designed to make sure that only the user that's has inserted the removable device has access to that device and that is exactly what dr-x does. As long as you are that user then the ability to write to it is determined by the permissions on /media/$USER/LABEL not /media/$USER. In general if you are mounting things yourself using fstab it's best to avoid mounting things in this area - mounting things directly off /media as in /media/LABEL would be better.

Thunar is not ignoring the ACL it's simply following the path to the LABEL directory. You don't have to have write access along the entire path to have write access to the target folder. All you need is read and execute along the path and rwx on LABEL itself. You don't have write access to /media either.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
beausoleil

Re: caja 1.6.1: Error while copying: Destination is read-onl

Post by beausoleil »

Thunar is not ignoring the ACL it's simply following the path to the LABEL directory. You don't have to have write access along the entire path to have write access to the target folder. All you need is read and execute along the path and rwx on LABEL itself.
My mistake - it's not Thunar, but caja which seemed to be ignoring the ACL on /media/$USER/LABEL. But, I logged out of XFCE and back in using Mate - and the SD card now mounts rw, not ro - so I don't know if it's a one-time thing or not...

I did check about exfat - it's implemented via fuse and not in the kernel due to patent problems. As far as I can see, it doesn't at this time support acl's - I guess it just inherits what the parent mount point has. But right now ls -l reports root as the owner of everything on the card, and caja is apparently adhering to the ACL rights of $USER.

I won't mark this thread solved until I investigate more. I'll try doing a hard reboot, plus installing some updates, and see what happens...
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: caja 1.6.1: Error while copying: Destination is read-onl

Post by altair4 »

*** The system automatically creates a folder under /media named after the login user ( $USER ) that's why it is owned by root:
drwxr-x---+ 3 root root 4096 Dec 3 09:33 .
*** The system then sets an ACL for that folder that allows that user to see it ( r ) and traverse it ( x ) so the he can access what's mounted under it:
user $USER r-x
other ---
*** Regardless of what permissions are on the mount point under /media/$USER the only relevant one pertains to that user since /media/$USER will block everyone but that user from getting to it:
user $USER r-x
other ---
With that in mind:
My mistake - it's not Thunar, but caja which seemed to be ignoring the ACL on /media/$USER/LABEL.
There are no extended attributes on LABEL. Only on /media/$USER and that is the way the system is designed.
I guess it just inherits what the parent mount point has.
There is no inheritance of permissions in Linux. There is a way to "inherit" group ownership of the parent but the user has to enable the sgid bit to make that happen so it's not a default condition.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “MATE”