Install Grub

Notes for installing Grub on a disk that has already had basic files copied to it. More details

#Dump the Windows key from a PC Motherboard to use in your windows VM after you get linux installed:
tail -c+57 /sys/firmware/acpi/tables/MSDM

#Local Disk Copy with progress indicator, but not verbose file by file detail:
rsync -aSWxHAX --info=progress2 --numeric-ids /source-dir/ /target-dir/

#mount the partitions you use, skip those you do not
sudo mount /dev/sdXY /mnt
sudo mount /dev/sdXY /mnt/boot
sudo mount /dev/sdXY /mnt/boot/efi

#Mount the critical virtual file systems. Run the following as a single command:
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done

#Chroot into your normal system device:
sudo chroot /mnt

#Reinstall GRUB 2 (substitute the correct device with sda, sdb, etc. 
#Do not specify a partition number):
grub-install /dev/sdX

#Recreate the GRUB 2 menu file (grub.cfg)

#Exit chroot: CTRL-D on keyboard

sudo reboot

No comments: