Internal hard drives show up as removable media

I used the GUI partitioner tool within yast to create and mount the partitions on a few internal hard drives. The exact same way I did it many times before with no issue.
But this time, I somehow get the partitions/drives show up as removable media e.g. in Dolphin. And I have no idea where I went wrong. How do I fix this, and/or avoid the problem when creating new partitions?

/etc/fstab looks like this:


UUID=b4af5d0f-1469-45e5-94fe-f224c222f63a  /          ext4  defaults      0  1 
UUID=1003-1857                             /boot/efi  vfat  utf8          0  2 
UUID=177ef1d2-5d85-435f-aa1e-2e7edc576c3f  swap       swap  defaults      0  0 
UUID=b6e4aed6-1f8e-490b-ac15-bb93c3966ee3  /scratch   ext4  data=ordered  0  2 
UUID=f9416a21-06a1-4907-b5cd-463a21de4a8c  /home      ext4  data=ordered  0  2 
UUID=82340b75-e854-4f63-a9c4-f7dedd583a2d  /data3     ext4  data=ordered  0  2 
UUID=92718871-9173-41f1-8bcf-3796a660160b  /data2     ext4  data=ordered  0  2 
UUID=10923ed7-50df-434a-a9d1-6d29e8d0e7ce  /data1     ext4  data=ordered  0  2

lsblk:


NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT 
sda           8:0    1  14.6T  0 disk  
└─sda1        8:1    1  14.6T  0 part /data1 
sdb           8:16   1  14.6T  0 disk  
└─sdb1        8:17   1  14.6T  0 part /data2 
sdc           8:32   1  14.6T  0 disk  
└─sdc1        8:33   1  14.6T  0 part /data3 
nvme0n1     259:0    0 953.9G  0 disk  
├─nvme0n1p1 259:1    0   512M  0 part /boot/efi 
├─nvme0n1p2 259:2    0 102.4G  0 part / 
├─nvme0n1p3 259:3    0 102.4G  0 part [SWAP] 
└─nvme0n1p4 259:4    0 748.6G  0 part /home 
nvme1n1     259:6    0   5.8T  0 disk  
└─nvme1n1p1 259:7    0   5.8T  0 part /scratch

I assume “RM” in lsblk stands for removable media. But again, no idea where I messed this up.

For the record, the problematic ones are 3.5" SATA hard drives. Mainboard is a Gigabyte MZ72-HB0.
The two NVMe SSDs in the system are fine.

I read other sources where similar problems could be solved by disabling some hot-plug settings in bios. I only found one such setting in my bios, and neither of the available options changed anything. For SATA configuration, there are no settings that can be changed in my bios.

“removable” indication comes directly from kernel (/sys/block/sda/removable) and is set according to SCSI INQUIRY command response. You should also see “attached removable SCSI disk” or similar in kernel log on boot. Reboot, and provide full output of “journalctl -b” immediately after boot (upload to https://susepaste.org/).

https://susepaste.org/73277471

there are indeed entries for each of these HDDs: “Attached SCSI removable disk”
I deleted the partitions on these disks since I made the initial post, if anyone is wondering about inconsistencies. But lsblk still shows the disks themselves as removable media.

This was fixed in kernel 4.5.

Where disks are connected? This motherboard has 4 internal SATA ports and three SlimSAS ports.

They are connected to the SATA ports

May 26 08:32:27 localhost kernel: ahci 0000:43:00.0: flags: 64bit ncq sntf ilck pm led clo only pmp fbs pio slum part ems **sxs**

SXS means host controller supports eSATA. Linux kernel marks device as removable if it is connected to eSATA port. Unfortunately, I am not sure how it can be verified from user space. So it looks like your BIOS marks these ports as eSATA. There is really nothing that can be done here from kernel side. It is not a kernel bug.

To my experience bios hot plug settings won’t never flag drives as removable. Check automounter configuration for drive, e.g. .config/kded_device_automounterrc.

All right, thanks for the effort.
So I guess I would need to find out how to get the board to not flag these ports as eSATA. So far, I could not find any bios setting that might be responsible. And Gigabyte enterprise support won’t be any help either, they just don’t reply to tickets.

What do you think of the workaround proposed here: [SOLVED] Hard disk partitions showing up as removable devices / Newbie Corner / Arch Linux Forums

                     If your BIOS won't let you change the hotplug flag, you can work around this with udev rules. For example:

#/etc/udev/rules.d/62-internal-disk.rules

don’t show any partition of disk sda or sdb on the desktop

KERNEL==“sd[a-b]*”,ENV{UDISKS_IGNORE}=“1”

don’t show any member of lvm volume group j on the desktop

ENV{DM_VG_NAME}==“j”,ENV{UDISKS_IGNORE}=“1”
This will also remove the devices from the ‘Places’ panel in Dolphin.

Where would i find that? It’s not in the user home directory.

It is a hidden folder. You have to enable “show hidden” in your filemanager to see this file.

Thanks, but that’s not the issue here. The directory exists, but no config file with that name or similar.

Path depends on system and GUI. You didn’t tell any details about your system. Are you assuming I will guess until successful? Nope.

I am using the KDE desktop. Not sure what “system” means in this context.
If I am “withholding” crucial information, I don’t do that to make people guess. It’s because I don’t know which information is important.

Yes, this will work (it will make these disks to be ignored by any GUI component based on udisks).

Copied and pasted from Info:

**Operating System**: openSUSE Tumbleweed 20220524
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.2
Kernel Version: 5.17.9-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 550 / 550 Series

Every user of every operating system running on my hardware (see signature below) has their instance of kded_device_automounterrc in folder $HOME/.config, such as /home/karl/.config/kded_device_automounterrc. Check these files for erroneous entries.

Operating System: openSUSE Leap 15.3
KDE Plasma Version: 5.18.6
KDE Frameworks Version: 5.76.0
Qt Version: 5.12.7
Kernel Version: 5.18.0-lp153.3.g3352b92-default
OS Type: 64-bit
Processors: 128 × AMD EPYC 7543 32-Core Processor
Memory: 1,007.7 GiB of RAM


[FONT=monospace]feuchter@linux:~> echo $HOME 
/home/feuchter 
feuchter@linux:~> cd .config/ 
[/FONT][FONT=monospace][FONT=monospace]feuchter@linux:~/.config> pwd 
/home/feuchter/.config
 feuchter@linux:~/.config> ll -a 
total 288 
drwx------ 14 feuchter users  4096 May 26 14:15 **.**
drwxr-xr-x 17 feuchter users  4096 May 26 14:09 **..**
-rw-------  1 feuchter users    66 May 25 20:48 akregatorrc 
drwxr-xr-x  2 feuchter users  4096 May 25 20:48 **autostart**
drwxr-xr-x  2 feuchter users  4096 May 25 20:48 **autostart-scripts**
-rw-------  1 feuchter users   780 May 25 20:48 baloofilerc 
-rw-------  1 feuchter users    71 May 25 21:01 bluedevilglobalrc 
drwx------  2 feuchter users  4096 May 26 14:00 **dconf**
-rw-------  1 feuchter users    34 May 26 11:05 device_automounter_kcmrc 
-rw-------  1 feuchter users  1167 May 26 14:09 dolphinrc 
drwx------  2 feuchter users  4096 May 26 14:00 **gconf**
drwxr-xr-x  2 feuchter users  4096 May 26 14:00 **gtk-3.0**
-rw-r--r--  1 feuchter users   127 May 26 14:00 gtkrc 
-rw-r--r--  1 feuchter users    87 May 26 14:00 gtkrc-2.0 
-rw-------  1 feuchter users   154 May 25 20:48 gwenviewrc 
-rw-------  1 feuchter users   119 May 25 20:48 kactivitymanagerdrc 
-rw-------  1 feuchter users   655 May 25 20:49 kactivitymanagerd-statsrc 
-rw-------  1 feuchter users   604 May 26 13:56 katemetainfos 
-rw-------  1 feuchter users  2683 May 26 13:56 katerc 
-rw-------  1 feuchter users    56 May 25 20:48 kateschemarc 
-rw-------  1 feuchter users   419 May 25 21:09 katevirc 
-rw-------  1 feuchter users  2488 May 25 20:48 kconf_updaterc 
drwxr-xr-x  2 feuchter users  4096 May 25 22:17 **KDE**
-rw-------  1 feuchter users    43 May 25 20:48 kded5rc 
-rw-------  1 feuchter users  3268 May 26 14:14 kdeglobals 
drwxr-xr-x  2 feuchter users  4096 May 26 14:00 **kde.org**
-rw-------  1 feuchter users    26 May 26 11:34 kgammarc 
-rw-------  1 feuchter users 14020 May 26 14:00 kglobalshortcutsrc 
-rw-------  1 feuchter users 30598 May 26 14:00 khotkeysrc 
-rw-------  1 feuchter users   339 May 26 14:15 kinfocenterrc 
-rw-------  1 feuchter users   127 May 26 08:35 kiorc 
-rw-------  1 feuchter users   149 May 25 20:48 kmail2rc 
-rw-------  1 feuchter users   122 May 25 20:48 kmixrc 
-rw-------  1 feuchter users    35 May 26 08:33 knfsshare 
-rw-------  1 feuchter users   460 May 26 14:14 konsolerc 
-rw-------  1 feuchter users    75 May 26 11:34 kscreenlockerrc 
-rw-------  1 feuchter users   682 May 26 13:57 ksmserverrc 
-rw-------  1 feuchter users   105 May 25 20:48 ktimezonedrc 
-rw-------  1 feuchter users   184 May 25 20:51 kwalletmanager5rc 
-rw-------  1 feuchter users   191 May 25 20:51 kwalletrc 
-rw-------  1 feuchter users  1558 May 26 14:00 kwinrc 
-rw-------  1 feuchter users    18 May 26 13:57 kwinrulesrc 
-rw-------  1 feuchter users  2614 May 26 10:59 kwriterc 
-rw-------  1 feuchter users   196 May 26 14:07 kxkbrc 
drwxr-xr-x  2 feuchter users  4096 May 25 20:48 **libaccounts-glib**
-rw-------  1 feuchter users    27 May 25 20:48 plasma-localerc 
-rw-------  1 feuchter users    36 May 25 20:48 plasma-nm 
-rw-------  1 feuchter users  5852 May 26 14:00 plasma-org.kde.plasma.desktop-appletsrc 
-rw-------  1 feuchter users    58 May 25 20:48 plasma-pk-updates 
-rw-------  1 feuchter users   474 May 25 21:30 plasmashellrc 
drwxr-xr-x  4 feuchter users  4096 May 25 22:00 **plasma-workspace**
-rw-------  1 feuchter users   753 May 26 11:34 powermanagementprofilesrc 
drwx------  2 feuchter users  4096 May 25 20:48 **pulse**
drwxr-xr-x  2 feuchter users  4096 May 26 14:14 **session**
-rw-------  1 feuchter users    68 May 25 20:48 spectaclerc 
-rw-------  1 feuchter users   304 May 26 11:34 systemsettingsrc 
-rw-r--r--  1 feuchter users  1067 May 26 14:00 Trolltech.conf 
-rw-------  1 feuchter users   632 May 25 20:48 user-dirs.dirs 
-rw-r--r--  1 feuchter users     5 May 25 20:48 user-dirs.locale 
-rw-------  1 feuchter users   103 May 25 20:48 webengineurlinterceptoradblockrc 
drwxr-xr-x  2 feuchter users  4096 May 26 14:00 **xsettingsd**
feuchter@linux:~/.config> more device_automounter_kcmrc  
[Layout] 
HeaderWidths=750,139,144
[/FONT] [/FONT]

I see. Does the device show up in systemsettings5 > Removable Storage > Removable Devices > Attached Devices? If it’s shown here try and remove the device.

https://i.imgur.com/6T9teYg.png
Nothing there.
By now, I already implemented the workaround from https://forums.opensuse.org/showthread.php/570404-Internal-hard-drives-show-up-as-removable-media?p=3129815#post3129815
It stops the partitions on these drives from showing up e.g. in Dolphin as removable devices. But of course, they are still flagged as removable media in lsblk.
But I checked the removable device section before I did that, and it was exactly the same as it is now.

I am puzzled. Booted into Leap 15.3 and double checked:

**Leap-15-3:~ #** lsblk -o path,rm 
PATH       RM 
/dev/sda    0 
/dev/sda1   0 
/dev/sda2   0 
/dev/sda3   0 
/dev/sda4   0 
/dev/sda5   0 
/dev/sda6   0 
/dev/sda7   0 
/dev/sda8   0 
/dev/sda9   0 
/dev/sda10  0 
/dev/sda11  0 
/dev/sda12  0 
/dev/sda13  0 
/dev/sdb    0 
/dev/sdb1   0 
/dev/sdb2   0 
/dev/sdb3   0 
/dev/sdb4   0 
/dev/sdb5   0 
/dev/sdc    1 
/dev/sdc1   1 
/dev/sdc2   1 
**Leap-15-3:~ #**

You may need to check “Enable automatic mounting of removable media” and uncheck “Mount all removable media at login” first. This resulted in the creation of kded_device_automounterrc here:

[FONT=monospace]karl@Leap-15-3:~> LANG=C stat .config/kded_device_automounterrc 
  File: .config/kded_device_automounterrc 
  Size: 2300            Blocks: 8          IO Block: 4096   regular file 
Device: 4fh/79d Inode: 62307       Links: 1 
Access: (0600/-rw-------)  Uid: ( 1000/    karl)   Gid: (  100/   users) 
Access: 2022-05-26 15:46:04.871991757 +0200 
Modify: 2022-05-26 15:45:49.899788647 +0200 
Change: 2022-05-26 15:45:49.899788647 +0200 
 **Birth: 2022-05-26 15:45:49.899788647 +0200 **
karl@Leap-15-3:~> [/FONT]

I never relied on these arcane udev rules, but managed to fix the problem with user configuration files.