Hotplug SATA drive not being detected automatically while system is On/Up/Booted already

Hi There,

Am having an issue with (hot-plugging) my (caddy/3.5 HDD/SSD mount drive bay/ICY-Box SATA drives) which are connected directly to MotherBoard SATA ports, as they are not being (populated/mounted) into the system automagically.

Here is what Iv’e so far :

  • Followed this https://forum.manjaro.org/t/solved-how-do-i-enable-sata-hotplug/2911/8 & it DOES work but thats not what am aiming for ! :wink:
  • Using EndeavourOS live distro works initially (detecting the drive), but when installed on my system am back to square 1.
  • Garuda worked perfectly, which defies what am challenging my self into. (did btw copy ‘50-sata.rules’ file which iv’e found in Garuda & rebooted it with no success)
  • Boot/Reboot DOES populate the drive perfectly with its content.
  • Yes, did try to switch between controllers (Intel & ASM) with no luck!
  • I’ve installed “EndeavourOS” with its default settings, with no luck as well.

Running (udevadm monitor) gives out nothing when switching on the caddy/3.5 drive mount/hotplug ICY box.
according to dmesg (correct me if am wrong) the device is “detected then not able to negotiate something then goes down”.
BIOS settings are set correctly with (AHCI enabled on both ASM1062 Serial ATA Controller & Intel Chipset SATA Controller).

I’ve been diving head on with this for the past 2 weeks & more learning along the way, the fun into cmd/cli based commands & how to decipher your problems instead of relaying on GUI based programs/interface, ranging from how to “dmesg/lsblk/lspci to nano /etc/udev/rules.d & beyond trying to make sense of what kernel,modules, etc. installed” :]

This is my output (dmesg) when switching drive mount ON, without ‘udevadm monitor output’ as it doesn’t show anything :
Before (https://pastebin.com/5W6X9cMp)

After trying “(solved) How do I enable SATA hotplug?”
After (https://pastebin.com/tsKfLSWU)

Being a noob in linux, & somewhat veteran in M$-Winbloze :stuck_out_tongue: you’ll “never Settle” .
So, any suggestions/help would be awesome.
Thank you

Hey there @Devious ! Welcome to the EOS club :slight_smile:
That is a head scratcher. I have one of those SATA controllers → USB (ASM1062), and it works perfectly.
The really weird thing is that it is failing after install of EOS.
So what I would be doing is going through the entire dmesg log looking for a hardware-based error.

sudo dmesg -T

And also check to see if something is blacklisted https://wiki.archlinux.org/title/Kernel_module#Blacklisting, as that would stop things working too.

This doesn’t help you but nevertheless is a useful data point (I hope).
I have to use the horrible phrase “it just works for me” no hot plugging changes etc.
I have a no-name caddy plugged in directly to my box sata + power
I used lsblk to see if it appeared
Before

[xxx@ryzen7 modules-load.d]$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 931.5G  0 disk 
└─sda1        8:1    0 931.5G  0 part /media/Music
nvme0n1     259:0    0 931.5G  0 disk 
├─nvme0n1p1 259:1    0   512M  0 part /boot/efi
├─nvme0n1p2 259:2    0   500G  0 part /exthome
├─nvme0n1p3 259:3    0 100.1G  0 part /
├─nvme0n1p4 259:4    0 100.1G  0 part 
├─nvme0n1p5 259:5    0    35G  0 part 
├─nvme0n1p6 259:6    0  49.7G  0 part 
├─nvme0n1p7 259:7    0    40G  0 part 
├─nvme0n1p8 259:8    0  72.3G  0 part 
└─nvme0n1p9 259:9    0  33.9G  0 part [SWAP]

After

[xxx@ryzen7 modules-load.d]$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 931.5G  0 disk 
└─sda1        8:1    0 931.5G  0 part /media/Music
sdb           8:16   0 149.1G  0 disk 
└─sdb1        8:17   0   149G  0 part 
nvme0n1     259:0    0 931.5G  0 disk 
├─nvme0n1p1 259:1    0   512M  0 part /boot/efi
├─nvme0n1p2 259:2    0   500G  0 part /exthome
├─nvme0n1p3 259:3    0 100.1G  0 part /
├─nvme0n1p4 259:4    0 100.1G  0 part 
├─nvme0n1p5 259:5    0    35G  0 part 
├─nvme0n1p6 259:6    0  49.7G  0 part 
├─nvme0n1p7 259:7    0    40G  0 part 
├─nvme0n1p8 259:8    0  72.3G  0 part 
└─nvme0n1p9 259:9    0  33.9G  0 part [SWAP]

/dev/sdb appeared and yes it is an ancient 160 GB SATA disk.

Maybe this helps.

https://wiki.archlinux.org/title/Udev#Detect_new_eSATA_drives

@onyxnz Thank you, glad to be part of this cosmos (so to speak) :grin:
I’ll be glad to share that output if it helps solve the issue, as i did share a part of it in my post.
Ill go into the ‘blacklisting’ & see whats there, if any.

@onyxnz You don’t wanna see how “ancient” the rest of my drives are “IDE 50GB” :stuck_out_tongue_winking_eye: But thanks for the heads-up as i did try to see that as well in my post with no go too.

@ricklinux that was my 1st landing page I’ve seen, couldn’t for the life of me understand it, then i stumbled on ‘Manjaro’ link & as i mentioned it worked perfectly, like what @onyxnz said its a head scratcher.

1 Like

Hmm? I don’t see where you said it worked perfectly. :thinking:

Which exactly outlines the command mentioned earlier by you :ok_hand:t3:

I meant this. Yes it’s the same and i didn’t notice it but it’s what you said that made me think it’s not working for you that’s all.

@ricklinux Tried to make the post clean & neat so it wont be troublesome for any help given out :slight_smile:

@onyxnz I’ve ‘dmesg -T’ output into a file & searched for blacklist

[Tue Sep 21 22:59:51 2021] Trying to unpack rootfs image as initramfs...
[Tue Sep 21 22:59:51 2021] Initialise system trusted keyrings
[Tue Sep 21 22:59:51 2021] Key type blacklist registered
[Tue Sep 21 22:59:51 2021] workingset: timestamp_bits=41 max_order=23 bucket_order=0
[Tue Sep 21 22:59:51 2021] zbud: loaded
[Tue Sep 21 22:59:51 2021] Key type asymmetric registered
[Tue Sep 21 22:59:51 2021] Asymmetric key parser 'x509' registered
[Tue Sep 21 22:59:51 2021] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 243)

This the only ‘blacklist’ word mentioned in the log.

Did some research, I hope Its fruitful :sunglasses:

According to this (https://bbs.archlinux.org/viewtopic.php?pid=1750939#p1750939) & (https://en.wikipedia.org/wiki/Udev) If I understood it correctly :

  • Udev (along with other subsystems attached to it) is a (generic device manager) running that is responsible for your hardware changes (Listener) so to speak.
  • Udev uses a set of rules hence (/lib/udev/rules.d/) & ([/etc/udev/rules.d/] for custom rules) to dictate how to operate when an event is “Triggered” (USB plugged in/removed) for example.
  • Based of that rule-set (in my case its a HDD/SSD device) udisks2 is called upon to execute a set of commands to run in this event.
  • Now, since I installed EOS with defaults (XFCE), which has “Thunar” as file manager, & it uses “Gnome virtual filesystem (gvfs) provides mounting and trash functionality. (gvfs) uses udisks2 for mounting functionality and is the recommended solution for most file managers.”

Reading out my rule-set in /lib/udev/rules.d/ I’ve found this file (60-persistent-storage.rules) & (80-udisks2.rules) the latter isn’t clear to me but nonetheless I’ve read it too.

nano 60-persistent-storage.rules

# ATA
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode"

# ATAPI devices (SPC-3 or later)
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $>

# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures)
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $devnode"

# Fall back usb_id for USB devices
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"

# SCSI devices
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="scsi"
KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="cciss"
KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

Forgot to add that i came across this post & did try it out with no luck (duuno if it worked in 1st place or not) casue I didnt understand both outputs would be a value or null

https://forum.linuxvillage.org/index.php?topic=231.msg1562

Kernel polling is a new feature of the Linux kernel and udev, so most distros don’t yet have it enabled. Even if you are using udisks, enabling kernel polling is recommended to eliminate the need for udisks to do userspace polling. Kernel polling also corrects a common issue where the eject button on a drive won’t respond with the newer udev when udisks is not used.
To use kernel polling, your Linux kernel needs to be 2.6.38 or newer, and udev must be version 173 or newer.

You can find out if kernel polling is enabled by running these commands:

cat /sys/module/block/parameters/events_dfl_poll_msecs
cat /sys/block/sr0/events_poll_msecs

If you get 0 or -1 from those commands, then it’s probably disabled.

what I’ve got was :

XXX@end-systemproductname ~> cat /sys/module/block/parameters/events_dfl_poll_msecs
2000
XXX@end-systemproductname ~> cat /sys/block/sr0/events_poll_msecs
-1

one is enabled where as the other is not, & even when trying out the rest of the article it didn’t work either.

This is as far as i can get & read about it appreciate helping out, please :smiley:

Solution:

Edit /etc/tlp.conf and make sure, this line is present: SATA_LINKPWR_ON_AC="max_performance"

Thanx to systemofapwne www.daggeringcats.com :sunglasses: :vulcan_salute:

Full read & Ref. if any one wanted to learn/understand :+1:

Reddit

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.