SCSI generic driver not loading at boot

Issues related to applications and software problems
aix42day
Posts: 2
Joined: 2015/05/02 00:47:57

SCSI generic driver not loading at boot

Post by aix42day » 2015/05/02 01:20:43

After taking a recent update to CentOS 7, I found that the SCSI generic driver was not loading on boot. Prior to the update, it was working as expected and loading at boot time. I am able to load the module manually and successfully using the command modprobe sg.

I suspect this was the result of a kernel update (kernel-3.10.0-123.13.2.el7.x86_64) that came with the update bundle, but am not 100% sure of this.

Has anybody experienced this issue with taking the most recent CentOS update? Any ideas on how to restore the module loading at boot time?

Searching online for "loading modules at boot time" I see references to this being done in /etc/sysconfig/modules, but I guess I'd like to understand what happened here before changing anything.

Thanks in advance for any insight!

User avatar
TrevorH
Forum Moderator
Posts: 25047
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SCSI generic driver not loading at boot

Post by TrevorH » 2015/05/02 10:03:58

If you're only on kernel-3.10.0-123.13.2.el7.x86_64 then you are not on the latest. That's part of 7.1 and is kernel-3.10.0-229.1.2.el7.x86_64 so perhaps your first step is to try that and see if the problem is fixed.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
avij
Forum Moderator
Posts: 2914
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: SCSI generic driver not loading at boot

Post by avij » 2015/05/02 16:42:14

See the RHEL 7.1 release notes and the "sg3_utils component, BZ#1186462" section for an explanation.

aix42day
Posts: 2
Joined: 2015/05/02 00:47:57

Re: SCSI generic driver not loading at boot

Post by aix42day » 2015/05/02 17:07:54

Thanks very much for the replies TrevorH and Avij!

TrevorH: I assumed I had updated to the latest available, since I picked up the updates from a CentOS package repo. Apparently not.

Avij: Thanks for the link. This is definitely what I'm seeing and the solution is clearly stated in the release notes. An init script in /etc/sysconfig/modules should do the trick.

Thanks again!

guyboisvert
Posts: 2
Joined: 2015/06/11 14:29:46

Re: SCSI generic driver not loading at boot

Post by guyboisvert » 2015/06/11 14:33:04

Adding this should do the trick:

/etc/sysconfig/modules/sg.modules

Code: Select all

#!/bin/sh


files=$(ls /dev/sg* 2> /dev/null | wc -l)

if [ "$files" = "0" ]
then
        exec /sbin/modprobe sg >/dev/null 2>&1

fi


User avatar
avij
Forum Moderator
Posts: 2914
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: SCSI generic driver not loading at boot

Post by avij » 2015/06/23 12:53:21

The upcoming systemd-208-20.el7_1.5 update should make the sg devices available again without additional tricks.

Locane
Posts: 25
Joined: 2014/09/05 00:40:12

Re: SCSI generic driver not loading at boot

Post by Locane » 2015/07/28 10:38:02

Christ, thank you for this thread. I was wondering WTF was going on.

ThiagoCMC
Posts: 1
Joined: 2016/02/02 22:42:47

Re: SCSI generic driver not loading at boot

Post by ThiagoCMC » 2016/02/03 01:37:58

Guys,

I'm facing this problem on most recent CentOS 7.2!

I am using Packer + QEmu (with "disk_interface": "virtio") to build CentOS 7.2 VMDK images, however, the resulting image does not boot on VMware (I believe that it is because CentOS was installed by using /dev/vda and, on VMWare, it is /dev/sda).

Only Rescue mode works / boots okay.

After many hours of research, I figured out that the "sg" module is not being loaded by the default grub menu entry.

Even after creating the script "/etc/sysconfig/modules/sg.modules" to force sg load, it does not work.

I'm also trying: echo sg > /etc/modules-load.d/sg.conf but, still does not work!

What more can I do to fix this?

Do I need to rebuild initramfs or something like that?

Thanks in advance!
Thiago

kkinnear
Posts: 2
Joined: 2016/06/14 17:55:04

Re: SCSI generic driver not loading at boot

Post by kkinnear » 2016/06/14 18:07:01

ThiagoCMC -- did you ever figure out what was going wrong?

I'm having the reverse problem -- I'm building a CentOS 7.2 VM on VMware ESXi using packer, and it works fine when installed on VMware. However, when I convert the OVA to a kit that will run on KVM, and install it with the disks "virtio", it won't boot. If I make the disks "ide", it boots fine. It was built on VMware as /sda /sdb disks, and while I'm using UUID in /etc/fstab, it isn't turning the disks into /vda /vdb disks.

Now, I wouldn't necessarily think that it would do that, except that our identical CentOS 6.5 VM build procedure on VMware builds a CentOS 6.5 OVA that, when converted to a KVM kit, installs with disks as "virtio" disks just fine. The disks become /vda and /vdb with no problem on CentOS 6.5.

So, there is something different in CentOS 7.2. I first suspected the change to grub2, and indeed a have a device.map with /sda /sdb in them. So I tried changing that to /hda /hdb and doing the grub2-mkconfig -o /boot/grub2/grub.cfg with no better result -- still won't run with virtio disks.

I'm currently trying to change the kickstart file to not specify /sda /sdb in the partitioning to see if that helps.

I do seem to have /dev/sg devices, for what that is worth (after I boot it with ide disks).

If anyone has any ideas, I'd love to hear them. This has been particularly frustrating since it all worked in CentOS 6.5.

User avatar
TrevorH
Forum Moderator
Posts: 25047
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SCSI generic driver not loading at boot

Post by TrevorH » 2016/06/14 18:22:21

Rebuild the initramfs and make sure you include the virtio modules - most likely you need virtio_blk, virtio_scsi, virtio_pci and virtio_ring as well as virtio itself. Or change dracut.conf to include those automatically or change hostonly=yes to no.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply