You are not logged in.
I was trying to add an allow-discards parameter to the kernel command and I completely broke Grub. I cannot boot up nor can I boot into any of my snapper snapshots. I have a fully encrypted btrfs disk. Here is what I did to cause this:
I added a line in /etc/default/grub:
cryptsetup refresh —allow-discards cryptlvm
Then in a terminal I did sudo grub-mkconfig -o /boot/grub/grub.cfg
I then rebooted and now I am stuck. Each time I try to boot up it says:
ERROR: device 'UUID-df9abdc3-3c8a-4908-b91d-250cdddd73fe' not found. Skipping fsck. mount:/new_root:can't find UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe. ERROR: Failed to mount 'UUID = df9abdc3-3c8a-4908-b91d-250cdddd73fe' on real root You are now being dropped into an emergency shell. sh: can't access tty: job control turned off [rootfs]#
Please help me rectify this. I am devastated. What a bad day…
Last edited by qherring (2023-06-27 19:20:57)
Offline
This isn't grub. you're already booting the kernel.
Did you change anything with your disk layout (remove partitions?)?
I get identical errors when I add/remove partitions and forget to edit fstab (don't, I don't know how it works with encryptions).
Last edited by jl2 (2023-06-27 08:34:07)
Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...
Offline
No the only thing I changed is the what is written above. I booted fine 1 minute before I ran sudo grub-mkconfig -o /boot/grub/grub.cfg
Offline
Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...
Offline
I have another arch install up and running on a different SSD on the same computer. Is there a way I can mount the drive and amend from there?
Offline
Boot a live system, post the output of "lsblk -f"
Mount the root and post /mnt/etc/fstab, see whether there's anything in /mnt/boot
Mount your /boot partition to /mnt/boot, post /mnt/boot/grub/grub.cfg
Edit: https://wiki.archlinux.org/title/Chroot
Last edited by seth (2023-06-27 08:51:06)
Online
UUID-df9abdc3-3c8a-4908-b91d-250cdddd73fe
UUID=df9abdc3-3c8a-4988-b91d-250cdddd73fe
UUID = df9abdc3-3c8a-4908-b91d-250cdddd73fe
These shouldn't differ.
I'm guessing you made some typo when editing /etc/default/grub.
Also I don't think you need to add "allow-discards" to the kernel command line if the option is set in the LUKS2 header.
Offline
you can just install it from there without chrooting.
grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB
use the esp of your other install.
EDIT: you do have to arch-chroot for grub-mkconfig
mount root /mnt
mount esp /mnt/boot
arch-chroot /mnt
EDIT2: nvm - i think that isn't the problem
Last edited by jl2 (2023-06-27 08:51:38)
Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...
Offline
qherring wrote:UUID-df9abdc3-3c8a-4908-b91d-250cdddd73fe
qherring wrote:UUID=df9abdc3-3c8a-4988-b91d-250cdddd73fe
qherring wrote:UUID = df9abdc3-3c8a-4908-b91d-250cdddd73fe
These shouldn't differ.
I'm guessing you made some typo when editing /etc/default/grub.
I made a typo when bringing from the terminal to this forum. they are all the same
Last edited by qherring (2023-06-27 08:57:02)
Offline
Boot a live system, post the output of "lsblk -f"
Mount the root and post /mnt/etc/fstab, see whether there's anything in /mnt/boot
Mount your /boot partition to /mnt/boot, post /mnt/boot/grub/grub.cfg
This is the lsblk -f for the drive Im trying to fix:
nvme1n1
├─nvme1n1p1 vfat FAT32 8F49-4391
└─nvme1n1p2 crypto_LUKS 2 b7b560e0-b889-4f66-a24e-90280eb81b2a
└─luks-b7b560e0-b889-4f66-a24e-90280eb81b2a btrfs df9abdc3-3c8a-4908-b91d-250cdddd73fe 3.6T 0% /run/media/qherring/df9abdc3-3c8a-4908-b91d-250cdddd73fe
Last edited by qherring (2023-06-27 09:11:50)
Offline
Don't transcribe that (and the other things) manually!
See the 1st link below.
Online
Mount the root and post /mnt/etc/fstab, see whether there's anything in /mnt/boot
when I try:
sudo mount /dev/mapper/cryptlvm -o subvolid=5 /mnt
I get:
mount: /mnt: special device /dev/mapper/cryptlvm does not exist.
dmesg(1) may have more information after failed mount system call.
Offline
You'll first have to "cryptsetup open" it?
https://wiki.archlinux.org/title/Dm-cry … encryption
Online
Here is /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/ainstnvme1n1p2
UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe / btrfs rw,noatime,compress=zstd,subvol=/@ 0 0
# /dev/mapper/ainstnvme1n1p2
UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe /.snapshots btrfs rw,noatime,compress=zstd,subvol=/@snapshots 0 0
# /dev/nvme1n1p1
UUID=8F49-4391 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/mapper/ainstnvme1n1p2
UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe /home btrfs rw,noatime,compress=zstd,subvol=/@home 0 0
# /dev/mapper/ainstnvme1n1p2
UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe /var/log btrfs rw,noatime,compress=zstd,subvol=/@var_log 0 0
Offline
I was able to mount in on the GUI
/boot is empty on that disk
Offline
We're still missing the grub.cfg (being the most relevant part here) - it's on nvme1n1p1
Online
We're still missing the grub.cfg (being the most relevant part here) - it's on nvme1n1p1
There is nothing in the /boot , so nothing to share
Offline
I just cant seem to figure out how to mount this in the terminal. I can mount it in the GUI but there is nothing in my home, boot, or .snapshots directories. So I am assuming it is only mounting the /root subvolume...
When I was doing a snapper rollback earlier today I was mounting this disk using: sudo mount /dev/mapper/cryptlvm -o subvolid=5 /mnt
however when I try than now it says: "mount: /dev/mapper/cryptlvm: can't find in /etc/fstab."
I am lost. I gave btrfs a try and im getting burned. I guess i should start over fresh.
Last edited by qherring (2023-06-27 09:58:08)
Offline
nvme1n1p1 isn't btrfs but vfat, just mount it into /mnt/boot (or /boot from the chroot)
Online
nvme1n1p1 isn't btrfs but vfat, just mount it into /mnt/boot (or /boot from the chroot)
I really appreciate your patience.
here is the grub.cfg from nvme1n1p1
Last edited by qherring (2023-06-27 10:05:00)
Offline
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod cryptodisk
insmod luks2
insmod gcry_rijndael
insmod gcry_rijndael
insmod gcry_sha256
insmod btrfs
cryptomount -u b7b560e0-b889-4f66-a24e-90280eb81b2a
set root='cryptouuid/b7b560e0b8894f66a24e90280eb81b2a'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='cryptouuid/b7b560e0b8894f66a24e90280eb81b2a' df9abdc3-3c8a-4908-b91d-250cdddd73fe
else
search --no-floppy --fs-uuid --set=root df9abdc3-3c8a-4908-b91d-250cdddd73fe
fi
font="/@/usr/share/grub/unicode.pf2"
fiThis looks odd - not only is the indentation wrong but also the decryption is conditioned on the font.
Did you edit that file somehow?
Online
With /boot being the ESP and thus not encrypted, you don't need to enable GRUB_ENABLE_CRYPTODISK.
linux /vmlinuz-linux root=UUID=df9abdc3-3c8a-4908-b91d-250cdddd73fe rw rootflags=subvol=@ cryptsetup refresh --allow-discards cryptlvm loglevel=3 quiet nvidia_drm.modeset=1
cryptsetup is a command you run, not a kernel parameter.
Post your /etc/default/grub.
Offline
This looks odd - not only is the indentation wrong but also the decryption is conditioned on the font.
Did you edit that file somehow?
No, I only modified /etc/default/grub directly. Afterwards when I did sudo grub-mkconfig -o /boot/grub/grub.cfg it would have imported the changes I made.
Last edited by qherring (2023-06-27 15:54:26)
Offline
Post your /etc/default/grub.
Offline
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,
cryptsetup is a command you run, not a kernel parameter.
# 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"Offline