Re-adding Pop!_OS Recovery entry in the boot menu

Pop_OS!

Steps to re-add the Recovery partition to the boot menu of Pop_OS! 22.04

What is this guide about

I’ve been running Pop_OS! as my daily driver for months now. I do have a customised installation with a dual boot (Windows 11 and Pop_OS!), and Pop_OS! is installed on BTRFS.

A few days ago, I started getting some I/O errors while I was working and I thought I had some filesystem corruption going on. I tried rebooting into the recovery partition to check the filesystem, but I sadly discovered the entry for the recovery partition was gone from my boot menu.

The Recovery Partition is a full copy of the Pop!_OS installation disk. It can be used exactly the same as if a live disk copy of Pop!_OS was booted from a USB drive. The existing operating system can be repaired or reinstalled from the recovery mode. You can perform a refresh install, which allows you to reinstall without losing any user data or data in your home directory. Recovery can also perform a clean install, which resets all OS data. (See:Recovery Partition - System76 Support)

I am writing this short article mainly as a reminder for my own use, in case it happens again, and I hope someone else will find it useful. Need to create your Pop!_OS recovery partition from scratch? Check out this other article: Creating a Recovery Partition in Pop!_OS

Make sure you do take regular backups of your system and personal files. Although this procedure should not pose any risk, you never know when SHTF

Assumptions

This procedures assumes that Pop_OS! was installed using the default installation w/ encryption (efi partition (fat32), recovery partition (fat32), luks+lvm+ext4 (well, BTRFS in my case) for /, swap).

Here I’m assuming your disk is /dev/sda. Just run lsblk or fdisk -l to check your partitions if you are not sure what your disk is.

On my machine, lsblk returns the following

NAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0             7:0    0  27.1M  1 loop  /snap/chromium-ffmpeg/28
loop1             7:1    0  18.4M  1 loop  /snap/chromium-ffmpeg/30
loop2             7:2    0  55.5M  1 loop  /snap/core18/2409
loop3             7:3    0  55.6M  1 loop  /snap/core18/2538
loop4             7:4    0    62M  1 loop  /snap/core20/1587
loop5             7:5    0    62M  1 loop  /snap/core20/1611
loop6             7:6    0   103M  1 loop  /snap/lxd/23339
loop7             7:7    0   103M  1 loop  /snap/lxd/23367
loop8             7:8    0    47M  1 loop  /snap/snapd/16010
loop9             7:9    0    47M  1 loop  /snap/snapd/16292
sda               8:0    0 465.8G  0 disk  
├─sda1            8:1    0   498M  0 part  /boot/efi
├─sda2            8:2    0     4G  0 part  /recovery
└─sda3            8:3    0 461.3G  0 part  
  └─cryptdata   253:0    0 461.3G  0 crypt 
    ├─data-root 253:1    0 441.3G  0 lvm   /run/timeshift/backup
    │                                      /var/lib/docker/btrfs
    │                                      /home
    │                                      /
    └─data-swap 253:2    0    16G  0 lvm   [SWAP]
sdb               8:16   0 476.9G  0 disk  
├─sdb1            8:17   0   260M  0 part  
├─sdb2            8:18   0   128M  0 part  
├─sdb3            8:19   0   475G  0 part  
├─sdb7            8:23   0   525M  0 part  
└─sdb8            8:24   0     1G  0 part  

sdb is the disk where I have Windows 11, sda is the SDD with Pop_OS!, and /dev/sda2 is the Pop_OS! recovery partition.

Ignoring sdb, I assume you have Pop_OS! installed on sda, if that’s not the case, you will need to tweak the commands accordingly.

Checking the status of the boot menu entries

Pop_OS! uses systemd-boot, not Grub (don’t ask me since which version, I don’t remember). The configurations on the entries are in /boot/efi/loader/entries

open a terminal and run

sudo -i

to enter the interactive mode (root), and check what configs are there for the boot menu:

$ cd /boot/efi/loader/entries
$ ls -l 
drwx------ 2 root root 4.0K Aug 16 16:35 ./
drwx------ 3 root root 4.0K Aug 16 16:48 ../
-rwx------ 1 root root  348 Aug 12 22:25 Pop_OS-current.conf*
-rwx------ 1 root root  366 Aug 12 22:25 Pop_OS-oldkern.conf*

Ok, so there’s no file with the configuration to boot into the recovery partition. Let’s re-create it.

By default, Pop_OS! won’t show you any boot menu and you need to press the spacebar while systemd boots to see the menu. If you want a boot menu to always appear, you can edit the loader configuration at this point.

Edit /boot/efi/loader/loader.conf

  • add timeout 2 at the end of file so to be able to easily boot into the recovery partition. Your ending file should look like the following:
default Pop_OS-current
timeout 2

Recreating the boot menu entry

You will need both the UUID and the partition UUID of your recovery partition. They can be retrieved with the following command:

$ blkid /dev/sda2
/dev/sda2: UUID="7D44-37D9" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="recovery" PARTUUID="581b8482-5689-49b6-bc0a-52ab82a514d7"

Your PARTUUID and UUID numbers will be, obviously, different.

We will need to create a new file in /boot/efi/loader/entries, I named it Recovery.conf.

The template file is the following:

title Pop!_OS recovery
linux /EFI/Recovery-{{ UUID }}/vmlinuz.efi
initrd /EFI/Recovery-{{ UUID }}/initrd.gz
options boot=casper hostname=recovery userfullname=Recovery username=recovery live-media-path=/casper-{{ UUID }} live-media=/dev/disk/by-partuuid/{{ PARTITION UUID }} noprompt

so, in my case, I created the file as following:

title Pop!_OS recovery
linux /EFI/Recovery-7D44-37D9/vmlinuz.efi
initrd /EFI/Recovery-7D44-37D9/initrd.gz
options boot=casper hostname=recovery userfullname=Recovery username=recovery live-media-path=/casper-7D44-37D9 live-media=/dev/disk/by-partuuid/581b8482-5689-49b6-bc0a-52ab82a514d7 noprompt

That’s it.

Save the file, Issue a sync (just to be sure), and you can reboot your system and test the recovery partition.

Need to create your Pop!_OS recovery partition from scratch? Check out this other article: Creating a Recovery Partition in Pop!_OS

Diego Zaccariotto
Diego Zaccariotto
Head of Customer Support - Team Leader EMEA | Service Operations Management, Change & Transformation

I’m a Senior Manager and IT professional with 25+ years of experience, a background in system administration, and an MBA.