![]() | Oracle System Handbook - ISO 7.0 May 2018 Internal/Partner Edition | ||
|
|
![]() |
||||||||||||||||||||||
Solution Type Technical Instruction Sure Solution 1573625.1 : How to Rebuild the Initial Ramdisk Image in Oracle Linux 5 or Oracle Linux 6?
In this Document
Applies to:Linux OS - Version Oracle Linux 5.0 to Oracle Linux 6.4 with Unbreakable Enterprise Kernel [2.6.39] [Release OL5 to OL6U4]Exalogic Elastic Cloud X4-2 Hardware Linux x86 Linux x86-64 GoalThis document covers the following questions:
SolutionWhen adding new hardware to a system, or after changing configuration files that may be used earlier in the boot process, or when changing the options on a kernel module, it may be necessary to rebuild the initial ramdisk (also known as initrd or initramfs) to include the proper kernel modules, files, and configuration directives. If you are adding a new module in the initrd, first follow the instructions in "How to ensure certain modules are included in the initrd or initramfs in Oracle Linux?", or if it is a configuration change then make that change now. Once the necessary modifications have been made, it is time to rebuild the initrd/initramfs. This process differs based on the version of Oracle Linux. In these examples you will see the usage of $(uname -r), which is a way to pass the current kernel version into a command without actually typing it out. If you are working with a version of the kernel other than what is currently running, then replace $(uname -r) with the actual kernel version, such as 2.6.32-200.13.1.el5uek. Rebuilding the initrd (Oracle Linux 5)It is recommended to make a backup copy of the initrd in case the new version has an unexpected problem: # cp /boot/initrd-$(uname -r).img /boot/initrd-$(uname -r).img.bak
Now build the initrd: # mkinitrd -f -v /boot/initrd-$(uname -r).img $(uname -r)
If you are in a kernel version different to the initrd you are building (including if you are in Rescue Mode) you must specify the full kernel version, without architecture: # mkinitrd -f -v /boot/initrd-2.6.39-400.21.1.el5uek.img 2.6.39-400.21.1.el5uek
The -v verbose flag causes mkinitrd to display the names of all the modules it is including in the initial ramdisk. Rebuilding the initramfs (Oracle Linux 6)It is recommended you make a backup copy of the initrd in case the new version has an unexpected problem: # cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
Now rebuild the initramfs for the current kernel version: # dracut -f
If you are in a kernel version different to the initrd you are building (also if you are in Rescue Mode) you must specify the full kernel version, including architecture: # dracut -f /boot/initramfs-2.6.39-400.17.1.el6uek.x86_64.img 2.6.39-400.17.1.el6uek.x86_64
The -f option will force an overwrite of any existing initial ramdisk image at the path you have specified Working with Backups (All Oracle Linux Versions)As mentioned previously, it is recommended that you take a backup of the previous initrd in case something goes wrong with the new one. If desired, it is possible to create a separate entry in /boot/grub/grub.conf for the backup initial ramdisk image, to conveniently choose the old version at boot time without needing to restore the backup. This example configuration allows selection of either the new or old initial ramdisk image from the grub menu: title Oracle Linux 5 (2.6.32-200.13.1.el5uek)
root (hd0,0) kernel /vmlinuz-2.6.32-200.13.1.el5uek ro root=LABEL=/ initrd /initrd-2.6.32-200.13.1.el5uek.img title Oracle Linux 5 w/ old initrd (2.6.32-200.13.1.el5uek) root (hd0,0) kernel /vmlinuz-2.6.32-200.13.1.el5uek ro root=LABEL=/ initrd /initrd-2.6.32-200.13.1.el5uek.img.bak Alternatively, you can enter edit-mode in grub if you need to choose the old initrd and did not make a separate entry in grub.conf before rebooting. To do so:
Note: This procedure does not actually make any persistent change. At the next boot, the system will continue using the original grub.conf configuration unless it is updated.
Referenceshttps://fedoraproject.org/wiki/How_to_debug_Dracut_problemshttp://people.redhat.com/harald/dracut.html <NOTE:743540.1> - How to Build a New Initial Ramdisk Image Attachments This solution has no attachment |
||||||||||||||||||||||
|