SCSI generic driver not loading at boot
SCSI generic driver not loading at boot
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!
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!
Re: SCSI generic driver not loading at boot
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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: SCSI generic driver not loading at boot
See the RHEL 7.1 release notes and the "sg3_utils component, BZ#1186462" section for an explanation.
Re: SCSI generic driver not loading at boot
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!
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!
-
- Posts: 3
- Joined: 2015/06/11 14:29:46
- Location: Chateauguay, Qc, CANADA
- Contact:
Re: SCSI generic driver not loading at boot
Adding this should do the trick:
/etc/sysconfig/modules/sg.modules
/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
Re: SCSI generic driver not loading at boot
The upcoming systemd-208-20.el7_1.5 update should make the sg devices available again without additional tricks.
Re: SCSI generic driver not loading at boot
Christ, thank you for this thread. I was wondering WTF was going on.
Re: SCSI generic driver not loading at boot
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
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
Re: SCSI generic driver not loading at boot
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.
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.
Re: SCSI generic driver not loading at boot
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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke