Skip to content

Instantly share code, notes, and snippets.

@abarrak
Last active December 17, 2024 18:58
Show Gist options
  • Save abarrak/5e4acda440e9268c5ff6e4cf28c87489 to your computer and use it in GitHub Desktop.
Save abarrak/5e4acda440e9268c5ff6e4cf28c87489 to your computer and use it in GitHub Desktop.
Managing Kernel modules
# Module location
ls /lib/modules/{uname -r}/kernel
# list currently loaded ones
lsmod
# display details
modinfo virio
# load
modprobe -v dm_mirror
# remove
modprobe -r dm_mirror
# scan driver modules
depmod -v
depmod -a
# persistent loading and blocking
echo "dm_mirror" > /etc/modules-load.d/dm_mirror.conf
echo "blacklist virio" > /etc/modprobe.d/virio.conf
##
# Case: load module on the fly
#
# Install:
yum install <MODULE-PACKAGE> --downloadonly --downloaddir=/tmp/new-modules
yum install /tmp/new-modules/<MODULE-PACKAGE>
#
# Create new ram image:
cp /boot/initramfs-$(unmae -r).img /boot/initramfs-$(unmae -r).img.bak
dracut -f -v
lsinitrd <NEW_IMAGE_PATH>
#
# Start:
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment