mate-desktop / caja

Caja, the file manager for the MATE desktop
https://mate-desktop.org/
Other
268 stars 145 forks source link

caja-mounted USB media sometimes incorrectly appear read-only #565

Open ghost opened 8 years ago

ghost commented 8 years ago

Running ubuntu-mate xenial with the official caja 1.12.7 I ran into a bug with two different USB media so far: 1) a USB 2.0 card reader with SD cards (all FAT formatted) 2) a USB 3.0 harddisk (NTFS formatted) When I mounted those with caja and then tried to copy a file to them, caja complained that the respective device was read-only, which is false, as I could write to it via any other program just fine.

Oddly enough, the following workaround seems to permanently fix it, but apparently only for that one device you use it on and only for the current user:

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/34867813-caja-mounted-usb-media-sometimes-incorrectly-appear-read-only?utm_campaign=plugin&utm_content=tracker%2F651521&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F651521&utm_medium=issues&utm_source=github).
ghost commented 8 years ago

I did some more investigation and found a reasonably reliable way to reproduce this. You need a USB card reader and a formatted SD card.

It looks like Caja gets confused if the first time /dev/sdWhatever gets mounted, it is in read-only mode and Caja believes it will remain that way forever.

flexiondotorg commented 8 years ago

@raveit65 @monsta See the second comment, it is reproducible.

ghost commented 8 years ago

could be related to this nautilus bug ... which happens to be still not fixed there as of Ubuntu 16.04, according to reports

monsta commented 8 years ago

Ok, so you need an SD card with read-only mode set with the switch... but what about the hard disk you mentioned in the original post?

ghost commented 8 years ago

I assume the harddisk was somehow hit by this problem when the sd card was mounted first and then later the sd card reader was disconnected and the harddrive connected in its place.

ghost commented 7 years ago

Any news on this? Could you reproduce it? I myself ran into this bug again today with an SD card from a camera ... it is rather annoying... :(

lukefromdc commented 7 years ago

I've seen this on rare occasions on only one of many boxes, with certain camera cards I have only. Wonder if this is a hardware, firmware, or kernel issue? Can you write to the card from terminal, from Nemo, or from any other program you have installed?

ghost commented 7 years ago

Yes, it always works fine from terminal. And the workaround I use to make the card writable in Caja again is to start Nautilus or Nemo alongside it, eject the card and re-insert it, then at least one of the filemanagers picks it up as writable. Once I successfuly wrote to it, I kill the extra filemanager, eject and re-insert it again and now Caja works fine with it.

lukefromdc commented 7 years ago

I have no idea what's causing that

lukefromdc commented 7 years ago

I have found this is occuring when a second VFAT volume is mounted. One mounts OK as read-write, but mount a second camera card VFAT flash drive and it comes up read-only, as do subsequent mounts of this file system until Caja is restarted. Linux filesystems like ext4 continue to mount normally it seems.

pirate486743186 commented 7 years ago

this seams to also happen after a reformat of an USB stick. This is how this bug hit me. Various people complain about an error on writing after a reformat. Presumably they all reformatted a FAT32.

About the work around to this. It's to restart caja with this command "caja -q" in a terminal. (the desktop it self, is an instance of caja, you need to use the command, closing all the windows is not enough)

jnavila commented 6 years ago

It seems to come from gvfs-metadata which records that a medium is read-only and never updates this status afterwards. Caja uses gvfs abstraction and thus the error is returned.

try

$ gvfs-info -f /media/<username>/<usbkey-name>

and look for the filesystem properties. If it is not writable, you need to erase the cache.

Check in ~/.local/share/gvfs-metadata the files corresponding to the ID of the usb key and rm them.

jnavila commented 6 years ago

For reference, the explanation and the fix:

https://bugzilla.gnome.org/show_bug.cgi?id=787731