Driver Disk: Difference between revisions

From Leo's Notes
This page was last edited on 14 February 2022, at 18:25.
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
Red Hat allows for 'driver disks' to be loaded during an install in case there is no out-of-the-box driver support for a specific piece of hardware. Basically, a driver disk is an ext2 disk image which can be created in the following steps:
Red Hat based Linux distributions using dracut allows for driver disks to be loaded during so that the installer is able to load properly on a system. Typically, you'll need to use a driver disk for a deprecated RAID/SAS controller.


== Create Driver Disk ==
== Using a driver disk ==
<syntaxhighlight lang="bash" line enclose="div">
A driver disk is a ISO or disk image that contains a kernel module package that Dracut is able to find and install as part of the boot process.
# Create a blank, 20MB image
 
dd if=/dev/zero of=driverdisk.img bs=1M count=20
=== Locating an appropriate driver ===
If you have an older server that requires a driver that's been dropped, you can most likely find it from ElRepo's DUD repo that is appropriate for your distro version. For example, for RHEL8: https://elrepo.org/linux/dud/el8/x86_64/.
 
=== Creating your own driver ===
If you don't see a driver disk appropriate for your hardware, you may need to create your own.
 
Using DKMS, you can build a driver disk file with the <code>dkms mkdriverdisk</code> command. For example: <code>dkms mkdriverdisk -d redhat -m qla2x00</code>
 
Alternatively, if you have the .rpm package containing the driver, you can point inst.dd to the RPM file directly.
 
If you need to create your own driver disk image:{{Highlight
| code = ## Create a blank, 20MB image
# dd if=/dev/zero of=driverdisk.img bs=1M count=20
 
## Format the image with ext2
# mkfs -t ext2 -q driverdisk.img
   
   
# Format the image with ext2
## mount it and copy the files over
mkfs -t ext2 -q driverdisk.img
# mount -o loop driverdisk.img /mnt/driverdisk
   
   
# mount it and copy the files over
## copy drivers to /mnt/driverdisk, then run
mount -o loop driverdisk.img /mnt/driverdisk
# umount /mnt/tmp
| lang = terminal
# copy drivers to /mnt/driverdisk, then run
}}
umount /mnt/tmp
 
</syntaxhighlight>
=== Using a driver disk with Anaconda ===
To use a driver disk, append <code>inst.dd=location</code> to the kernel arguments by hitting tab while on the grub menu. <code>inst.dd</code> supports network locations via HTTP, FTP, or NFS, and also a local device. For example: <code>inst.dd=<nowiki>http://url/driver.iso</nowiki></code>, <code>inst.dd=nfs:server/export</code>, <code>inst.dd=/dev/sdb</code>
 
If you intend to use a removeable device such as a USB stick, floppy, or an iDRAC virtual device, you will need copy the contents of the ISO file into a vfat formatted partition. Eg:
{{Highlight
| code = # dd if=/dev/zero of=driver.img bs=1M count=1
# mkfs.vfat driver.img      # Note: mkfs.vfat is provided by dosfstools
# mount -o loop driver.img /mnt
# cp -r /iso-contents/* /mnt
# umount /mnt
| lang = terminal
}}
 
=== Loading a driver disk after Anaconda has started ===
Enter a shell and install the rpm manually using <code>rpm -ivh dd-some-driver.rpm</code>. If you get any dependency issues with the kernel, try using the <code>--nodeps</code> argument as well. Once the package is installed, try to load the module with <code>insmod driver</code>. Don't use <code>modprobe</code> since it might not activate the driver.
 
If your driver is needed by Anaconda (such as storage), you'll need to restart Anaconda by running <code>systemctl restart anaconda.service</code>.
 
Be aware however, that '''Dracut won't include this missing driver''' into your initrd after installation if you load it manually like this. You'll likely need to rebuild initrd after the installation is complete to include this driver.
 
== Troubleshooting ==
 
=== Debugging issues ===
If for some reason Anaconda doesn't start after specifying a driver disk, you can have systemd log to the console to help troubleshoot the issue by appending the following to the kernel arguments:
{{Highlight
| code = systemd.log_target=console systemd.log_level=debug
| lang = text
}}
 
=== Disks don't appear after modprobe ===
Try to use <code>insmod</code> instead. When I tried loading a module with <code>modprobe</code>, it didn't seem to activate the hardware and the devices didn't show up.


Once you have the driver disk created, you will need to tell the installer to load it by booting into <code>linux expert</code> or <code>linux dd</code> from the boot loader.
== See also ==


[[Category:Linux]]
* http://archive.download.redhat.com/pub/redhat/linux/8.0/it/doc/RH-DOCS/rhl-ig-x86-en-8.0/ch-driverdisk.html
* [[How to boot Rocky Linux 8 on a Dell R710]]
{{Navbox Linux}}[[Category:Linux]]

Latest revision as of 18:25, 14 February 2022

Red Hat based Linux distributions using dracut allows for driver disks to be loaded during so that the installer is able to load properly on a system. Typically, you'll need to use a driver disk for a deprecated RAID/SAS controller.

Using a driver disk

A driver disk is a ISO or disk image that contains a kernel module package that Dracut is able to find and install as part of the boot process.

Locating an appropriate driver

If you have an older server that requires a driver that's been dropped, you can most likely find it from ElRepo's DUD repo that is appropriate for your distro version. For example, for RHEL8: https://elrepo.org/linux/dud/el8/x86_64/.

Creating your own driver

If you don't see a driver disk appropriate for your hardware, you may need to create your own.

Using DKMS, you can build a driver disk file with the dkms mkdriverdisk command. For example: dkms mkdriverdisk -d redhat -m qla2x00

Alternatively, if you have the .rpm package containing the driver, you can point inst.dd to the RPM file directly.

If you need to create your own driver disk image:

## Create a blank, 20MB image
# dd if=/dev/zero of=driverdisk.img bs=1M count=20

## Format the image with ext2
# mkfs -t ext2 -q driverdisk.img
 
## mount it and copy the files over
# mount -o loop driverdisk.img /mnt/driverdisk
 
## copy drivers to /mnt/driverdisk, then run
# umount /mnt/tmp

Using a driver disk with Anaconda

To use a driver disk, append inst.dd=location to the kernel arguments by hitting tab while on the grub menu. inst.dd supports network locations via HTTP, FTP, or NFS, and also a local device. For example: inst.dd=http://url/driver.iso, inst.dd=nfs:server/export, inst.dd=/dev/sdb

If you intend to use a removeable device such as a USB stick, floppy, or an iDRAC virtual device, you will need copy the contents of the ISO file into a vfat formatted partition. Eg:

# dd if=/dev/zero of=driver.img bs=1M count=1
# mkfs.vfat driver.img      # Note: mkfs.vfat is provided by dosfstools
# mount -o loop driver.img /mnt
# cp -r /iso-contents/* /mnt
# umount /mnt

Loading a driver disk after Anaconda has started

Enter a shell and install the rpm manually using rpm -ivh dd-some-driver.rpm. If you get any dependency issues with the kernel, try using the --nodeps argument as well. Once the package is installed, try to load the module with insmod driver. Don't use modprobe since it might not activate the driver.

If your driver is needed by Anaconda (such as storage), you'll need to restart Anaconda by running systemctl restart anaconda.service.

Be aware however, that Dracut won't include this missing driver into your initrd after installation if you load it manually like this. You'll likely need to rebuild initrd after the installation is complete to include this driver.

Troubleshooting

Debugging issues

If for some reason Anaconda doesn't start after specifying a driver disk, you can have systemd log to the console to help troubleshoot the issue by appending the following to the kernel arguments:

systemd.log_target=console systemd.log_level=debug

Disks don't appear after modprobe

Try to use insmod instead. When I tried loading a module with modprobe, it didn't seem to activate the hardware and the devices didn't show up.

See also