how does one verify the bootability of initramfs image without actually rebooting the system -- the reason why we need this is - suppose if one takes the system for a short window and suddenly finds that the initramfs image is corrupt and has to do recovery

one idea I got is to transfer this image to a Virtual machine and boot it off of that ..?

can we extract the image and compare its contents to a golden image , so to speak . image which we think is not damaged.

thanks, ~Sai

  • 1
    How are you creating corrupt initramfs images? – Michael Hampton Apr 7 '15 at 16:04
  • 1
    there could be many reasons why the initramfs images gets corrupt - incorrect shutdown , disk issues and what not -- point is - we need to make sure the image is bootable – sai garimella Apr 7 '15 at 16:20

You can use qemu to test your initramfs files.

qemu-kvm -kernel /boot/vmlinuz-3.19.3-200.fc21.x86_64 \
  -initrd /boot/initramfs-3.19.3-200.fc21.x86_64.img \
  -hda foo

The system will obviously fail to boot since the hda option points to a dummy file. It should be enough to prove that an initramfs is bootable, though. Provide a valid qcow image if in doubt.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.