Bug 476973 - HDDs conected to plug-in SATA card classified by Dolphin as Removable Devices rather than Devices
Summary: HDDs conected to plug-in SATA card classified by Dolphin as Removable Devices...
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-solid
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.110.0
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-14 04:49 UTC by Scott
Modified: 2024-01-15 03:45 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
udiskctl-dump.txt (88.23 KB, text/plain)
2023-11-14 22:05 UTC, Scott
Details
copy of user-places.xbel (9.67 KB, text/plain)
2023-11-25 11:33 UTC, Scott
Details
solid-hardware5 sdj1 sdi1 (1.88 KB, text/plain)
2023-11-28 22:51 UTC, Scott
Details
user-places.ebel after edit & reboot (9.35 KB, text/plain)
2023-11-29 22:12 UTC, Scott
Details
copy of /etc/udev/rules.d/70-snap.snapd.rules (62.16 KB, text/plain)
2023-11-30 12:45 UTC, Scott
Details
udevadm info --export-db (256.00 KB, text/plain)
2023-11-30 12:46 UTC, Scott
Details
udevadm info --export-db (256.00 KB, text/plain)
2023-12-01 11:54 UTC, Scott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott 2023-11-14 04:49:25 UTC
SUMMARY
I have 11 HDDs  3 of which are connected to a SATA expansion card ad these disks are classified as Removable Devices by Dolphin rather than Devices.



STEPS TO REPRODUCE
1.  Plug a SATA expansion card into a PCIe lane and connect a SATA HDD to it.
2.  Open Dolphin and find it's classified as removable storage.
3. 

OBSERVED RESULT
As above

EXPECTED RESULT
That either Dolphin detects that the SATA card is plugged into  a PCIe slot and hence assumes internal drive or I have the ability to nominate if it is internal or removable.

SOFTWARE/OS VERSIONS
 Operating System: Kubuntu 23.10
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.0-10-generic (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7C35
System Version: 2.0

ADDITIONAL INFORMATION
FSTAB:
/swapfile					                                 none      			    swap     sw      			0	      0
UUID=6F97-1999   				                             /boot/efi   		     vfat     umask=0077	      	0	      0
UUID=4fe73ac0-6cfa-4b06-8de5-b0624ea87fb7	     /         			             ext4     errors=remount-ro	0	      1
UUID=d4d3ae71-d781-4512-9e58-eb1b4495b81d     /mnt/data/disk01         ext4	 defaults		        0	      2
UUID=ab283ddb-f1ca-4d31-8020-4888a5a2b726	     /mnt/data/disk02         ext4	 defaults		        0	      2
UUID=8fad1423-49bb-4132-9972-3a490a730209	     /mnt/data/disk03         ext4	 defaults		        0	      2
UUID=2bf5a4b2-36de-4dd8-8b1c-d20f823a6dc6	     /mnt/data/disk04         ext4	 defaults		        0	      2
UUID=7a7bda24-3eff-4b02-ad4f-f20ae1c43a87         /mnt/data/disk05         ext4	 defaults		        0	      2
UUID=0a376a8e-95a0-4c22-aa18-2dea10f33207	     /mnt/data/disk06         ext4	 defaults		        0	      2
##UUID=0a376a8e-95a0-4c22-aa18-2dea10f33207  /mnt/data/disk07         ext4	 defaults		        0	      2
##UUID=a0cd798e-0b68-4970-8e95-571b47798893 /mnt/data/disk08         ext4	 defaults		        0	      2
UUID=86381412-44a2-48df-a26e-b007343eceae	     /mnt/data/disk10         ext4	 defaults		        0	      2
UUID=75462402-01d1-47d7-883c-c546af61f768	     /mnt/data/disk11         ext4	 defaults		        0	      2
UUID=cf0badaf-3216-4db3-9c1f-1c3ad2c37985	     /mnt/parity/.parity01   ext4	 defaults		        0	      2
UUID=82b996a8-5c88-4a88-b5e0-c8aa81beffad        /mnt/parity/.parity02   ext4	 defaults		        0	      2
#UUID=f2d75135-72c2-4b74-8bab-b67e4d6a7da5    /mnt/data/disk00        ext4	 defaults		        0	      2
#
#Mergerfs pool
/mnt/data/*	/mnt/Entertainment	fuse.mergerfs	category.create=epmfs,defaults,allow_other,use_ino,minfreespace=100G,fsname=pool 0 0
Comment 1 Méven Car 2023-11-14 10:21:48 UTC
Please share the file obtained udiskctl-dump.txt with `udisksctl dump > udiskctl-dump.txt`.

AND

`solid-hardware list` result, it might be `solid-hardware5 list` on your system, with the output of `solid-hardware5 details <UDI>` where UDI is one of the disks connected using through SATA expansion card.
Comment 2 Scott 2023-11-14 22:05:15 UTC
Created attachment 163169 [details]
udiskctl-dump.txt

Attached is the dump requested.
Following is, solid-hardware5 details sdm

scott@scottlounge:~$ solid-hardware5 details sdm
udi = 'sdm'
  parent = '' (string)
  vendor = '' (string)
  product = '' (string)
  description = '' (string)
  icon = '' (string)
Comment 3 Méven Car 2023-11-15 11:40:20 UTC
(In reply to Scott from comment #2)
> Created attachment 163169 [details]
> udiskctl-dump.txt
> 
> Attached is the dump requested.
> Following is, solid-hardware5 details sdm
> 
> scott@scottlounge:~$ solid-hardware5 details sdm
> udi = 'sdm'
>   parent = '' (string)
>   vendor = '' (string)
>   product = '' (string)
>   description = '' (string)
>   icon = '' (string)

An UDI for a drive would look like "/org/freedesktop/UDisks2/drives/ST32000542AS_6XW1QK6W", this does not correspond to a drive.
For instance:
```
solid-hardware5 details /org/freedesktop/UDisks2/drives/ST32000542AS_6XW1QK6W
udi = '/org/freedesktop/UDisks2/drives/ST32000542AS_6XW1QK6W'
  parent = '/org/freedesktop/UDisks2' (string)
  vendor = '' (string)
  product = 'ST32000542AS' (string)
  description = 'Disque dur interne 1,8 Tio (sda1)' (string)
  icon = 'drive-harddisk' (string)
  Block.major = 8  (0x8)  (int)
  Block.minor = 1  (0x1)  (int)
  Block.device = '/dev/sda1' (string)
  StorageDrive.bus = 'Sata'  (0x4)  (enum)
  StorageDrive.driveType = 'HardDisk'  (0x0)  (enum)
  StorageDrive.removable = false (bool)
  StorageDrive.hotpluggable = false (bool)
  StorageDrive.inUse = false (bool)
  StorageDrive.size = 2000398934016  (0x1d1c1116000)  (qulonglong)
```
Comment 4 Scott 2023-11-15 22:03:18 UTC
Hopefully this what you after:

scott@scottlounge:~$ solid-hardware5 details '/org/freedesktop/UDisks2/drives/TOSHIBA_MG07ACA12TE_71T0A1E2F95G'
udi = '/org/freedesktop/UDisks2/drives/TOSHIBA_MG07ACA12TE_71T0A1E2F95G'
  parent = '/org/freedesktop/UDisks2' (string)
  vendor = '' (string)
  product = 'TOSHIBA MG07ACA12TE' (string)
  description = 'TOSHIBA MG07ACA12TE' (string)
  icon = 'drive-removable-media' (string)
  Block.major = 8  (0x8)  (int)
  Block.minor = 145  (0x91)  (int)
  Block.device = '/dev/sdj1' (string)
  StorageDrive.bus = 'Sata'  (0x4)  (enum)
  StorageDrive.driveType = 'HardDisk'  (0x0)  (enum)
  StorageDrive.removable = true (bool)
  StorageDrive.hotpluggable = false (bool)
  StorageDrive.inUse = true (bool)
  StorageDrive.size = 12000138625024  (0xaea00000000)  (qulonglong)
Comment 5 Méven Car 2023-11-25 07:09:25 UTC
It should work, I don't understand why.

Could send the content of your file `~/.local/share/user-places.xbel` ?
Comment 6 Scott 2023-11-25 11:33:38 UTC
Created attachment 163457 [details]
copy of user-places.xbel

Requested file attached.
Comment 7 Méven Car 2023-11-28 12:31:57 UTC
I have yet another question.
Since I don't have a similar setup I need all of information from you, thanks again for following through I couldn't fix this without your input.

Could you send me the return of of both:

solid-hardware5 details /org/freedesktop/UDisks2/block_devices/sdj1

solid-hardware5 details /org/freedesktop/UDisks2/block_devices/sdi1
Comment 8 Scott 2023-11-28 22:51:39 UTC
Created attachment 163595 [details]
solid-hardware5 sdj1 sdi1

Mevan, you have it arse about, it's me that owes you thanks. You have the knowledge to fix this problem which I alerted you to so therefore any information you need from me is a duty on me to provide it to you. Please feel free to ask away for anything you need and thank you for your time.
Comment 9 Bug Janitor Service 2023-11-29 07:05:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1495
Comment 10 Méven Car 2023-11-29 10:13:49 UTC
(In reply to Bug Janitor Service from comment #9)
> A possibly relevant merge request was started @
> https://invent.kde.org/frameworks/kio/-/merge_requests/1495

The MR should fix the issue.
I may be able to backport it.

To confirm this will work, I can offer you a workaround that if it works confirms my patch will fix the issue:

Could you try edit any entry in the place panel (for instance renaming Entertainment to Entertainmen).
You can rename it back afterwards.

And then post here the  `~/.local/share/user-places.xbel`  file again, (it should have been updated).

It should then contain many more <uuid></uuid> entries, if so the workaround worked and my patch will fix it the issue.
Now the ordering should be consistent in next reboot.

My patch will make this workaround unnecessary.
Comment 11 Scott 2023-11-29 22:12:51 UTC
Created attachment 163622 [details]
user-places.ebel after edit & reboot

It appears the opposite of what you expected occurred, the new xbel file is 10 lines shorter but does reflect the edited change. There is no change in the contents of Devices in Dolphin after reboot.
Comment 12 Bug Janitor Service 2023-11-30 09:26:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/solid/-/merge_requests/148
Comment 13 Stefan Brüns 2023-11-30 10:43:55 UTC
The "removable" classification is done by the kernel (based on flags set by the hardware), and forwarded via udisks2 to solid.

http://storaged.org/doc/udisks2-api/latest/gdbus-org.freedesktop.UDisks2.Drive.html#gdbus-property-org-freedesktop-UDisks2-Drive.Removable
> Note that this is only a guess. 

But as this is a somewhat common problem, it is possible to override it, and already for 12 years now:
https://bugs.freedesktop.org/show_bug.cgi?id=22879#c9

Please try adding a file "/etc/udev/rules.d/70-fixup-removable.conf" with the following contents (without the "---"):

---
# PCI SATA misclassified all drives as removable (probably eSATA), mark as internal
SUBSYSTEMS=="pci", ENV{PCI_SLOT_NAME}=="0000:03:00.1", ENV{UDISKS_SYSTEM_INTERNAL}="1"
# Probably better, use vendor/product ID of SATA expansion card:
# SUBSYSTEMS=="pci",  ATTR{vendor}=="0x0123", ATTR{device}=="0xabcd", ENV{UDISKS_SYSTEM_INTERNAL}="1"
---

Afterwards, reload the udev configuration:
$> sudo udevadm control --reload

In case this does not work, please provide the output of:
$> udevadm info --export-db
Comment 14 Scott 2023-11-30 12:45:25 UTC
Created attachment 163647 [details]
copy of /etc/udev/rules.d/70-snap.snapd.rules

Here is the edited file, I have added the lines at line 1137.
Comment 15 Scott 2023-11-30 12:46:51 UTC
Created attachment 163648 [details]
udevadm info --export-db

As there was no change to the Dolphin list, the file requested.
Comment 16 Stefan Brüns 2023-11-30 12:57:32 UTC
(In reply to Scott from comment #14)
> Created attachment 163647 [details]
> copy of /etc/udev/rules.d/70-snap.snapd.rules
> 
> Here is the edited file, I have added the lines at line 1137.

Thats the reason I asked you to create a *new* file, with just the given contents.

1. The added lines will never be executed when added at the position you have used
2. The changes will be removed: "# This file is automatically generated. ... # do not edit this file, it will be overwritten on update"
Comment 17 Stefan Brüns 2023-11-30 13:57:00 UTC
Please try adding a file "/etc/udev/rules.d/70-fixup-removable.conf"
Comment 18 Scott 2023-11-30 23:08:27 UTC
I correctly followed your instructions this time with the same result.
Comment 19 Stefan Brüns 2023-11-30 23:29:53 UTC
(In reply to Scott from comment #18)
> I correctly followed your instructions this time with the same result.

Have you reload'ed the udev configuration?

Is the UDISK_SYSTEM_INTERNAL env variable set in the udevadm output?
Comment 20 Scott 2023-12-01 00:33:08 UTC
If you mean:
1/ did I run, sudo udevadm control --reload, yes
2/ Is the UDISK_SYSTEM_INTERNAL env variable set in the udevadm output?, I have no idea, how to tell?
Comment 21 Stefan Brüns 2023-12-01 11:32:36 UTC
The udevadm info --export-db should have an "E: UDISKS_SYSTEM_INTERNAL=1" in each block for the controller and attached disks. If unsure, append the output here again.
Comment 22 Scott 2023-12-01 11:54:41 UTC
Created attachment 163696 [details]
udevadm info --export-db

I see only 1 line that you mentioned. I am travelling until 12/12/23.
Comment 23 Stefan Brüns 2023-12-01 12:12:21 UTC
Currently, only the host adapter self matches.
Can you try the following two variants (remove the # comment character from one line at a time):

---
# SUBSYSTEMS=="pci", SUBSYSTEM=="block",  ATTRS{vendor}=="0x1022", ATTRS{device}=="0x43c8", ENV{UDISKS_SYSTEM_INTERNAL}="1"
# SUBSYSTEM=="block",  ENV{ID_PATH}=="pci-0000:03:00.1*", ENV{UDISKS_SYSTEM_INTERNAL}="1"
---
Comment 24 Bug Janitor Service 2023-12-16 03:45:57 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 25 Scott 2023-12-16 09:38:08 UTC
(In reply to Stefan Brüns from comment #23)
> Currently, only the host adapter self matches.
> Can you try the following two variants (remove the # comment character from
> one line at a time):
> 
> ---
> # SUBSYSTEMS=="pci", SUBSYSTEM=="block",  ATTRS{vendor}=="0x1022",
> ATTRS{device}=="0x43c8", ENV{UDISKS_SYSTEM_INTERNAL}="1"
> # SUBSYSTEM=="block",  ENV{ID_PATH}=="pci-0000:03:00.1*",
> ENV{UDISKS_SYSTEM_INTERNAL}="1"
> ---

From which file?
Comment 26 Bug Janitor Service 2023-12-31 03:46:04 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 27 Bug Janitor Service 2024-01-15 03:45:25 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!