Make driver disk for CentOS


If you want to make a generic USB driver disk for RHEL/CentOS, you can follow these instructions. The drivers are in rpm format, and you need those drivers during installation of a new system, primarily storage drivers.


On an existing CentOS system, install the dependencies.

yum -y install createrepo squashfs-tools

Change directory to where your rpms and make a new directory tree.

cd path/to/rpms
export SQUASH_ROOT=./squashfs-root
mkdir -p "${SQUASH_ROOT}/rpms/x86_64"

Make a specific file with any contents you wish.

echo "My custom driver disk" > "${SQUASH_ROOT}/rhdd3"

Make a yum repository

cp -p *rpm "${SQUASH_ROOT}/rpms/x86_64/"
createrepo --basedir "${SQUASH_ROOT}/rpms/x86_64/" .

Make the driver disk-only components.

touch "${SQUASH_ROOT}/.rundepmod"
( cd "${SQUASH_ROOT}" ;
   for thisrpm in "${SQUASH_ROOT}/rpms/x86_64/*rpm ;
      rpm2cpio "${thisrpm}" | cpio -imVd ./lib/*

And make the image file from the custom directory.

mksquashfs "${SQUASH_ROOT}" ./my-driver-disk.img

Clean up the custom directory if you’re done with it! The image is now complete and we will use it for the last step.

rm -rf "${SQUASH_ROOT}"

Deploy the image onto your preferred disk drive. Be sure you know which drive is the flash drive you want!

sudo dd if=/path/to/my-driver-disk.img of=/dev/sdz

The image file should be really small, so there is no need to control block size (bs=2048). Also, this disk will not be directly readable to a regular system, so do not let that alarm you.



  1. Red Hat Enterprise Linux and CentOS 7 Driver Disk
  2. Install CentOS 7 on HP ProLiant DL360 G5 with P400i SAS Controller | Knowledge Base

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.