Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] KDE does not detect USB drive after update
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
AECFXI
n00b
n00b


Joined: 28 Nov 2018
Posts: 33

PostPosted: Tue May 23, 2023 2:35 pm    Post subject: [SOLVED] KDE does not detect USB drive after update Reply with quote

EDIT: I've discovered the issue is specifically a bizarre behavior with my base Gentoo system recognizing the exFAT filesystem on my USB drive. When a exFAT filesystem is initially formatted on the USB stick in KDE Partition Manager, the partition is recognized by the system and KDE automounts it and I have full read/write capabilities. However when the USB drive is safely removed, unplugged, and plugged back in, the drive itself is detected and has a target (/dev/sda) however the fielsystem on the USB device is not detected and there is no target present in /dev for the filesystem. The missing filesystem target can also be seen in my lsblk output below. The KDE partition manager says the partition type is "unknown", but can still reformat the drive. When the USB stick is then plugged into other hardware in my home, it works just fine. The behavior is common across multiple USB devices. I have exfatprogs installed and kernel-enabled exfat support.

I had a working functionality where KDE would detect and automount USB drives, with the drive visible in Dolphin and appearing in the Removable Devices system tray feature.

I recently discovered this feature is no longer working and have not had success in identifying a solution in search results.

The device appears in lsblk perfectly fine with the following output:
Code:
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    1 14.6G  0 disk
nvme1n1     259:0    0  1.8T  0 disk
nvme0n1     259:1    0  1.8T  0 disk
├─nvme0n1p1 259:2    0  256M  0 part
├─nvme0n1p2 259:3    0   36G  0 part [SWAP]
└─nvme0n1p3 259:4    0  1.8T  0 part /


Upon plugin, dmesg generates the following with no further output:
Code:
  418.348511] usb-storage 1-7:1.0: USB Mass Storage device detected
[  418.349037] scsi host8: usb-storage 1-7:1.0
[  419.387855] scsi 8:0:0:0: Direct-Access     VendorCo ProductCode      2.00 PQ: 0 ANSI: 4
[  419.389344] sd 8:0:0:0: [sda] 30720000 512-byte logical blocks: (15.7 GB/14.6 GiB)
[  419.389502] sd 8:0:0:0: [sda] Write Protect is off
[  419.389510] sd 8:0:0:0: [sda] Mode Sense: 03 00 00 00
[  419.389649] sd 8:0:0:0: [sda] No Caching mode page found
[  419.389654] sd 8:0:0:0: [sda] Assuming drive cache: write through
[  419.393228] sd 8:0:0:0: [sda] Attached SCSI removable disk


The user logged into KDE has the following assigned groups:
Code:
lp wheel audio video usb input users lpadmin plugdev matthew


make.conf USE flags are as follows:
Code:
USE="bluetooth nvidia usb mtp -gtk vulkan joystick -gnome qt5 kde -dvd -cdr wayland gles2 alsa ffmpeg a52 dts pulseaudio networkmanager cups"


plasma-meta has the following USE flags activated:
Code:
[ebuild   R    ] kde-plasma/plasma-meta-5.27.5:5::gentoo  USE="bluetooth browser-integration crash-handler crypt desktop-portal display-manager firewall handbook kwallet legacy-systray networkmanager pulseaudio sddm smart systemd thunderbolt wallpapers -accessibility -colord -discover (-elogind) -grub -gtk -plymouth -sdk" 0 KiB


However, KDE System Settings -> Removable Storage -> Removable Devices does not show anything except my NVME drive. The specific USB drive I plugged in for the above dmesg output is listed under "Disconnected Devices" in this KDE menu.

Conversely, KDE's partition manager does detect the plugged in USB drive, but only after entering the root password.

I am at an impasse really because everything seems like it is working fine down low on the system and I should have the right user privileges for KDE to manage the drives, and it just stopped working out of the blue presumably after some kind of update at least a month ago. There was some vaguely recent work done on my part in the kernel configuration to get some USB-controlled flightsticks and USB hubs to work, but at most I believe I just followed Gentoo wiki page for USB support to make sure I was setup correctly in that regard.


Last edited by AECFXI on Wed May 24, 2023 4:53 am; edited 3 times in total
Back to top
View user's profile Send private message
AECFXI
n00b
n00b


Joined: 28 Nov 2018
Posts: 33

PostPosted: Tue May 23, 2023 9:00 pm    Post subject: Reply with quote

I followed the instructions on this page and section ( https://wiki.gentoo.org/wiki/Removable_media#Mounting_removable_media ) to edit /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy to allow for drive mounting by any rather than requiring root auth. No change was observed.

I followed these steps for kernel configuration and pulling in the exfatprogs tool: https://wiki.gentoo.org/wiki/ExFAT page. Also no change in behavior.

I have been observing some particularly bizarre behavior since I first had issues with USB sticks: If I open up the KDE partition manager, it says the flash drive partition is unknown. If I wipe it and write in an exfat partition, kde instantly automounts the usb drive and it appears in dolphin. But then if I 'safely remove' the USB stick, pull it out of my computer and then plug it back in, it does not automount and is not observed to exist in KDE's removable media system settings like before. What's more, looking carefully at the USB drive in the KDE partition manager with root access, it reports that the partition type (which moments ago had been showing exfat when I freshly formatted the drive and before I safely removed it) is now listed as "unknown" rather than exfat. It should be noted the USB stick works perfectly fine on a windows laptop and other equipment with the exfat partition I gave it in the KDE partition manager, it is only Gentoo that is refusing to recognize it when it is plugged in again.
Back to top
View user's profile Send private message
rab0171610
Apprentice
Apprentice


Joined: 24 Dec 2022
Posts: 299

PostPosted: Tue May 23, 2023 9:38 pm    Post subject: Reply with quote

Quote:
I had a working functionality where KDE would detect and automount USB drives, with the drive visible in Dolphin and appearing in the Removable Devices system tray feature.

This is done in System Settings. I have not had any issues but I do not have auto-mounting enabled. If I need to mount a USB drive, I do it "Mount and Open" from the System Tray icon, which then opens in Dolphin or simply the "Mount" option. For permanent drives, I use fstab entries.

In System Settings > Removable Devices > Removable Storage, do you have any of the boxes checked: "On Login", "On Attached"?
What about "Automatically mount removable media that have never been mounted before" (at the bottom)?
Also, are you able to highlight the device and click "forget device" in the current situation?
https://i.imgur.com/rhprr6J.png
https://files.catbox.moe/5ii6ht.png
If yours looks populated like in the link above, maybe try to forget all devices using "forget device" for each entry and unchecking all boxes. It should then be empty:
https://files.catbox.moe/5ii6ht.png
"Forget Device" and "Automatically mount removable media that have never been mounted before" will be grayed out and not applicable. Reboot to ensure the settings refresh takes effect and try resetting everything again to see if that helps.
If a settings refresh does not help, try setting up a new user and login as that user. If the issue persists, it may be a problem with the system configuration.
Back to top
View user's profile Send private message
AECFXI
n00b
n00b


Joined: 28 Nov 2018
Posts: 33

PostPosted: Wed May 24, 2023 3:51 am    Post subject: Re: KDE does not detect USB drive after update Reply with quote

In KDE System Settings -> Removable Storage -> Removable Devices, there is an entry for the USB stick in question however it is listed under "Disconnected Devices." I can select it and I've had "On Login" and "On Attach" both ticked, but the USB drive has stayed under Disconnected Devices even when I plug it in. I can also press "Forget Device" on this USB stick entry. When I do that, it disappears from the device list and nothing re-appears or changes when unplugging and replugging the USB drive.

Curiously, the bottom tick box for "Automatically mount removable media that have never been mounted before" is grayed out.

I can't "Forget" all devices because the attached NVME drive has the Forget Device optioned grayed out.

I am actually now thinking it is some kind of partition recognition issue that's developed on my system and not a KDE issue. The lsblk and dmesg output both made me think all is well on the low system level, however under /dev (and even lsblk if you look carefully) there is only /dev/sda and no /dev/sda1. Which says even the base system is not detecting any filessytem on the USB drive. I cannot even manually perform a mount with root because there is no filesystem target.

Should I make a new thread in the Kernel and Hardware forum, request this thread be moved, or continue to request support for this partition discovery issue in the Desktop Environments forum?

Also, to clarify: This same issue was initially observed across a variety of removable media and this particular USB device is confirmed to work on other hardware, to allay any concerns that we are dealing with a bad USB stick rather than a bad system.
Back to top
View user's profile Send private message
jburns
Veteran
Veteran


Joined: 18 Jan 2007
Posts: 1214
Location: Massachusetts USA

PostPosted: Wed May 24, 2023 4:29 am    Post subject: Reply with quote

Do you have CONFIG_MSDOS_PARTITION=y in .config
Back to top
View user's profile Send private message
AECFXI
n00b
n00b


Joined: 28 Nov 2018
Posts: 33

PostPosted: Wed May 24, 2023 4:51 am    Post subject: Reply with quote

jburns wrote:
Do you have CONFIG_MSDOS_PARTITION=y in .config


That was the missing piece I couldn't figure out! It was disabled and enabling it fixed everything. I had scoured the Filesystem section in the kernel options, but didn't think to go into the block layer section (as I don't really understand what that is still).

I may edit some of the Gentoo Wiki pages I had been looking at such as the one on exFAT to include this kernel configuration requirement.

The issue also probably wasn't ever due to an update either. I probably had this issue since the system was initially setup, and thought it worked fine before because non-MSDOS thumbdrives worked fine and even on exFAT I had done a few file transfers previously using the pseudo-functionality with freshly formatted USB drives like I'd described.
Back to top
View user's profile Send private message
rab0171610
Apprentice
Apprentice


Joined: 24 Dec 2022
Posts: 299

PostPosted: Wed May 24, 2023 5:11 am    Post subject: Reply with quote

The problem was only with fat fs - sorry I didn't realize that. I'm happy you got things working correctly.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum