You are not logged in.

#1 2021-06-17 21:38:08

EngBIRD
Member
Registered: 2021-06-17
Posts: 2

Proper steps to rebuild a boot partition

System Details
Possibly irrelevant - the system was working fine since 2012, and for multiple consecutive years since it's latest fresh build in 2016/2017.  It wasn't a linux update that broke it but:

  • Intel I7 ~ 3.5 GHz CPU

  • ASUS mother board

  • GTX 1060 video card (most recent addition in 2020)

  • I believe my initial setup was for a GPT EFI partition table and boot device (if that's the proper nomenclature)

  • All operating systems are on their own drive and installations are conducted with all drives except the intended target disconnected

  • No bootloader (that I knew of) I used the BIOS to choose my OS for a given session

Problem

  • A windows 10 update seems to have failed (Booting was slow and would ultimately freeze before even being able to login or reboot from the login screen

  • Without thinking, I let the windows recovery media attempt a repair (it offered no feedback or context or anything)

  • While the repairs failed, it appears windows overwrote some key part of my linux boot partition (possibly root aswell???) so I can no longer boot into my arch system


Attempted fixes (successful)

  • The first suggestions I discovered here and elsewhere suggested using efibootmgr to identify and remove the windows entries

  • There were also suggestions to replace some default EFI files in /boot and /boot/efi.

  • I backed up this semi useless boot partition with a simple file copy and began efforts to start creating a fresh boot partition

  • After weeks of fresh build attempts discussed below I restored the backup - removed additional sequences with efibootmgr -b # -B and ran the code sequence below (not including bootctl)

  • I ensure only connected hard drives / partitions were uncommented in FSTAB

  • My system booted successfully - but remains not fully tested to ensure no other services have failed to run properly.

In my efforts to start from a clean rebuilt boot partition and configured boot loader, I tend to start with the following (though with some of my more recent efforts to use other boot managers / boot loaders I've played around with whether I included the last two).  As indicated above, recreating the image was also what gave me a successful boot image, why I couldn't create this from a blank \boot partition I'd still like to understand.

... to mount drives to live media
arch-chroot /mnt/arch /bin/bash
pacman -S linux linux-firmware
mkinitcpio -p linux
bootctl install
bootctl update
attempts to install and configure other boot loaders or boot managers...
reboot

Things that have confused me I'd like to learn from regarding a blank boot partition:

  • I ran journalctl -B and discovered the logs to help troubleshoot were empty.

  • I started at the bootmanager and efibootmgr manual pages but found some of the info tough to follow particularly in the context of second guessing it because of the flags that it may be out of date or superseded - I've learned a lot about EFI and boot loaders vs boot managers etc since starting this, but still I'm sure I've still got some crippling gaps

  • The "not working" result was a black screen with no error message or on screen indications of which process got hung up (described below - I'm not sure how to interpret this)

Since I'm not sure completely how to interpret all I've seen, I've got a few direct questions to perhaps help my understanding and focus some suggestions or feedback into more comprehensive best practice and next steps to progress in the troubleshooting.

  1. What is the black screen indicative of?

    • Is the black screen indicative of a successfully created boot image (with downstream problems)?

    • Is it indicative of failed configuration files?

    • Is it indicative of orphaned systemd (or other) processes launched during boot (assumes some form of communication between boot and root during start-up)?

  2. I've also seen what I believe is failed boot partition image as the Arch boot says Return to Firmware Interface - is this indeed a failed boot partition?

  3. I don't recall having to do any boot loader or boot manager configuration when I setup the EFI boot system in 2016/2017.  Why do the manual pages seem to imply that I have to add UUID's etc to config files manually now? I feel like the answer / proper configuration of these files is what I failed to successfully duplicate for efforts in rebuilding the boot partition...

  4. I thought I'd reconciled the code above with that of a fresh install, do any critical lines jump out at you as missing, i.e. along the lines of the previous question regarding extra steps regarding configuration and setup?

Thanks in advance for any insights you have and are able to or are willing to offer! Even if at this point it's mostly for my education and posterity.

Last edited by EngBIRD (2021-06-18 03:35:45)

Offline

#2 2021-06-18 11:46:19

Maniaxx
Member
From: .de
Registered: 2014-05-14
Posts: 448

Re: Proper steps to rebuild a boot partition

In what boot state are you currently? What exactly appears on the screen?

Before doing an arch-mount you should make sure to take your EFI partition with you (into that environment). Usually that means doing a mount /dev/sda1 /mnt/boot/efi (or similar) beforehand.


sys2064

Offline

#3 2021-06-30 01:43:51

EngBIRD
Member
Registered: 2021-06-17
Posts: 2

Re: Proper steps to rebuild a boot partition

My apologies for the ambiguity (and the delay - I was expecting the system to notify me by email when a response was posted) - my line

... to mount drives to live media

was supposed to simplify what I understood to be basic (and somewhat variable / flexible)

During my debugging, my setup is usually done with the following commands:

swapon /dev/sdx2
mkdir /mnt/arch
mkdir /mnt/arch/boot
mount -t ext4 /dev/sdx3
mount /dev/sdx1
arch-chroot /mnt/arch /bin/bash

where sdx can change depending how many live USB's or external HDDs I may have connected.  Most of the time I disconnect everything so this is sda or sdb.


As stated above - I can't seem to rebuild the boot partition from a blank partition (which I'd like to know in case I loose my backup some day).  When I try and rebuild and then reboot, my screen is completely black, no indication that anything was even trying to boot. So I'm looking for guidance about what the commands I should have used to setup a fresh boot partition and whether a boot loader or something is needed. 

Since my repair from an old backup was successful I suppose I could report about what my partition currently is doing, but I don't know where to find that information. There's nothing useful in my bios.

Offline

#4 2021-06-30 10:40:26

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 13,805

Re: Proper steps to rebuild a boot partition

Please don't paraphrase. These mount commands would be invalid from a live system as posted. From the vague outset we have:

/dev/sdx3 is your root (/) mounted to /mnt/arch and /dev/sdx3 should be your FAT formatted ESP partition you mount them to /mnt/arch and /mnt/arch/boot respectively. so far so good.

From that point on the other steps in your initial post are ok as well. But what did you do after the (unnecessary since you just installed it but also harmless) bootctl update ? You'd need to configure which kernel it should boot: https://wiki.archlinux.org/title/System … figuration

Offline

Board footer

Powered by FluxBB