Cannot Delete Files from SD Card

Using thunar or the default Mate filemanager, I cannot delete files from an SD card inserted into an external USB card reader. The permissions are set correctly (read and write), and I never had this problem using Gnome Fallback, where I could select “Move,” and that is not an option now either.

I can copy the files to my HDD, but the only way to delete them is to format the card in the camera, which is a PITA.

I am running Ubuntu 18.04 with Mate added.

Is the delete option grayed out or non-existent?

The delete option is grayed out.

I get that sometimes, mostly when I’m trying to work with a live boot USB stick. Still haven’t figured out a way around it.

A workaround is to open a terminal with CTRL+ALT+T. Type rm followed by a space, then drag-and-drop the files you wish to delete.

Press ENTER:

  • If there's no feedback, refresh the folder, they're gone. It's definitely a bug in both file managers or a shared library they use.
  • If it says "operation not permitted" or "read-only file system", it's likely due to the way it was mounted.

If it's read-only, it might be possible to remount as read/write:

sudo mount -o remount,rw /path/to/sdcard

Are you able to create/copy files onto the SD card?

Clearly a Mate bug. I am able to copy and delete files to/from the SD card with Ubuntu fallback, and cannot with Mate.

You might want to also try using another USB/SD adaptor or switching to another USB port.

I have a nice simple little ADATA microSD adaptor that always works perfectly. It’s the tiny micro model with the large blue LED at the end where the microSD card actually fits up inside the USB connector. I can copy 10 Gigabyte images flawlessly without errors every single time, and leave FAT, EXFAT, or NTFS file systems permanently mounted for weeks without issues.

… But a similar sized little Lexar USB3 microSD adapter which came with one of my Lexar microSD cards, while it is technically much faster - when it works is MUCH more likely to either refuse to mount (or to mount read-only as you seem to be reporting).

Switching that same Lexar adaptor to a USB2 port is more reliable, but gives up most of the speed advantage, and is still not as reliable as my little ADATA adapters.

I have seen similar USB device reliability variations in Windows, so this is not a knock against Linux, but you might want to keep in mind that not all USB to SD storage adapters are created equal. While most of them will work at some level, there can be huge variations when it comes to full time reliable performance.

Thanks, but I have tried switching USB ports, to no avail. Again, it has always worked perfectly in Ubuntu 16.04 and now 18.04, but not with Mate for 18.04. When I view Properties, it is not mounting as read-only, as I have read and write privileges.

Sorry, we had crossing message posts. I agree that if the underlying Ubuntu OS works differently, there is definitely something weird going on.

Changing USB adapters may still have an effect, but if MATE is not working where the underlying Ubuntu fallback does, then there is definitely some kind of BUG.

You might want to execute something like:

dmesg -wT

Then plug in your USB device, for both working and not-working scenarios to see what is going on.

EDIT:
I suspect that the problem you are seeing is because of the fact that you have multiple desktops and file managers installed, which is causing multiple processes to simultaneously try to manage mounting your external media, leading to lock file problems and causing caja to limit you to read-only access.

I have done it from the command line before, but I wasn't aware that you could drag-and-drop. Nice feature.

1 Like

Yes it is a nice feature. Been that way for a long time now. :slight_smile:

Is there any way around this read-only issue, given that I have multiple desktops and file managers installed? Never had this issue with 16.04.

You are correct - multiple file managers like Caja, Nautilus, Nemo, and Thunar should sort all this out automatically, even if you install all of them, so this is either an outright bug, or something that accidentally got incorrectly configured during the installation of one of them.

All of these file managers have configuration options to override control of things like whether or not they load by default with the desktop, whether or not they handle the display of Icons on the desktop, and whether or not they handle auto-mounting and unmounting of storage devices.

So you could try temporarily uninstalling them one by one (or just use their config options to disable them from loading with the desktop) to try to identify the conflict.

Wish I could be of more assistance, but Thunar and Nemo work fine for me in 16.04 and I don’t have either of them (or Nautilus) installed in 18.04 (since MATE 18.04 now offers hashing and other extended info under the Caja file properties tab, which was the main reason I installed Thunar and Nemo in 16.04).

Hi, and thanks for the response and info. I used the chown command (sudo chown -hR merlin /dev/sdd) to change ownership of the card reader, even though I was already listed as the owner with read/write permissions. I then removed the reader, plugged it and the sd card back in, and voila, I could write to the card and delete files.

So for the moment it is working, but as with all things computer related, we shall see…

Also, can you please point me as to where the file manager configuration options are located. And especially how to change whether or not they handle auto-mounting and unmounting. Thanks!

MATE and the Ubuntu Gnome desktop settings can be edited using dconf-editor which can be installed with:

sudo apt-get install dconf-editor

This can be run either from a terminal or from the "System Tools" menu, and works very similarly to regedit in Windows.

The key to edit for auto-mounting control for MATE can be found under:

org / mate / desktop / media-handling / automount

For Ubuntu Gnome Nautilus it should be very similar with the key under:

org / gnome / desktop / media-handling / automount

For thunar, I believe the options are kept in a custom XML file in your home/.config folder, but you should be able to just open the thunar file manager itself, select the preferences/advanced tab, and check or un-check the "Enable Volume Management" checkbox.

EDIT:
The above option may only show up if you have the thunar-volman package installed, at which point a ton of additional options come into play:

https://docs.xfce.org/xfce/thunar/using-removable-media

According to the thunar docs, this volume management feature seems to be optional, so if it is installed, you could try removing just the thunar-volman package to see if that fixes your media mounting issues.

I haven’t tested it on an SD card, but typing “sudo caja” into the command line will give you an administrator Caja window (I’m sure there are other ways, but this works for me). If you were getting a permission denied type of error, that might fix it.

Hi Steve, and thanks very much for the info. Turns out all these are set just the way you indicated.

And I have had no trouble with read-only sd cards since running the chown command.