Cannot mount USB sticks

Since upgrading to Kubuntu 21.04 I am having ongoing issues mounting USB sticks (exfat).
I keep getting this message:
An error occurred while accessing ‘cylon’, the system responded: The requested operation has failed: Error mounting system-managed device /dev/sda1: unknown filesystem type ‘swap’

nb. My upgrades and addition of backports lately have been messsy! Files have been left out. I am sure something is missing!

At one point I noticed exfat-utils and exfat-fuse were missing. After re-installing them, re-formatting the USB stick in KDEpartition Manager I was able to mount the USB file sytem and transfer data.

However, the problem still keeps recurring! Argh! This happens across a number of different USB sticks.
How can I get USB sticks to automount consistently?

I have automount enable in settings. You can see the USB stick ‘Cylon’ is identified in Attached Devices but is greyed out.

Did you go over the basics, before going deeper into it:

Is there a single one that actually works?

Thanks for the linked info!
I am still not having a lot of luck!

I created the lylon directory and then manged to mount the usb stick with:
sudo mount -t exfat /dev/sda1 /media/cylon

I was able to copy over the files from the USB to the desktop.

It will not unmount from ‘Disks and Devices’ in the panel.
It will unmount on the command line with: sudo umount -t exfat /dev/sda1

This is not a solution for me. I do not want to have to mount and unmount every single USB stick I use in this way.

Plugging the usb stick back in it gives no pop up notice to mount. It does appear in Dolphin filemanager but still gives the following when clicked on:
An error occurred while accessing ‘cylon’, the system responded: The requested operation has failed: Error mounting system-managed device /dev/sda1: unknown filesystem type ‘swap’

I also added exfat to the usbmount.conf:

MOUNTPOINTS="/media/usb0 /media/usb1 /media/usb2 /media/usb3
             /media/usb4 /media/usb5 /media/usb6 /media/usb7"

# Filesystem types: removable storage devices are only mounted if they
# contain a filesystem type which is in this list.
FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus exfat"

Do I need to configure the fstab file?

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=6e519b5b-716d-49f0-bc4c-eabfd5e7fd39   /           ext4   errors=remount-ro   0 1 
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=B796-B113                              /boot/efi   vfat   umask=0077          0 1 
/swapfile                                   none        swap   sw                  0 0 
/dev/sda1                                   none        ext4   users               0 0

This last part in fstab has:
/dev/sda1 none ext4 users 0 0

This has ext4 only and this line does not exist in my other laptop with working mounting of USB sticks. Should I remove it - or perhaps add a line for exfat??

Would adding:

# # common options for both the native kernel driver and exfat-fuse
 exfat_defaults=uid=$UID,gid=$GID,iocharset=utf8,errors=remount-ro
 exfat_allow=uid=$UID,gid=$GID,dmask,errors,fmask,iocharset,namecase,umask

to the udisks2.conf file help??

UPDATE: This did not work. :pensive:

Why does it complain that the USB has swap filesystem?

Can you use gparted or some other disk tool to see what partitions and filesystems your USB has? Please share the details and screenshot with us.

As it says here, it is recognised as a swap, so adding all the exfat stuff probably wouldn’t help, as is evident by now.

As previously mentioned, it would be extremely helpful, if you could post what gParted is saying regarding the storage media in question.

Please, post screenshots, so it’s easy to see what’s going on.

That said, you need to be very careful, before editing files like /etc/fstab, etc. If you accidentally configure them the wrong way, your Linux may stop booting.
Additionally, no matter what change of that type you make to your OS, always back up before, no matter how mundane the change seems to you.

See Q5 if you have issues with your current backup method:

Using Kubuntu and pen-drives all the time myself without trouble, I tend to believe that the reason behind all that is some installation and/or upgrade procedure having gone wrong.

Possibly you removed some piece of software and some basic library was removed as well.

You know these messages:

“The following packages are no longer needed. Do you want to remove them? (y/n)”?

I never click “yes” because I don’t trust developers to always register all dependencies properly. A few MB or GB of hard disk are not worth running into trouble.

If it is an option for you, I would reinstall the entire system from scratch.

1 Like

To me it always seems the same of in between releases of Ubuntu based distros, they are more buggier than the LTS ones.

1 Like

I changed out:
/dev/sda1 none ext4 users 0 0
in fstab for:
UUID=b8f17b3d-52ec-4b44-881f-19038165cc3d /media/backup ext4 defaults 0 0
thinking that probably refers to my external ext4 backup drive.
This borked the system. I could not log in.
I managed to comment out the line and am back running again.
Is there something wrong with this line??
UUID=b8f17b3d-52ec-4b44-881f-19038165cc3d /media/backup ext4 defaults 0 0

USB sticks now show in Dolphin and mount - but do not have write permission.
My backup drive is fully working.

UPDATE: I suspect that the line
/dev/sda1 none ext4 users 0 0
may have been commandeering /dev/sda1 for ext mounting exclusively, and as such causing issue with other formatted USB drives trying to mount there.
After removing that line and ALSO removing ‘usbmount’ I now seem to have proper mounting and read/write.
Hopefully the condition stays. I will be checking out more USB’s to confirm.

Perhaps? I made that mistake last week on my work machine. I tried to install a missing package for kio-gdrive and in doing so wiped out half my desktop! :crazy_face:
It crashed instantly and I had to do a fresh install.

Linux is so powerful. Praise Linux. :bowing_woman: