Guide to chroot into Debian or Fedora systems to change the password and/or reinstall GRUB.
Mount the btrfs subvolumes. Subvolumes @ and @home are required. Typically @cache, @log, and @swap are not needed.
sudo mount /dev/nvme0n1p2 /mnt -t btrfs -o subvol=@
sudo mount /dev/nvme0n1p2 /mnt/home -t btrfs -o subvol=@homeMount the EFI partition. This assumes ESP is on /boot/efi.
sudo mount /dev/nvme0n0p1 /mnt/boot/efiMount the virtual filesystems.
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /run /mnt/runLoad the efivars.
sudo modprobe efivarfs
# if above fails
sudo mount -t efivarfs none /sys/firmware/efi/efivarsMount the efivars.
sudo mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivarsYou can now chroot into the system.
sudo chroot /mntAfter chrooting in, you can change the password of any user.
passwd USEROn Debian systems, use the following method. Install to the drive, not the partition.
# reinstall grub package
apt install --reinstall grub-efi
# recreate grub config
grub-install /dev/nvme0n1
update-grubOn Fedora systems, use the following method.
# remove shim
rm /boot/efi/EFI/fedora/grub.cfg
# reinstall grub package
dnf reinstall grub2-efi grub2-efi-modules grub2-common shim
# recreate grub config
grub2-mkconfig -o /boot/grub2/grub.cfg
Awesome !! I managed to recover my Parrot Linux installation. I simply cloned one disk to another with Clonezilla and lost access to the Btrfs partition, but with your help I was able to fix it.
Thank you so much!!