Fix Pop! OS Booting To BusyBox Shell 🥸

DAMIAN ROBINSONDAMIAN ROBINSON
4 min read

How It Always Begins 🤦🏽‍♂️

I installed VMWare Workstation Pro and after a few minutes of firing up a new VM, everything on my system just stopped working and I had to do a hard shutdown via the power button. When i rebooted, I found myself staring blankly at the BusyBox shell, which is something I’d never even heard of before. At that moment, I figured my system was caput, but I steeled myself, all stoic-like, poured a cup of freshly-brewed coffee, and said, “Hell no! Not today, Linux!” And it was thus my trouble-shooting journey began. lol

Stuck At (initramfs) ? 😢

If your Pop!_OS system fails to boot and drops into the initramfs shell, it may mean that the system can't find the partition definitions it needs to mount filesystems correctly. This is often due to a missing or incorrect /etc/fstab file, which tells the system how to mount partitions during boot.

We’re gonna walk through the steps to manually fix the issue by rebuilding the /etc/fstab file using Parotids. This solution is suitable for situations where the system is stuck in initramfs, and the system can’t mount partitions, because it’s referencing fstab when it’s not even there.


Problem Overview 🧐

You were likely experiencing the following:

  • Your Pop!_OS system was booting fine, but suddenly it failed to launch applications or became unresponsive.

  • Upon rebooting, your system would no longer boot properly, landing in the initramfs BusyBox shell.

  • Like me, you might try mounting your boot partition, but the system reports that it can’t find /etc/fstab, and as a result, the partition’s not being mounted.

This often happens when the system is unable to locate the correct partition identifiers in /etc/fstab—a file for mounting partitions and booting the system.


Solution Overview 💡

Our solution involves the following 4-step process:

  1. Retrieve the PARTUUIDs of your partitions.

  2. Create the missing /etc/fstab directory if it doesn't exist.

  3. Rebuild the /etc/fstab file with the correct PARTUUID values.

  4. Reboot the system.


Step-By-Step ☑️

Step 1: Retrieve The PARTUUIDs

First, you need to identify the PARTUUIDs of your system’s partitions, like so:

  1. Type ls /dev to list all available partitions:

     ls /dev
    

    This will list all available partitions on your system, such as /dev/sda1, /dev/sda2, etc.

  2. Next, use the blkid command to get the PARTUUIDs of the partitions. You can run the command by itself to display all partitions at once, or you can run it for each partition, as shown below:

     blkid /dev/sda1
    

    Example output:

     /dev/sda1: PARTUUID="xxxx-xxxx" TYPE="vfat"
    

    Repeat this for all your partitions (e.g., /dev/sda2, /dev/sda3) to get the PARTUUID values.

    Write down or copy the PARTUUID for each partition that you want to include in the /etc/fstab file (e.g., root, boot, recovery, swap).

Step 2: Create the /etc Directory (if Missing)

Next, you need to make sure the /etc directory exists on your mounted root filesystem.

  1. Use the following command to create the directory structure if it’s not already present:

     mkdir -p /mnt/etc
    

    This will create the /mnt/etc directory, which is where we will place the new /etc/fstab file.

Step 3: Rebuild the /etc/fstab File

Now that you have the PARTUUIDs for your partitions, you can recreate the /etc/fstab file.

  1. To do this, use the echo command to create the /etc/fstab file with the correct PARTUUID entries for each partition on your system. For example:

    • Root partition: /dev/sda3 with PARTUUID=xxxx-xxxx

    • Boot partition: /dev/sda1 with PARTUUID=yyyy-yyyy

    • Recovery partition: /dev/sda2 with PARTUUID=zzzz-zzzz

    echo "PARTUUID=xxxx-xxxx  /  ext4  defaults  0  1" > /mnt/etc/fstab  # Root partition
    echo "PARTUUID=yyyy-yyyy  /boot  vfat  defaults  0  2" >> /mnt/etc/fstab  # Boot partition
    echo "PARTUUID=zzzz-zzzz  /mnt/recovery  vfat  defaults  0  0" >> /mnt/etc/fstab  # Recovery partition

Replace xxxx-xxxx, yyyy-yyyy, and zzzz-zzzz with the actual PARTUUIDs that you retrieved earlier.

  1. After adding the entries, confirm the contents of the /mnt/etc/fstab file:

     cat /mnt/etc/fstab
    

    It should look like this:

     PARTUUID=xxxx-xxxx  /  ext4  defaults  0  1
     PARTUUID=yyyy-yyyy  /boot  vfat  defaults  0  2
     PARTUUID=zzzz-zzzz  /mnt/recovery  vfat  defaults  0  0
    

Step 4: Reboot the System

With the /etc/fstab file correctly set up, it's time to reboot your system.

  1. To reboot from the initramfs shell, use the exec reboot command:

     exec reboot
    
  2. Your system should now attempt to mount the partitions as defined in /etc/fstab and boot properly to the login screen.


All Is (Should Be) Well 😎

By following these four steps—retrieving the correct PARTUUIDs, creating the necessary /etc/fstab file, and rebooting your system—you should be able to fix the initramfs boot issue and restore proper functionality to your Pop!_OS system.

Dance a fkn jig!!! 🤣

If you encounter further issues, remember that it's always possible to adjust the /etc/fstab file, run filesystem checks (fsck), or boot from a live USB for more advanced troubleshooting.

Good luck, and happy troubleshooting!


0
Subscribe to my newsletter

Read articles from DAMIAN ROBINSON directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

DAMIAN ROBINSON
DAMIAN ROBINSON