Re: How do I rebuild Grub/Boot/initramfs from a Live USB?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 28, 2022 at 2:32 PM Jake D <techsupport_accounts@xxxxxxxxxx> wrote:
> I’ve managed to chroot (a very dumb word) thru a LiveUSB session, with the following commands:
>
> >>cryptsetup luksOpen /dev/nvme0n1p6 fedora_crypt
> >>mount /dev/mapper/fedora_crypt /mnt/ -t btrfs -o subvol=root
> >>mount /dev/mapper/fedora_crypt /mnt/home -t btrfs -o subvol=home
> >>mount /dev/nvme0n1p5 /mnt/boot
> >>mkdir /mnt/boot/efi
> >>mount /dev/nvme0n1p1 /mnt/boot/efi
> >>mount --bind /dev /mnt/dev
> >>mount -t proc /proc /mnt/proc
> >>mount -t sysfs /sys /mnt/sys
> >>mount -t tmpfs tmpfs /mnt/run
> >>mkdir -p /mnt/run/systemd/resolve/
> >>nano /mnt/run/systemd/resolve/stub-resolv.conf (enter 'nameserver 1.1.1.1', save)
> >>chroot /mnt

Stab in the dark - within the chroot jail maybe it knows about the
mounted *tree* but it doesn't know about the mounts themselves?  In
other words, by doing the mounts outside of the chroot, you are
updating /etc/mnttab in the "Live USB" environment, but /etc/mnttab in
the chroot environment is not updated.

If this is the case, maybe doing this will get you farther:
> >>cryptsetup luksOpen /dev/nvme0n1p6 fedora_crypt
> >>mount /dev/mapper/fedora_crypt /mnt/ -t btrfs -o subvol=root
> >>mount --bind /dev /mnt/dev
> >>mount --bind /dev /mnt/dev
> >>mount -t proc /proc /mnt/proc
> >>mount -t sysfs /sys /mnt/sys
> >>mount -t tmpfs tmpfs /mnt/run
> >>chroot /mnt
> >>mount /dev/mapper/fedora_crypt /home -t btrfs -o subvol=home
> >>mount /dev/nvme0n1p5 /boot
> >>mkdir /mnt/boot/efi
> >>mount /dev/nvme0n1p1 /boot/efi
> >>mkdir -p /run/systemd/resolve/
> >>nano /run/systemd/resolve/stub-resolv.conf (enter 'nameserver 1.1.1.1', save)

Another thing I'm not sure of is whether or not you need something in
the chroot /boot *before* you can use dnf, etc.

Alternative - maybe do a fresh install using the wiped partitions to
get a complete and reasonably valid /boot, and leverage that to find
and boot the LUKS partition?

Never had to do this, so hoping it helps or at least gives ideas.
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux