Advertisement
serenia

grub-reinstall

Dec 25th, 2021
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.59 KB | None | 0 0
  1. user@debian:~$ sudo modprobe efivarfs
  2. user@debian:~$ sudo mount /dev/sda3 /mnt
  3. user@debian:~$ sudo mount /dev/sda1 /mnt/boot/efi
  4. user@debian:~$ for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do sudo mount -B $i /mnt$i; done
  5. user@debian:~$ sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
  6. user@debian:~$ sudo chroot /mnt
  7. root@debian:/# apt update
  8. Hit:1 http://deb.debian.org/debian bullseye InRelease
  9. Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
  10. Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
  11. Fetched 83.5 kB in 1s (86.3 kB/s)
  12. Reading package lists... Done
  13. Building dependency tree... Done
  14. Reading state information... Done
  15. 74 packages can be upgraded. Run 'apt list --upgradable' to see them.
  16. root@debian:/# mount -t efivarfs efivarfs /sys/firmware/efi/efivars
  17. mount: /sys/firmware/efi/efivars: efivarfs already mounted on /sys/firmware/efi/efivars.
  18. root@debian:/# apt install --reinstall grub-efi
  19. Reading package lists... Done
  20. Building dependency tree... Done
  21. Reading state information... Done
  22. The following package was automatically installed and is no longer required:
  23. sbsigntool
  24. Use 'sudo apt autoremove' to remove it.
  25. 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 74 not upgraded.
  26. Need to get 2,536 B of archives.
  27. After this operation, 0 B of additional disk space will be used.
  28. Get:1 http://deb.debian.org/debian bullseye/main amd64 grub-efi amd64 2.04-20 [2,536 B]
  29. Fetched 2,536 B in 0s (24.9 kB/s)
  30. (Reading database ... 227056 files and directories currently installed.)
  31. Preparing to unpack .../grub-efi_2.04-20_amd64.deb ...
  32. Unpacking grub-efi (2.04-20) over (2.04-20) ...
  33. Setting up grub-efi (2.04-20) ...
  34. root@debian:/# grub-install /dev/sda
  35. Installing for x86_64-efi platform.
  36. Installation finished. No error reported.
  37. root@debian:/# update-grub
  38. Generating grub configuration file ...
  39. Found background image: /usr/share/images/desktop-base/desktop-grub.png
  40. Found linux image: /boot/vmlinuz-5.10.0-10-amd64
  41. Found initrd image: /boot/initrd.img-5.10.0-10-amd64
  42. Found linux image: /boot/vmlinuz-5.10.0-9-amd64
  43. Found initrd image: /boot/initrd.img-5.10.0-9-amd64
  44. grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
  45. Adding boot menu entry for EFI firmware configuration
  46. done
  47. root@debian:/# file /boot/efi/EFI/debian/grubx64.efi
  48. /boot/efi/EFI/debian/grubx64.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows
  49. root@debian:/# efibootmgr -v | grep debian
  50. Boot0000* debian HD(1,GPT,c906677e-c2c2-42b5-b818-f0b19c046e95,0x800,0xfa000)/File(\EFI\debian\shimx64.efi)
  51. root@debian:/# exit
  52. exit
  53. user@debian:~$ sudo chroot /mnt
  54. root@debian:/# efibootmgr
  55. BootCurrent: 000A
  56. Timeout: 1 seconds
  57. BootOrder: 0000,0003,0004,0008,0009,000A
  58. Boot0000* debian
  59. Boot0003* UEFI OS
  60. Boot0004* UEFI OS
  61. Boot0008* Onboard NIC(IPV4)
  62. Boot0009* Onboard NIC(IPV6)
  63. Boot000A* UEFI: USB DISK 2.0 PMAP
  64. root@debian:/# exit
  65. exit
  66. user@debian:~$ sudo umount /mnt/dev
  67. umount: /mnt/dev: target is busy.
  68. user@debian:~$ sudo umount /mnt/sys
  69. umount: /mnt/sys: target is busy.
  70. user@debian:~$ sudo umount /mnt/proc
  71. user@debian:~$ sudo umount /mnt
  72. umount: /mnt: target is busy.
  73. user@debian:~$ sudo umount /mnt/boot/efi
  74. user@debian:~$ sudo umount /mnt
  75. umount: /mnt: target is busy.
  76. user@debian:~$ sudo umount /mnt/dev/pts
  77. user@debian:~$ sudo umount /mnt/sys/firmware/efi/efivars
  78. user@debian:~$ sudo umount /mnt/run
  79. user@debian:~$ sudo umount /mnt/dev
  80. user@debian:~$ sudo umount /mnt/sys
  81. user@debian:~$ sudo umount /mnt
  82. user@debian:~$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement