Using chroot to fix a broken system in Manjaro
I have to chroot to fix a broken system, probably caused by a misconfiguration in GRUB.
Manjaro comes with a tool called manjaro-chroot that makes this process much easier, but not always works because,
it expects a standard installation without encryption.
Standard Installation
With a standard installation with EXTx without encryption, you would use the following command:
manjaro-chroot -a
Encryption Installation
If you have an encrypted drive, you have to do the following:
Check your system drives
Run lsblk and find the drive you want to use.
For this example I’m assuming the following output from lsblk:
1nvme0n1
2├─ nvme0n1p1 /boot/efi
3└─ nvme0n1p2 /
Mount your drives
Login as root.
sudo -i
Open the encrypted drive, after this command you will be prompted for a password.
This command will create an entry in /dev/mapper/ with the name of the last parameter nvmeEncrypted.
cryptsetup luksOpen /dev/nvme0n1p2 nvmeEncrypted
Mount the drives, the -o subvol=@ is needed if you use BTRFS.
mount -o subvol=@ /dev/mapper/nvmeEncrypted /mnt
Or if you have EXTx partition.
mount /dev/nvme0n1p2 /mnt/boot/efi
And finally chroot into the system.
manjaro-chroot /mnt
From here, you can fix/modify your system as you wish. If you have any grub issues running install-grub is your best bet.