LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 15.0: Fix for system crash caused by running "rescan-scsi-bus -r" (https://www.linuxquestions.org/questions/slackware-14/slackware-15-0-fix-for-system-crash-caused-by-running-rescan-scsi-bus-r-4175736845/)

jwoithe 05-09-2024 02:02 AM

Slackware 15.0: Fix for system crash caused by running "rescan-scsi-bus -r"
 
Running "rescan-scsi-bus -r" on a Slackware 15 system will immediately crash the system except if root is on an NVMe device (and even then, most other disk devices will become inaccessible). Due to a change in the format of the output produced by the "sg_inq" command, rescan-scsi-bus treats every SCSI or SCSI-like disk as if they were no longer present. Therefore if the "-r" option is supplied, every disk will be removed from the system. For most people this will include the root filesystem. The end result is a system which can no longer access its own disks. A hard reset is the only way to recover.

The problem has been fixed upstream in the sg3_utils project. See https://github.com/doug-gilbert/sg3_utils/pull/10 for the details and the patch.

I believe it is appropriate to address this issue in Slackware 15. As things stand, almost anyone who runs rescan-scsi-bus with the "-r" option will immediately crash their system - a result that is almost certainly not expected or desired. Slackware 15 currently ships sg3_utils 1.47. Shifting to version 1.48 (which includes the patch) is probably not feasible because it will result in a shared library version change, which would then force the rebuilding of other packages (sdparm, udisks and so on). It may therefore be necessary to cherrypick the patch from the above pull request and apply it to sg3_utils 1.47. It applies cleanly.

The problem does not affect current because it already has sg3_utils 1.48.

jwoithe 05-09-2024 05:56 PM

The bugfix patch has subsequently been included in the sg3_utils-1.47-x86_64-2_slack15.0.txz package update for 64-bit and 32-bit Slackware 15.0 (see ChangeLog entry dated Thu May 9 19:26:51 UTC 2024). Thanks Pat!

ikocher 05-14-2024 05:46 PM

This bug also affects the installer.

For the last 2 days I have been trying to install Slackware15 on a Dell R720 with a PERC H710P mini, via iDRAC with /usb-and-pxe-installers/usbboot.img as virtual media, and when /var/lib/pkgtools/setup/setup.80.make-bootdisk runs after initial install, it trashes all SCSI devices.
I even tried to run it just after installer loads without running `setup`, same issue. Only reboot takes you out of this issue.
I tried --forcerescan aqnd --forceremove, and sda and sdb still do not come back.
The virtual media on sdc works OK after running rescan-scsi-bus.


In the end to be able to successfuly install:
1. run setup as usual
2. wait until a/pkgtools-15.0-noarch-42 is installed
3. `vi /mnt/var/lib/pkgtools/setup/setup.80.make-bootdisk`
3.1. comment the line where " /sbin/rescan-scsi-bus -l 1>$RDIR 2>$RDIR" is.
4. mv /sbin/rescan-scsi-bus /sbin/rescan-scsi-bus.no
4.1. call me paranoid ;)


PERC H710P mini is reported in lspci as:
02:00.0 RAID bus controller: Broadcom / LSI MegaRAID SAS 2208 [Thunderbolt] (rev 05)


All times are GMT -5. The time now is 12:02 AM.