From 13e73309654cb87d431bd44cbc45c1848e1a0157 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 6 Dec 2023 13:12:03 -0700 Subject: [PATCH 1/6] Reorder article and update sections --- content/bootloader.md | 122 +++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 73 deletions(-) diff --git a/content/bootloader.md b/content/bootloader.md index 896ca3e6f2..d70ac429ce 100644 --- a/content/bootloader.md +++ b/content/bootloader.md @@ -21,7 +21,7 @@ A bootloader takes care of getting the operating system started up. It is also r ### Important Note -If you need to configure grub-pc (for example, after an update), installing GRUB to all devices will break GRUB. You will need to install to `/dev/sda` _not_ `/dev/sda1`. +If you need to configure grub-pc (for example, after an update), installing GRUB to all devices will break GRUB. You will need to install to `/dev/sda` or `/dev/nvme0n1` _not_ `/dev/sda1` or `/dev/nvme0n1p1`. On a fresh install of Pop!_OS 18.04 and newer, systemd-boot is used rather than the GRUB bootloader. The following instructions only apply to systems using the GRUB bootloader, otherwise refer to the systemd-boot section of this article. @@ -33,11 +33,7 @@ Please see our instructions for making a live disk of Pop!_OS [here](/articles/l ### Boot from Live Disk -Once you have the disk made, reboot your system. You'll need to tell the computer to boot from the live disk. When you see the System76 logo on the screen, press and hold the appropriate key for your system: - -Laptops | Desktops --------- | -------- -Hold Esc, F7, or F1 | Hold F8, F10, or F12 +Once you have the disk made, reboot your system. You'll need to tell the computer to boot from the live disk. When you see the System76 logo on the screen, press and hold the appropriate key for your system based on this [article](/articles/boot-menu). Use the arrow keys and Enter key to select the live disk from the boot menu. @@ -68,13 +64,27 @@ Pop!_OS 20.04 LTS 4 496GB 500GB 4295MB linux-swap(v1) swap ``` ---- +Ubuntu 22.04 LTS -## How to tell if your system is EFI-based or legacy boot +``` + Number Start End Size File system Name Flags + 1 1047kB 538MB 537MB fat32 EFI System Partition boot, esp + 2 538MB 496GB 491GB ext4 +``` -## systemd-boot +Pop!_OS 22.04 LTS -### EFI Boot +``` + Number Start End Size File system Name Flags + 1 2097kB 524MB 522MB fat32 boot, esp + 2 524MB 4819MB 4295MB fat32 recovery msftdata + 3 4819MB 496GB 491GB ext4 root + 4 496GB 500GB 4295MB linux-swap(v1) swap +``` + +--- + +## How to tell if your system is EFI-based or legacy boot Most computers sold after 2014 use UEFI mode. If `boot, esp` is listed under `flags` in the earlier `parted` output, then the system is installed in UEFI mode. You can also use this command to verify that your OS is installed in UEFI mode: @@ -94,7 +104,13 @@ Additionally, if `bios_grub` is listed under `flags`, the system is installed in ### EFI Boot - Pop!_OS (systemd-boot) -If the echo command at the beginning of this page says that the OS is installed in EFI mode **and** you are using Pop!_OS, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. +If the echo command at the beginning of this page says that the OS is installed in EFI mode **and** you are using Pop!_OS, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. If you see the error below then your drive is encrypted with LUKS: + +``` +mount: /mnt: unknown filesystem type 'crypto_LUKS'. +``` + +Follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. First, we need to mount the OS partitions. Run these commands based on what type of disk you have: @@ -103,7 +119,7 @@ First, we need to mount the OS partitions. Run these commands based on what type | `sudo mount /dev/nvme0n1p3 /mnt` | `sudo mount /dev/sda3 /mnt` | | `sudo mount /dev/nvme0n1p1 /mnt/boot/efi` | `sudo mount /dev/sda1 /mnt/boot/efi` | -If you are using a non-default partitioning scheme (such as a dual boot), replace `nvme0n1p3` or `sda3` with the Pop!_OS root partition and `nvme0n1p1` or `sda1` with the EFI system partition (ESP). +>**NOTE:** If you are using a non-default partitioning scheme (such as a dual boot), replace `nvme0n1p3` or `sda3` with the Pop!_OS root partition and `nvme0n1p1` or `sda1` with the EFI system partition (ESP). Then continue with the following commands for either disk type: @@ -116,36 +132,45 @@ exit sudo bootctl --path=/mnt/boot/efi install ``` -## GRUB EFI Boot +### EFI Boot - Ubuntu (GRUB) -Most computers sold after 2014 use UEFI mode. If `boot, esp` is listed under `flags` in the `parted` output from earlier, then the system is installed in UEFI mode. You can also use this command to see if the OS is installed in UEFI mode: +If the echo command at the beginning of this page says that the OS is installed in EFI mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. If you see the error below then your drive is encrypted with LUKS: -```bash -[ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy mode" +``` +mount: /mnt: unknown filesystem type 'crypto_LUKS'. ``` -Run these commands based on what type of disk you have: +Follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. + +First, we need to mount the OS partitions. Run these commands based on what type of disk you have: -| NVMe Drives | SATA Drives | -| :---------------------------------------- | :------------------------------------| +| NVMe Drive | SATA Drive | +| :---------------------------------------- | :----------------------------------- | | `sudo mount /dev/nvme0n1p2 /mnt` | `sudo mount /dev/sda2 /mnt` | | `sudo mount /dev/nvme0n1p1 /mnt/boot/efi` | `sudo mount /dev/sda1 /mnt/boot/efi` | -If you are using a non-default partitioning scheme (such as a dual boot), replace `nvme0n1p2` or `sda2` with the Pop!_OS root partition and `nvme0n1p1` or `sda1` with the boot partition. +If you are using a non-default partitioning scheme (such as a dual boot), replace `nvme0n1p2` or `sda2` with the Ubuntu root partition and `nvme0n1p1` or `sda1` with the EFI system partition (ESP). Then continue with the following commands for either disk type: ```bash for i in dev dev/pts proc sys run; do sudo mount -B /$i /mnt/$i; done sudo chroot /mnt -apt install --reinstall grub-efi-amd64 linux-generic linux-headers-generic +apt install --reinstall linux-image-generic linux-headers-generic update-initramfs -c -k all -update-grub +exit +sudo update-grub ``` -## GRUB Legacy BIOS Boot +## Legacy BIOS Boot - Ubuntu (GRUB) + +If the echo command at the beginning of this page says that the OS is installed in Legacy mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. If you see the error below then your drive is encrypted with LUKS: -If `bios_grub` is listed under `flags`, the system is installed in BIOS mode. You can also use this command to see if the OS is installed in BIOS mode: +``` +mount: /mnt: unknown filesystem type 'crypto_LUKS'. +``` + +Follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. ```bash [ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy mode" @@ -196,55 +221,6 @@ sudo mount /dev/mapper/data-root /mnt Now the existing hard drive can be accessed by going to the `/mnt` folder. To use the Files program, go to `+ Other Locations` -> `Computer` and then click on the `/mnt` folder. -### EFI Boot - Ubuntu - -If the echo command above says the system is installed in EFI mode **and** you are using Ubuntu, follow this section. - -First, we need to mount the OS partitions. Run these commands based on what type of disk you have (based on the ```parted``` output from your system): - -| NVMe Drives | SATA Drives | -| :------------------------------------------- | :------------------------------------- | -| ```sudo mount /dev/nvme0n1p2 /mnt``` | ```sudo mount /dev/sda2 /mnt``` | -|```sudo mount /dev/nvme0n1p1 /mnt/boot/efi``` |```sudo mount /dev/sda1 /mnt/boot/efi```| - -chroot is a way to run commands as if the existing operating system had been booted. Once the chroot commands have been run, then package manager (apt) and other system level commands can be run. - -The EFI partition is usually around 512MB, and that is the partition to substitute into the next command. The Recovery partition is around 4GB. - -| NVMe Drive | SATA Drive | -| :---------------------------------------- | :----------------------------------- | -| `sudo mount /dev/nvme0n1p1 /mnt/boot/efi` | `sudo mount /dev/sda1 /mnt/boot/efi` | - -```bash -for i in dev dev/pts proc sys run; do sudo mount -B /$i /mnt/$i; done -sudo cp -n /etc/resolv.conf /mnt/etc/ -sudo chroot /mnt -apt install --reinstall grub-efi-amd64 linux-generic linux-headers-generic -update-initramfs -c -k all -update-grub -``` - -### Legacy BIOS Boot - -As mentioned above, if `bios_grub` is listed under `flags`, the system is installed in legacy BIOS mode. If this is the case, you need to follow this section to repair your bootloader. - -Run these commands based on what type of disk you have: - -| NVMe Drive | SATA Drive | -| :----------------------------------- | :------------------------------ | -| ```sudo mount /dev/nvme0n1p2 /mnt``` | ```sudo mount /dev/sda2 /mnt``` | - -You now have root administrator access to your installed OS. If you are trying to either fix or undo changes that you made to the system, you now have the access to do so. Once you are done, to exit from the chroot and reboot the computer, run these commands: - -```bash -for i in dev dev/pts proc sys run; do sudo mount -B /$i /mnt/$i; done -sudo cp -n /etc/resolv.conf /mnt/etc/ -sudo chroot /mnt -apt install --reinstall grub-amd64 linux-generic linux-headers-generic -update-initramfs -c -k all -sudo update-grub -``` - As your system reboots, remove the disk when prompted. The computer should now boot normally. ## Troubleshooting From 9280fdcd692d8f90766039597ad9ee5a0086a345 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 6 Dec 2023 13:24:39 -0700 Subject: [PATCH 2/6] Update notes about BIOS installs --- content/bootloader.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/bootloader.md b/content/bootloader.md index d70ac429ce..95ec9ea479 100644 --- a/content/bootloader.md +++ b/content/bootloader.md @@ -82,6 +82,8 @@ Pop!_OS 22.04 LTS 4 496GB 500GB 4295MB linux-swap(v1) swap ``` +>**NOTE:** A BIOS install of Pop!\_OS will not have a Recovery Partition and the Flags for the Boot Partition will not note esp. + --- ## How to tell if your system is EFI-based or legacy boot @@ -100,7 +102,7 @@ Installed in UEFI mode support@pop-os:~$ ``` -Additionally, if `bios_grub` is listed under `flags`, the system is installed in legacy BIOS mode. +Additionally, if `esp` is not listed under `flags` for the Boot Partition, the system is installed in legacy BIOS mode. ### EFI Boot - Pop!_OS (systemd-boot) From 290eb337c07437d21b21ca0c8db96a7bd0c49ea9 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 6 Dec 2023 13:30:42 -0700 Subject: [PATCH 3/6] Fix header for encrypted disk --- content/bootloader.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/bootloader.md b/content/bootloader.md index 95ec9ea479..b3269f335b 100644 --- a/content/bootloader.md +++ b/content/bootloader.md @@ -198,7 +198,7 @@ update-initramfs -c -k all sudo update-grub ``` -### Encrypted Disk +## Encrypted Disk Pop!_OS supports full-disk encryption as an option by default, whereas, Ubuntu does not. If you are on Ubuntu, you likely don't need to follow this section. From 66861b8ca8851e5926e61a135a12064c3c2d3b66 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 6 Dec 2023 13:39:37 -0700 Subject: [PATCH 4/6] Add Pop!_OS GRUB steps and fix lint issue --- content/bootloader.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/content/bootloader.md b/content/bootloader.md index b3269f335b..b5f4850605 100644 --- a/content/bootloader.md +++ b/content/bootloader.md @@ -82,7 +82,7 @@ Pop!_OS 22.04 LTS 4 496GB 500GB 4295MB linux-swap(v1) swap ``` ->**NOTE:** A BIOS install of Pop!\_OS will not have a Recovery Partition and the Flags for the Boot Partition will not note esp. +>**NOTE:** A BIOS install of Pop!\_OS will not have a Recovery Partition and the Flags for the Boot Partition will not note esp. --- @@ -164,7 +164,7 @@ exit sudo update-grub ``` -## Legacy BIOS Boot - Ubuntu (GRUB) +### Legacy EFI Boot - Pop!_OS (GRUB) If the echo command at the beginning of this page says that the OS is installed in Legacy mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. If you see the error below then your drive is encrypted with LUKS: @@ -174,15 +174,43 @@ mount: /mnt: unknown filesystem type 'crypto_LUKS'. Follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. +Run these commands based on what type of disk you have: + +| NVMe Drive | SATA Drive | +| :------------------------------- | :-------------------------- | +| `sudo mount /dev/nvme0n1p2 /mnt` | `sudo mount /dev/sda2 /mnt` | +| `sudo mount /dev/nvme0n1p1 /mnt/boot/` | `sudo mount /dev/sda1 /mnt/boot/` | + +If you are using a non-default partitioning scheme (such as a dual boot), replace `nvme0n1p2` or `sda2` with the Pop!_OS root partition. + +Then continue with the following commands for either disk type: + +After the partitions are mounted, we'll ensure the internet settings from the OS are coped over, as well as reinstall the kernel and the bootloader. + ```bash -[ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy mode" +for i in dev dev/pts proc sys run; do sudo mount -B /$i /mnt/$i; done +sudo chroot /mnt +apt install --reinstall grub-efi-amd64 linux-generic linux-headers-generic +update-initramfs -c -k all +sudo update-grub ``` +### Legacy BIOS Boot - Ubuntu (GRUB) + +If the echo command at the beginning of this page says that the OS is installed in Legacy mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. If you see the error below then your drive is encrypted with LUKS: + +``` +mount: /mnt: unknown filesystem type 'crypto_LUKS'. +``` + +Follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. + Run these commands based on what type of disk you have: | NVMe Drive | SATA Drive | | :------------------------------- | :-------------------------- | | `sudo mount /dev/nvme0n1p2 /mnt` | `sudo mount /dev/sda2 /mnt` | +| `sudo mount /dev/nvme0n1p1 /mnt/boot/` | `sudo mount /dev/sda1 /mnt/boot/` | If you are using a non-default partitioning scheme (such as a dual boot), replace `nvme0n1p2` or `sda2` with the Pop!_OS root partition. From e136b76d6c82c77005d745d31c1653a9b917060f Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Thu, 7 Dec 2023 07:03:39 -0700 Subject: [PATCH 5/6] Address feedback --- content/bootloader.md | 72 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 12 deletions(-) diff --git a/content/bootloader.md b/content/bootloader.md index b5f4850605..2ef336f217 100644 --- a/content/bootloader.md +++ b/content/bootloader.md @@ -106,13 +106,25 @@ Additionally, if `esp` is not listed under `flags` for the Boot Partition, the s ### EFI Boot - Pop!_OS (systemd-boot) -If the echo command at the beginning of this page says that the OS is installed in EFI mode **and** you are using Pop!_OS, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. If you see the error below then your drive is encrypted with LUKS: +If the echo command at the beginning of this page says that the OS is installed in EFI mode **and** you are using Pop!_OS, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. Running the command below will let us know if the drive is encrypted: + +```bash +sudo cryptsetup luksDump /dev/nvme0n1p3 +``` + +or + +```bash +sudo cryptsetup luksDump /dev/sda3 +``` + +If you get the output below then you do not need to decrypt the drive first: ``` -mount: /mnt: unknown filesystem type 'crypto_LUKS'. +Device /dev/nvme0n1p3 or /dev/sda3 is not a valid LUKS device. ``` -Follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. +If it is a valid LUKS device then follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. First, we need to mount the OS partitions. Run these commands based on what type of disk you have: @@ -136,13 +148,25 @@ sudo bootctl --path=/mnt/boot/efi install ### EFI Boot - Ubuntu (GRUB) -If the echo command at the beginning of this page says that the OS is installed in EFI mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. If you see the error below then your drive is encrypted with LUKS: +If the echo command at the beginning of this page says that the OS is installed in EFI mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. Running the command below will let us know if the drive is encrypted: + +```bash +sudo cryptsetup luksDump /dev/nvme0n1p2 +``` + +or + +```bash +sudo cryptsetup luksDump /dev/sda2 +``` + +If you get the output below then you do not need to decrypt the drive first: ``` -mount: /mnt: unknown filesystem type 'crypto_LUKS'. +Device /dev/nvme0n1p2 or /dev/sda2 is not a valid LUKS device. ``` -Follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. +If it is a valid LUKS device then follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. First, we need to mount the OS partitions. Run these commands based on what type of disk you have: @@ -166,13 +190,25 @@ sudo update-grub ### Legacy EFI Boot - Pop!_OS (GRUB) -If the echo command at the beginning of this page says that the OS is installed in Legacy mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. If you see the error below then your drive is encrypted with LUKS: +If the echo command at the beginning of this page says that the OS is installed in Legacy mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. Running the command below will let us know if the drive is encrypted: + +```bash +sudo cryptsetup luksDump /dev/nvme0n1p3 +``` + +or + +```bash +sudo cryptsetup luksDump /dev/sda3 +``` + +If you get the output below then you do not need to decrypt the drive first: ``` -mount: /mnt: unknown filesystem type 'crypto_LUKS'. +Device /dev/nvme0n1p3 or /dev/sda3 is not a valid LUKS device. ``` -Follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. +If it is a valid LUKS device then follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. Run these commands based on what type of disk you have: @@ -197,13 +233,25 @@ sudo update-grub ### Legacy BIOS Boot - Ubuntu (GRUB) -If the echo command at the beginning of this page says that the OS is installed in Legacy mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. If you see the error below then your drive is encrypted with LUKS: +If the echo command at the beginning of this page says that the OS is installed in Legacy mode **and** you are using Ubuntu, follow this section. Please note that if you have an encrypted disk, you will need to first unlock it as described below. Running the command below will let us know if the drive is encrypted: + +```bash +sudo cryptsetup luksDump /dev/nvme0n1p2 +``` + +or + +```bash +sudo cryptsetup luksDump /dev/sda2 +``` + +If you get the output below then you do not need to decrypt the drive first: ``` -mount: /mnt: unknown filesystem type 'crypto_LUKS'. +Device /dev/nvme0n1p2 or /dev/sda2 is not a valid LUKS device. ``` -Follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. +If it is a valid LUKS device then follow these [steps](/articles/bootloader#encrypted-disk) to decrypt the drive first. Run these commands based on what type of disk you have: From b5be1fb53fdaf5779d88717560c7b6864453d23c Mon Sep 17 00:00:00 2001 From: brandonbaez7 <160044194+brandonbaez7@users.noreply.github.com> Date: Fri, 10 May 2024 10:09:08 -0600 Subject: [PATCH 6/6] Update bootloader.md Removed > on line 85 to (hopefully) fix markdown failure. --- content/bootloader.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/bootloader.md b/content/bootloader.md index 2ef336f217..beea01d205 100644 --- a/content/bootloader.md +++ b/content/bootloader.md @@ -82,7 +82,7 @@ Pop!_OS 22.04 LTS 4 496GB 500GB 4295MB linux-swap(v1) swap ``` ->**NOTE:** A BIOS install of Pop!\_OS will not have a Recovery Partition and the Flags for the Boot Partition will not note esp. +**NOTE:** A BIOS install of Pop!\_OS will not have a Recovery Partition and the Flags for the Boot Partition will not note esp. ---