You are not logged in.

#26 2023-06-27 16:36:50

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

nl6720 wrote:
https://pastebin.com/TBZ8xz9U wrote:
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet nvidia_drm.modeset=1"
GRUB_CMDLINE_LINUX="cryptdevice=UUID=b7b560e0-b889-4f66-a24e-90280eb81b2a:cryptlvm rootfstype=btrfs"
GRUB_CMDLINE_LINUX="cryptsetup refresh —allow-discards cryptlvm"

The second GRUB_CMDLINE_LINUX overrides the first one. And as I said previously,

nl6720 wrote:

cryptsetup is a command you run, not a kernel parameter.

https://pastebin.com/TBZ8xz9U wrote:
# Uncomment to enable booting from LUKS encrypted devices
GRUB_ENABLE_CRYPTODISK=y

You don't need this since your kernel+initramfs is in an unencrypted partition (the ESP, which you mount at /boot). Comment out the GRUB_ENABLE_CRYPTODISK line.

Following https://wiki.archlinux.org/title/dm-cry … ives_(SSD) , you just needed to set GRUB_CMDLINE_LINUX to:

GRUB_CMDLINE_LINUX="cryptdevice=UUID=b7b560e0-b889-4f66-a24e-90280eb81b2a:cryptlvm:allow-discards"

thanks I have made the adjustments to etc/default/grub :

https://pastebin.com/Nj1V5L10

I just tried to reboot again and nothing has changed.  I believe I need to do sudo grub-mkconfig -o /boot/grub/grub.cfg again to write these changes?
the problem is that I dont know how to do that on a system that is being accessed through a separate live arch system

Last edited by qherring (2023-06-27 16:42:17)

Offline

#27 2023-06-27 17:00:49

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,325

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

arch-chroot into the installed system, don't forget to mount the /boot partition.

Offline

#28 2023-06-27 17:29:13

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

seth wrote:

arch-chroot into the installed system, don't forget to mount the /boot partition.

I have successfully mounted using:

sudo cryptsetup luksOpen /dev/nvme1n1p2 cryptlvm
sudo mount /dev/mapper/cryptlvm -o subvolid=5 /mnt


then I mounted /boot:

sudo mount /dev/nvme1n1p1 /mnt/@/boot


now when I do:

sudo arch-chroot /mnt

it says "mount: /mnt/proc: mount point does not exist.
       dmesg(1) may have more information after failed mount system call.
==> ERROR: failed to setup chroot /mnt"

Last edited by qherring (2023-06-27 17:29:30)

Offline

#29 2023-06-27 17:39:14

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

The path to proc is: /mnt/@/proc but it is ignoring the @ and just looking for /mnt/proc.

Am I missing a step?

Offline

#30 2023-06-27 17:46:08

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

it lets me do sudo arch-chroot /mnt/@

but i get a bold warning

==> WARNING: /mnt/@ is not a mountpoint. This may have undesirable side effects.

Offline

#31 2023-06-27 17:54:22

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

qherring wrote:

it lets me do sudo arch-chroot /mnt/@

but i get a bold warning

==> WARNING: /mnt/@ is not a mountpoint. This may have undesirable side effects.


When I do:

sudo mount /dev/mapper/cryptlvm -o subvolid=5 /mnt

it mounts all of my subvolumes, hence why I have to specify to /mnt/@ to get chroot to work


Should I ONLY be mounting my @ subvolume when mounting for chroot?  i.e:   sudo mount /dev/mapper/cryptlvm -o subvolid=@ /mnt     or does it not matter if I chroot via /mnt/@ ?


really would hate to f this up any further

Last edited by qherring (2023-06-27 18:11:25)

Offline

#32 2023-06-27 18:20:20

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

I found this:
https://wiki.archlinux.org/title/chroot … de_effects.
https://man.archlinux.org/man/arch-chroot.8

it gives this example: mount --bind /your/chroot /your/chroot

However, I am not really understanding what this is saying...

Offline

#33 2023-06-27 18:48:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,104

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

For the purposes of what we have here you only need the root subvol, so yes mount that directly and then your /boot partition to /mnt/boot.

When you go for subvolid=5 you don't mount subvols at all (you mount the underlying file system housing the subvolumes) and would need to mount them separately, mounting just @ directly will be easiest and sufficient for our purposes.

Offline

#34 2023-06-27 19:20:06

qherring
Member
Registered: 2023-05-05
Posts: 87

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

V1del wrote:

For the purposes of what we have here you only need the root subvol, so yes mount that directly and then your /boot partition to /mnt/boot.

When you go for subvolid=5 you don't mount subvols at all (you mount the underlying file system housing the subvolumes) and would need to mount them separately, mounting just @ directly will be easiest and sufficient for our purposes.

after reverting my /etc/default/grub back to its original state and running sudo grub-mkconfig -o /boot/grub/grub.cfg  in chroot all is now fixed

Thank you sincerely to all that have helped me get this done.  I have successfully restored my system.  After much frustration I have learned a lot about how encrypted btrfs works and much more.

Offline

#35 2023-06-27 19:21:48

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,104

Re: Cannot boot, I broke grub by editing /etc/default/grub [SOLVED]

Great please mark as [SOLVED] by editing the title in your first post.

Offline

Board footer

Powered by FluxBB