# How to ignore broken SSD at boot time



## tithom (Oct 30, 2022)

Hello all,

I'm currently discovering FreeBSD on an old laptop (Asus UX32VD) that I've been experimenting on (it's also got Arch & Linux From Scratch on it). It was a laptop with both a SSD (where the OS was supposed to be installed) & HDD (for data, games, etc.). The SSD is dead & soldered onto the motherboard so cannot be removed. Both Linux & FreeBSD spend over a couple of minutes pinging it before continuing to boot. The Linux kernel has the following parameters: libata.force=2.00:disable,2.00:norst - which don't work for my drive for some reasons though they seem to have been what I was looking for. I was hoping to find something similar that would actually work for this laptop on FreeBSD.

So as to what dmesg says:

```
ahci0: Intel Panther Point AHCI SATA controller port 0xf0b0-0xf0b7, 0xf0a0-0xf0a3, 0xf090-0xf097, 0xf080-0xf083, 0xf060-0xf07f mem 0xf791e000-0xf791e7ff irq 19 at device 31.2 on pci0
ahcich0: AHCI channel at channel 0 on ahci0
ahcich1: AHCI channel at channel 1 on ahci0
ahciem0: AHCI enclosure management bridge on ahci0
...
Root mount waiting for: CAM
...
ahcich1: AHCI reset: device not ready after 31000ms
...
Root mount waiting for: CAM
...
ahcich1: Poll timeout on slot 2 port 0
ahcich1: is 00000000 cs 00000004 ss 00000000 rs 00000004 tfd 80 serr 00000000 cmd 0000c217
(aprobe1:ahcich1:0:0:0): NOP FLUSHQUEUE. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
(aprobe1:ahcich1:0:0:0): CAM status: command timeout
(aprobe1:ahcich1:0:0:0):  error 5, retries exhausted
...
ahcich1: Poll timeout on slot 3 port 0
ahcich1: is 00000000 cs 00000008 ss 00000000 rs 00000008 tfd 80 serr 00000000 cmd 0000c317
(aprobe1:ahcich1:0:0:0): SOFT_RESET. ACB: 00 00 00 00 00 00 00 00 00 00 00 00
(aprobe1:ahcich1:0:0:0): CAM status: command timeout
(aprobe1:ahcich1:0:0:0):  error 5, retries exhausted
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0 Hitachi etc......
```
Reading through the man pages of ahci, ada, CAM, I tried the following in loader.conf:
`dev.ahcich.1.disable_phy=1` (not sure what phy is but it said that it could be use to get the disk on/off in the man page of ahci)
kern.cam.ada.default_timeout=10 (to see if I could shorten the time it takes to write off the SSD, but seems that, like retry_count, it does not apply to probe time)

I wonder if it would be possible to use devices hint to disable the device but I don't think I understand how to use the keywords well enough to identify it and I'm not sure it can be defined if it's not detected at all. Or perhaps disabling ahci0 channel 1?

It's not the end of the world, but if I could find a way to skip this device, that would make that old laptop that much more viable.


----------



## T-Daemon (Oct 31, 2022)

tithom said:


> I tried the following in *loader.conf*:
> dev.ahcich.1.disable_phy=1


Try setting the tunable in /etc/sysctl.conf.

ahci(4)

```
*SYSCTL*
     dev.ahcich.X.disable_phy
             ...
```

But I doubt it has an effect during boot when the devices are probed.


----------



## facedebouc (Oct 31, 2022)

Or perhaps in /boot/device.hints ?


----------



## SirDice (Oct 31, 2022)

Can't you disable the device in the BIOS?



tithom said:


> The SSD is dead & soldered onto the motherboard so cannot be removed.


I need a new laptop, please remind me to never buy one that has this idiocy.


----------



## tithom (Nov 2, 2022)

Thanks a lot for the different answers! In no particular order:

No, unfortunately the SSD cannot be disabled in the BIOS, the BIOS is quite basic really
I've tried putting `dev.ahcich.1.disable_phy=1` in loader.conf, device.hints, and sysrc.conf and it seems that one of them has helped, SOFT_RESET does not appear in the log any longer (the 2nd command timeout above), I'm now trying to revert the change and it seems to be including the tunable in device.hints which makes the difference
So this helps cutting down boot time by about 20s from 1"36 to 1"18, but what takes the longest is the first command (NOP FLUSHQUEUE). That's always good to take!

What's the difference between loader.conf & sysrc.conf one passes argument at the early boot and the other when starting multi-user session?


----------



## tithom (Nov 14, 2022)

So, I kept trying different things and managed to get it to ignore the faulty SSD! What worked was `hint.ahcich.1.disabled="1"` in device.hints. I would have understood that the driver would have only been "ahci" but ahcich worked, so I won't complain.

It's booting like a rocket now. One very good point for FreeBSD. Though this makes me think that there has to be a way to get it to work under Linux. I'll give it a last shot but that will most likely become my FreeBSD laptop. Thanks all for your help.


----------



## VladiBG (Nov 15, 2022)

If the bios is unlocked you should be able to show the hidden advanced menu and disable port0 from "Advanced" menu "SATA Configuration"


----------



## tithom (Nov 17, 2022)

VladiBG said:


> If the bios is unlocked you should be able to show the hidden advanced menu and disable port0 from "Advanced" menu "SATA Configuration"
> View attachment 15073


Sorry, is that a windows programme? My BIOS certainly does not look like this and there's no hidden menu


----------



## VladiBG (Nov 17, 2022)

Yes this is the bios of Asus UX32VD loaded in the bios editor AMIBCP 4


----------

