How to Reinstall GRUB (Alternate Method)

Поделиться
HTML-код
  • Опубликовано: 21 апр 2024
  • In this video, I show you another, better way to reinstall the GRUB bootloader on Linux.
    Prerequisites:
    1. A Linux install media (any GRUB-based distribution with a live ISO should do)
    THAT'S IT!
    Commands used in this video:
    Mount root partition: sudo mount /dev/sdXY /mnt (example: sudo mount /dev/sda3 /mnt)
    Mount boot partition (if applicable): sudo mount /dev/sdXY /mnt/boot (example: sudo mount /dev/sda2 /mnt/boot)
    Mount EFI System partition (if applicable): sudo mount /dev/sdXY /mnt/boot/efi (example: sudo mount /dev/sda1 /mnt/boot/efi)
    Setup "bind" mounts:
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
    Chroot into your Linux installation: sudo chroot /mnt
    Reinstall GRUB (in chroot): grub-install /dev/sdX (example: grub-install /dev/sda)
    Regenerate GRUB configuration file (in chroot): update-grub
    Alternate "update-grub" command (for Arch Linux only): grub-mkconfig -o /boot/grub/grub.cfg
    Exit chroot: exit
    Join this channel to get access to perks:
    ruclips.net/user/drewhowdentec...
  • НаукаНаука

Комментарии • 51

  • @cameronlee9327
    @cameronlee9327 Месяц назад +2

    Simple but effective. Great work!

  • @topramen7431
    @topramen7431 2 месяца назад +2

    Great video Drew :)

  • @TheSmellOfBooks
    @TheSmellOfBooks 2 месяца назад +2

    10/10 keep up the good work.

  • @FlamingSwordful
    @FlamingSwordful 2 месяца назад +1

    Just as my caddy broke, thx for the vid

  • @MohsenTheKnight21
    @MohsenTheKnight21 Месяц назад +1

    This worked thanks so much

  • @pegasuszarafa
    @pegasuszarafa Месяц назад

    At 4:44, when I run
    'grub-install /dev/sda'
    I get an error:
    Cannot find EFI directory.
    I've dual-booted Ubuntu Jammy with Windows 10, both on separate partitions in Legacy. What should I do?

    • @DrewHowdenTech
      @DrewHowdenTech  Месяц назад

      Make sure you’re booting your USB in legacy mode.

    • @pegasuszarafa
      @pegasuszarafa Месяц назад +1

      ​@@DrewHowdenTech Thanks.

  • @imacmill
    @imacmill 8 дней назад

    This looks identical to your first video.

  • @jamesmarsh3093
    @jamesmarsh3093 Месяц назад +1

    whenever i try to chroot it says failed to run command '/bin.bash' : no such file or directory. im trying to recover a digital ocean droplet after it was destroyed by an angry ex-admin

    • @DrewHowdenTech
      @DrewHowdenTech  Месяц назад +1

      Check to make sure that you are chrooting your ROOT partition, but that would indicate that there is more missing from your installation than just your bootloader.
      At this point, your best bet would be to extract the drive and copy the data off (hope your ex-admin didn’t delete that too).

    • @jamesmarsh3093
      @jamesmarsh3093 Месяц назад

      @@DrewHowdenTech you respond so quick thankyou. from the looks of it, he blocked all ports (cant access anything) and then just deleted any boot files? how would i extract the drive?

    • @DrewHowdenTech
      @DrewHowdenTech  Месяц назад

      Well, if you’re able to boot this system from a flash drive (to try chrooting), that would mean you have physical access to the system, right? If so, open it up, take out the drive, and connect it to a working computer, using a hard drive dock or something like that.
      You can also copy any data to an external drive, using the live USB.
      NOTE: I am writing the above with the assumption that you own the system in question.

    • @jamesmarsh3093
      @jamesmarsh3093 Месяц назад +1

      @@DrewHowdenTech bad news, system is hosted on digitalocean, the way im trying to chroot is through the recovery ISO

    • @DrewHowdenTech
      @DrewHowdenTech  Месяц назад

      Ahh, you’re remote hosting.
      Are you able to access the contents of the drive from DigitalOcean’s dashboard, or some other way over the internet (without booting it)?
      If not, are you able to access the contents of the drive from the recovery ISO?

  • @luigiprovencher8888
    @luigiprovencher8888 Месяц назад

    The problem for me is that with the other video you don't show how to do it if you've got a separate boot partition like you mentioned. So I'm guessing that it only works for ubuntu based systems or certain installation methods.

    • @DrewHowdenTech
      @DrewHowdenTech  Месяц назад

      This method is even easier. It's actually the exact same regardless of whether your /boot is on your root partition, or another partition. Only difference in the latter case is that, in addition to mounting your root and EFI System partitions, you also have to mount your boot partition at /mnt/boot (after mounting your root partition, but before mounting your EFI System Partition).

    • @luigiprovencher8888
      @luigiprovencher8888 Месяц назад

      @@DrewHowdenTech Yeah idk. I'd have to see a video of it.

    • @DrewHowdenTech
      @DrewHowdenTech  Месяц назад

      Check the description for a command for that.

    • @luigiprovencher8888
      @luigiprovencher8888 Месяц назад

      @@DrewHowdenTech I did. Not working for me. Getting an error message.

    • @DrewHowdenTech
      @DrewHowdenTech  Месяц назад

      What error message are you getting?