note:
dev/sda2 → parrot is installed in
dev/sda5 → efi directory
su
mount /dev/sda2 /mnt
mount /dev/sda5 /mnt/@/boot/efi
#because /boot/efi was inside /dev/sda2/@ folder
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt/@$i; done
chroot /mnt/@
# Not sure about this line but without it was giving err:
# grub-install: error: cannot find a device for /boot/grub (is /dev mounted?).
# Which is resolved after below line
mount /dev/sda5 /
grub-install –efi-directory=/boot/efi
#Detects parrot os
grub-mkconfig -o /boot/grub/grub.cfg
#Detects parrot os and arhc-linux```
But when restarting, it didnot show boot option of parrot os.
I think this: `mount /dev/sda5 /` line was responsible, please help
[solved]
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.
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
sudo grub-mkconfig
sudo update-grub
grub-install /dev/sda
and i had to add to boot option :
f2 while rebooting
general / bootsequence / add boot option
selected ‘grubx64.efi’ option from EFI/parrot/
apply
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
nano /mnt/@/etc/fstab
and replace the UUID of line having mount point /boot/efi with UUID previously copied