Guest User

Untitled

a guest
Jan 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. # Assume partitions as below
  2. # EFI partition: /dev/sda6
  3. # OS partition: /dev/sda5, /dev/sda8, etc.
  4. # This assume EFI partition is formated as FAT32 with "boot,esp" flags
  5.  
  6. # After boot using Live CD,
  7. # first, then mount to OS partition, say /dev/sda8
  8. sudo mount /dev/sda8 /mnt
  9.  
  10. # Check /etc/fstab to list all fs mapping
  11. # Need to double check if any partitions are reformated
  12. cat /mnt/etc/fstab
  13. # check partition uuid with "blkid" to double confirm uuid mapping is correct
  14. blkid
  15.  
  16. # Next, mount all partitions according to the fstab
  17. # below is just my example
  18. sudo mkdir /mnt/boot/efi-partition # to this and grub-install with "--efi-directory" if your EFI partition is corrupted
  19. sudo mount /dev/sda6 /mnt/boot/efi-partition # or mount to /mnt/boot/efi if EFI partition is not corrupted
  20.  
  21. # mount all other required paths
  22. sudo mount --bind /dev /mnt/dev
  23. sudo mount --bind /dev/pts /mnt/dev/pts
  24. sudo mount --bind /sys /mnt/sys
  25. sudo mount --bind /proc /mnt/proc
  26. sudo mount --bind /var /mnt/var
  27.  
  28. # change root to /mnt or /dev/sda8 (os partition root)
  29. sudo chroot /mnt
  30.  
  31. # grub install
  32. grub-install --recheck
  33. # or
  34. grub-install --recheck --efi-directory=/boot-efi-partition
  35.  
  36. # update grub
  37. update-grub
  38.  
  39. # Here, it should work properly!
  40.  
  41. # If after this, encounter "grub rescue>" or "Emergency mode",
  42. # double check all UUID in /etc/fstab again
  43. # or read the log and find any devices causing timeout
  44.  
  45. # DONE!!! Happy hacking!!!
Add Comment
Please, Sign In to add comment