Turned out above steps worked for me, additionally, I have to add boot option for parrot manually from boot setting and change UUID of efi directory in /etc/fstab.
Complete steps followed:
parrot_root/home : /dev/sda2
efi partition: /dev/sda5
sudo mount /dev/sda2 /media
mount --bind /media/@ /mnt
sudo mount /dev/sda5 /mnt/boot/efi
For me parrot root was inside ‘@’ directory inside /dev/sda2 partition i.e. /dev/sda2/@ & I coudn’t find way to mount it to /mnt directly so mounted /dev/sda2 to /media first and then bind the ‘@’ folder to /mnt
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo cp /etc/resolv.conf /mnt/etc/
# (optional above 1 line) to use wifi inside chroot, if wifi doesn't work inside chroot.
#to test if wifi works: ping parrotsec.org
#works if it shows something like: 64 bytes from.... (ctrl+c to close)
# Previously efivars
sudo modprobe efivarfs
sudo chroot /mnt
sudo apt-get update
sudo apt-get install --reinstall grub-efi-amd64
and i had to add to boot option :
- f2 while rebooting
- general / bootsequence / add boot option
- selected ‘grubx64.efi’ option from EFI/parrot/
and f12 while rebooting and select to boot from parrot.
while booting to parrot, I got and error saying:
cannot open access to coonsole, the root account is locked.
See sulogin(8) man page for more details.
Press enter to continue
It turned out UUID of efi directory changes while formatting, so the system was referring to non existent UUID as efi. To change that:
# To see new UUID of EFI partition (/dev/sda5 is efi partition)
sudo lsblk /dev/sda5
# copu uid from here
#mounting parrot_root directory to /mnt temporarily
mount /dev/sda2 /mnt
# opening /etc/fstab of parrot_os since '@' folder inside /dev/sda2 is parrot root
and replace the UUID of line having mount point /boot/efi with UUID previously copied
References (thanks to):