How do I fix initramfs not finding root?

15,428

I followed this specific guide and the thing that fixed it for me was following these instructions:

  1. Find out which of your partitions contains your system. You can do this by typing ls to see all of your drives, and then ls (hdX,gptX) to see the contents of one of the partitions.
  2. Once you've determined the correct partition (mine was (hd3,gpt3)) the next thing is you need to make sure that your prefix is set correctly. You can do this by typing in set to display all of the set variables. The tutorial shows an example where the prefix was set incorrectly.
  3. If your partition was not set correctly, set the correct partition with set prefix=(hd3,gpt3)/boot/grub. Use your partition details.
  4. Afterwards, set root value with set root=(hd3,gpt3). Use your partition values.
  5. insmod normal - Not sure what this does, but his tutorial says it loads a module.
  6. The next part is to do linux /boot/vmlinuz-XXXXXXXXX root=/dev/sdd3 ro depending on whatever is on your machine.

⚠️ The value that you should set to root varies, depending on which partition on your hard drive you installed your operating system on.

In my case, I cut up my hard drive into 5 parts, and I used parts 3, 4, and 5 for my Ubuntu machine. Part 3 had the operating system, Part 4 had my swap files, and Part 5 had my hard drive data. (If you were in the desktop session already, you can check this using lsblk to see how the files were partitioned and what sizes they were assigned).

I used sdd3 because the partition that held my OS is on the third partition of my drive sdd. This appears to be the missing part which caused me to get brought to initramfs with root not being specified.

  1. Then do initrd /boot/initrd-XXXXXXX.
  2. Finally, boot.

If there are other unix/linux/ubuntu specialists there who could give more clarity on what I may not have explained clearly, please feel free to edit this message.

Share:
15,428

Related videos on Youtube

Phaedric Alaren
Author by

Phaedric Alaren

Updated on September 18, 2022

Comments

  • Phaedric Alaren
    Phaedric Alaren over 1 year

    I recently had a bad installed of Ubuntu 19.10 (and consecutive clean installs yield the same effect). I can boot to GRUB with no issue, but from there I only get a purple screen when trying to boot Ubuntu itself.

    I tried several solutions found elsewhere, including trying to fix it through a Live USB, but to no avail.

    The furthest I've yet gotten is specifying root, Linux, & initrd are located & telling it to boot.

    But for some reason, initramfs tells me "No root device specified. Boot arguments must include a root=parameter."

    I already told it what root was, what gives?

    (Still a bit of a Linux n00b so bear with me, please)

    • kenn
      kenn about 4 years
      when you boot up the computer you need to recreate initramfs: update-initramfs -u -k all
    • Phaedric Alaren
      Phaedric Alaren about 4 years
      And where should I input this command? From GRUB?
    • kenn
      kenn about 4 years
      No, from desktop session. You need to run two commands indeed. First update-grub then update-initramfs -u -k all
    • Phaedric Alaren
      Phaedric Alaren about 4 years
      So from Live USB? Because as I said, I can't even get to the desktop on the native install. But if that's what you mean, I'll give it a shot
    • kenn
      kenn about 4 years
      I thought you could boot up and log in desktop session after providing kernel parameters. Take a look at this : unix.stackexchange.com/questions/329926/… If you fail then you have no choice but a liveusb. Do you have more than one partition in your hard drive? Ubuntu 19.10 is not recommended, it has short term support. You need to use 18.04 , 19.04 or 20.04 versions.
    • kenn
      kenn about 4 years
      If you have created a new partition prior boot failure, it may be the cause of the error. Be wary of data loss. Any mistake can lead to irrecoverable data loss.