SSD, hangs at shutdown Synchronizing SCSI cache

I’ve installed on an existing SSD partition. It doesn’t seem the installer is customizing for SSDs.

Cannot gracefully shutdown or reboot. Why? After removing “quiet” from the Grub entry I find the system consistently hangs at

sd 0:0:0:0 [sda] Synchronizing SCSI cache

Until this point all services exit properly.

I installed hdparm and executed

sudo hdparm -W0 -k1 /dev/sda

and

sudo hdparm -F /dev/sda

. This allows for a happy shutdown. I did have a STARTUP hang on the swap partition /dev/sda3 a couple times, not consistent so maybe unrelated.

I’d like to use SSD write cache buffer, so… Why is my system hanging? What does “sd 0:0:0:0” mean, systemd and system disk?

I noticed the fstrim.service wasn’t configured by the installer. I have setup the service and timer.

Update: I forgot to mention, I put the write cache flag back and no more hang yet… Why?

sudo hdparm -W1 -k1 /dev/sda

With writeback cache enabled the data that is intend to be written to the ssd is instead written to a cache. The long “hanging” at shutdown could indicate it writing huge stuff from that cache back to ssd.
Basically it should then after a couple of minutes if writing finished turn off normally.