6

When experiencing a boot failure I see the system drop to a prompt which says dracut.

It is my understanding dracut is used to generate an image of initramfs. What I'm confused about is that based on the fact that I'm dropping to a shell titled "dracut" it doesn't appear to just be a utility program for generating initramfs, but it also actually is a program on its own that runs at boot. Is this correct? - If the above is accurate then what is the distinction/relationship between initramfs and dracut?

6
  • There is a known workaround: rootusers.com/fixing-vmware-virtual-machine-pvscsi-import-error ; this question got too many "questions" and gets confusing. Understanding why it happens is not that difficult, and it is more an artifact of vmware than the Linux kernel per se. But then you are also asking here to explain other concepts at the same time. Commented Jun 4, 2019 at 17:40
  • Your edit doesn't makes sense to me - the first part of my question was to say that the scenario isn't really what the question is about. I already know about the VMWare around and have already fixed that problem. The point of the question was to better understand Linux. The VMWare scenario was only there to provide a context. Is there a particular part of my line of questioning that is confusing? Commented Jun 4, 2019 at 19:09
  • Too many questions and concepts asked at once, but I am repeating myself. And I moved the comment to down below. I would advise reading our FAQ Commented Jun 4, 2019 at 20:32
  • Fixed. I deleted most of the post due to multiple questions causing confusion. Commented Jun 4, 2019 at 21:44
  • I'm confused by the lack of context, could you please add more detail?
    – SetAlias
    Commented Jun 4, 2019 at 23:34

1 Answer 1

3

Dracut is both a tool for generating an instance of initramfs and it also has what is called the dracut emergency shell. The purpose of initramfs is to provide an environment capable of finding, loading, and passing execution to the root file system. If at any point something goes wrong during this process initramfs will drop to the dracut emergency shell giving you an opportunity to debug/attempt to repair the problem.

Regarding the comment:

"I would be happy to. To clarify, what happened originally was that I had a VMWare VM running RHEL. Due to a problem with importing VMs directly into VMWare Workstation I decided to just pull the VM's hard drive from ESXi and onto a new VM in VMWare Workstation. However, when I attempt to boot the VM, I am able to successfully load GRUB and subsequently dracut, but dracut fails to find the root file system. This is strange because one would expect that if dracut could load, the system would also be able to find the root file system."

When you install RHEL, dracut generates an instance of initramfs which only contains the drivers necessary to be compatible with the hardware on which the OS was installed. When I moved my RHEL instance's hard drive from ESXi on one set of virtual hardware to VMWare Workstation, a different set of virtual hardware, the initramfs associated with the kernel no longer had the appropriate set of drivers required to find and load the root file system.

To fix the problem, before you move the hard drive, you need to run dracut --force --no-hostonly. To quote https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/

The force parameter tells dracut that it is OK to overwrite the existing initramfs archive. The no-hostonly parameter overrides the default behavior of including only drivers that are germane to the currently-running computer and causes dracut to instead include all drivers in the initramfs.

This means that dracut will now be "bloated" and have all the applicable drivers required for when the hard drive is moved. After you finish moving the hard drive you have to rerun dracut with dracut --force to regenerate a lightweight version of dracut.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .