Quick Tip: How to rebuild all initrds with dracut in CentOS 6/7

If you need to automatically rebuild all initrds for all installed kernels:

rpm -qa | grep kernel | grep -v headers | grep -v tools | sed ‘s/^kernel\-//g’ | xargs -i dracut -v -f /boot/initramfs-{}.img {}

Oh, and while we’re at it, the same for Ubuntu

update-initramfs -u -k all

5 Comments

  1. Ah, I see what’s happening. Make that two dashes in front of regenerate:

    dracut – -regenerate-all -v -f

Leave a Reply

Your email address will not be published. Required fields are marked *

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