Solution to access my encrypted Manjaro

I have encrypted manjaro installed.
as the screen brightness was not working i went across manjaro solutions to make it work. But instead i messed up /etc/default/grub file. Mainly the GRUB_CMDLINE_LINUX_DEFAULT line was edited and it contained some UUID which was mistakenly removed. After that I ran “sudo reboot”.

I tried to recover with the snapshots but couldn’t recover it.

Now I’m not able to access manjaro OS. Getting error as shown in the below.

mount: /openswap_keymount: no filesystem type specified
Failed to open key file.
unmount: can't unmount openswap_keymount: Invalid argument
ERROR: resume: no device specified for hibernation
mount: /new_root: can't find UUID=<uuid>
You are now being dropped into an emergency shell.
sh: can't access tty; job control turned off
[rootfs ]#

I have tried decrypting it and mounting with the usb thumb drive.
followed the steps mentioned in the below links.

I tried to decrypt it using

sudo fdisk -l
sudo cryptsetup luksOpen /dev/nvme0n1p3 encrypted_device
sudo vgchange -ay

After decrypting, Mounting it back again.
mount -o subvol=@ /dev/mapper/encrypted_device /mnt

updating the grub again.

grub-mkconfig config
grub-mkconfig -o /boot/grub/grub.cfg

It was not successful.
Is there any other way to restore manjaro or restore /etc/default/grub.

Referred links:

https://techblog.jeppson.org/2020/03/chroot-into-encrypted-drive/

https://wiki.manjaro.org/index.php/GRUB/Restore_the_GRUB_Bootloader

But did you added back the deleted entries that are required in the grub file?

I’m not able to add the deleted(GRUB_CMDLINE_LINUX_DEFAULT) as i’m not able to access the OS.
I had saved the GRUB_CMDLINE_LINUX_DEFAULT=’ ’ in a notepad which i’m not able to access.

You booted up from Live environment, to chroot your installed system. Did you manage to decrypt it and chroot in it?

You mount the decrypted partition, inside the encrypted container, on /mnt, but you generate a new /boot/grub/grub.cfg which is not inside the /mnt :wink:

Plus you won’t get any different outcome unless you change the /etc/default/grub INSIDE /mnt and chroot into /mnt before you give the command to regenerate your grub config…

Thus you need to in sequence:

  1. Open the encrypted container
  2. Mount the @ subvolume inside the container at /mnt
  3. chroot into /mnt
  4. Change /etc/default/grub from within the chroot.
  5. Regenerate your grub config from inside the chroot.
  • It would help to post your fstab from inside the encrypted container, which might still have the UUID’s you need.

I suppose you saved that file inside your HOME dir?
In that case you probably can mount that also, it should be the @home subvolume instead of the @ one… :wink:

systemd-mount -o subvol=@home /dev/mapper/encrypted_device /mnt/home
1 Like

yes I booted up the manjaro OS(did not re-install) using bootable USB and then later decrypted the logical volume(/dev/nvme0n1p2) and mounted it.
after mounting, wat is the next step?

after mounting I just shutdown and restarted the laptop to see if I can access manjaro OS but was not successful.

Thank you. I could manage to recover the GRUB_CMDLINE_LINUX_DEFAULT= ’ ’ which i had saved in the notepad. As you had mentioned to access the files from the @home directory.

But now i want to paste the GRUB_CMDLINE_LINUX_DEFAULT= ’ ’ back into /etc/default/grub of the encrypted volume. is there a way to access that file?

I managed to recover the command and paste it back in the /etc/default/grub and later updated the grub via chroot and restarted the system voila i was able to get back the OS.

Thank you for the assistance.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.