Grub recovery after windows install

Как вернуть меню выбора ОС после установки Windows рядом с Linux? Рассказываем о двух способах восстановления загрузчика GRUB — для новичков (с утилитой boot-repair) и для продвинутых пользователей (с помощью chroot).

Поставили Windows рядом с Ubuntu, и теперь можете запустить только ОС от Майкрософт? Рассказываем, как восстановить загрузчик GRUB после установки Windows 10 или 11 — вам хватит 20 минут, даже если вы новичок в администрировании VPS.

Аренда VPS/VDS виртуального сервера от AdminVPS — это прозрачная и честная услуга с доступной ценой

Представьте: вы установили Ubuntu, настроили систему, а потом решили поставить Windows рядом. Но после перезагрузки вместо привычного меню GRUB (grand unified bootloader) вы увидите только загрузчик Windows. Это происходит потому, что Windows не дружит с альтернативными загрузчиками: при установке она перезаписывает главную загрузочную запись (MBR) или заменяет файлы в разделе EFI. И если GRUB, стандартный загрузчик для Linux, может работать с несколькими ОС, то загрузчики NTLDR (Windows 11) и Bootmgr (Windows 10) не умеют. Когда вы ставите Windows после Ubuntu, они просто «не видят» ОС, установленную первой.

Что нужно знать перед восстановлением GRUB

Прежде всего разберёмся с базовыми понятиями — это поможет избежать ошибок и сэкономит время.

UEFI или BIOS

Современные компьютеры используют два типа firmware (микропрограммы для управления железом):

  • BIOS — это устаревший стандарт, загрузчик записывается в первый сектор диска (mbr);
  • UEFI — современная замена BIOS, работает с разделом EFI (fat32), где хранятся файлы загрузчиков в формате .efi.

Чтобы проверить, какой режим на вашем компьютере, зайдите в bios/uefi (нажмите клавишу del, f2 или f12 при запуске). Если в настройках есть пункты Secure Boot, UEFI Mode — значит, у вас используется UEFI.

Или выполните в Linux:

ls /sys/firmware/efi  

Если директория существует — система загрузилась через UEFI.

Live USB с Linux

Чтобы восстановить GRUB, понадобится загрузочная флешка с любым дистрибутивом (Ubuntu, Fedora, Mint).

Как создать Live USB:

  1. Скачайте iso-образ с официального сайта ОС.
  2. Создайте Live USB с помощью специальных программ:
    • Rufus (на Windows) — выберите «GPT для UEFI» или «MBR для BIOS» в зависимости от прошивки вашего компьютера;
    • BalenaEtcher (на Linux/Mac).
  3. Проверьте целостность образа после записи (в некоторых программах есть опция «verify»).

Как восстановить GRUB из-под Windows: два способа

Восстановление через boot-repair (для новичков)

Если вы не хотите работать в терминале, воспользуйтесь утилитой boot-repair. Она автоматизирует 90 % работы.

Шаг 1. Загрузка с Live USB

  1. Вставьте флешку, перезагрузите компьютер.
  2. Нажмите клавишу выбора загрузочного устройства (обычно f12, ESC или f8).
  3. Выберите флешку в меню.

Если у вас UEFI, загружайтесь в режиме UEFI, а не в Legacy! Иначе раздел EFI не будет обнаружен.

Шаг 2. Установка boot-repair

  1. Откройте терминал в Live-системе.
  2. Добавьте репозиторий и установите утилиту (далее все команды выполняются в режиме суперпользователя):
add-apt-repository universe   # добавляйте репозиторий в Ubuntu до версии 22.04
apt update
apt install -y boot-repair  

Шаг 3. Запуск и настройка

  1. Запустите boot-repair:
boot-repair  
  1. Выберите «recommended repair».
  2. Следуйте инструкциям на экране: утилита сама определит установленные ОС, восстановит GRUB и обновит конфигурацию.

Если возникли ошибки:

  • проверьте подключение к Интернету (boot-repair иногда скачивает дополнительные пакеты);
  • убедитесь, что live-система загружена в правильном режиме (uefi/bios).

Ручное восстановление через chroot (для продвинутых пользователей)

Если первый метод не сработал или вы хотите понять процесс изнутри, восстановите GRUB вручную.

Шаг 1. Определение разделов

  1. Загрузитесь с Live USB.
  2. Откройте терминал и узнайте список дисков:
fdisk -l  

или

lsblk -f 

Команда lsblk -f показывает типы файловых систем и точки монтирования.

  1. Пример вывода lsblk:
NAME  FSTYPE LABEL   UUID  MOUNTPOINT
sda    
├─sda1 ntfs Windows ABCD-1234 
├─sda2 ext4 Ubuntu 5678-90AB 
└─ sda3 vfat  ESP CDEF-1234 

Обратите внимание на:

  • корневой раздел Linux (ext4, btrfs и т. д.) — нам нужен именно он;
  • раздел EFI (vfat) — если система на UEFI;
  • раздел подкачки (swap) — не нужен для восстановления.

Шаг 2. Монтирование разделов

  1. Создайте точку монтирования:
mkdir /mnt/Linux  
  1. Примонтируйте корневой каталог с Ubuntu:
mount /dev/sda2 /mnt/Linux  

Для UEFI примонтируйте каталог EFI:

mount /dev/sda3 /mnt/Linux/boot/efi  

Если у вас отдельный раздел /boot, монтируйте его:

mount /dev/sdaX /mnt/Linux/boot  

Шаг 3. Вход в chroot

Chroot (change root) — это команда, которая изменит видимый корневой каталог, чтобы вы вошли в систему из live-окружения.

  1. Привяжите системные директории:
mount --bind /dev /mnt/Linux/dev
mount --bind /proc /mnt/Linux/proc
mount --bind /sys /mnt/Linux/sys  
  1. Войдите в среду chroot:
chroot /mnt/Linux  

Шаг 4. Установка GRUB

  1. Если прошивка BIOS (MBR):
grub-install /dev/sda  # здесь sda — диск, а не раздел
update-grub  
  1. Если прошивка UEFI (GPT), убедитесь, что пакет grub-efi установлен:
apt install grub-efi-amd64

Перед grub-install нужно обновить загрузочный список в efibootmgr, иначе в некоторых UEFI-системах GRUB не будет загружаться:

efibootmgr -c -d /dev/sda -p 1 -L "GRUB" -l "\EFI\GRUB\grubx64.efi"

Здесь -d /dev/sda — диск, -p 1 — номер EFI-раздела (уточните их с помощью lsblk).

Установите GRUB в раздел EFI:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
  1. Обновите конфигурацию:
update-grub  
  1. После update-grub в выводе должны появиться строки «found Windows» или «found os probe entries».

Шаг 5. Выход и перезагрузка

  1. Выйдите из chroot:
sync  # запись данных
exit 
  1. Отмонтируйте разделы:
sudo umount -R /mnt/Linux
  1. Перезагрузите компьютер.

Возможные проблемы и их решение

Даже если вы всё сделали правильно, могут возникнуть проблемы.

GRUB не видит Windows

Причина: os-prober не активирован (утилита для автоматического обнаружения установленных ОС).

Решение. В /etc/default/grub раскомментируйте строку:

GRUB_DISABLE_OS_PROBER=false  

Установите os-prober:

apt install os-prober  

Обновите загрузчик (update-grub).

Ошибка «grub-install: error: cannot find efi directory»

Причина: неправильно указан путь к разделу EFI.

Решение. Проверьте, примонтирован ли раздел EFI в /boot/efi. Проверьте тип раздела: он должен быть vfat (FAT32).

Загрузчик установился, но система не загружается

Причина: неверный порядок загрузки в uefi/bios или повреждённые файлы GRUB. Также включённый Secure Boot может блокировать работу GRUB.

Решение. Зайдите в настройки UEFI/BIOS и выберите GRUB в качестве первого загрузочного устройства. Отключите Secure Boot в UEFI. Если это не помогло — переустановите GRUB через chroot.

Как избежать проблем в будущем

  • Если планируете устанавливать две операционные системы, то сначала установите Windows, потом Linux.
  • Создайте резервную копию EFI/MBR.

Для BIOS:

dd if=/dev/sda of=backup.mbr bs=512 count=1  

Для UEFI — просто скопируйте содержимое раздела EFI в место для хранения.

  • Создайте отдельный раздел EFI для Linux. Это минимизирует конфликты с Windows.

Заключение

Восстановить загрузчик GRUB после установки Windows — задача, которая кажется сложной только на первый взгляд. Даже если вы новичок, boot-repair справится за пару кликов. Для тех, кто хочет глубже разобраться в процессе, подойдёт ручной способ через chroot.

Наши технические специалисты помогут вам определиться с конфигурацией и настроят ваш VPN-сервер под ключ, если это будет необходимо.

Читайте в блоге:

  • Как поменять TTL для раздачи Интернета: настройка Default TTL и изменение значения на 64 или 65
  • Что такое директория в Linux
  • Как сменить владельца папки и изменить права доступа в Linux

Если вы используете на своем компьютере две операционные системы, Windows и Linux, и обновили свою Windows из 7, 8 или 8.1 до самой новой Windows 10, могут возникнуть проблемы с загрузчиком Grub при использовании защищенной загрузки UEFI.  Во время обновления Windows 10 просто затрет загрузчик Grub и запишет туда свой.

Вы, как обычно, перезагружаете систему и ожидаете увидеть меню выбора операционной системы Grub, но вместо этого загружается новая Windows 10. Вам может показаться, что нет никакого способа получить доступ к Ubuntu или что не может работать Ubuntu рядом с Windows 10. Но это не так.

Содержание статьи

  • Как восстановить Grub после Windows 10

Многие советуют установить Ubuntu на другой диск, но есть более простое и прекрасно работающие решение, чтобы восстановить grub после установки windows 10. Конечно, всегда можно восстановить grub2 стандартным способом, с помощью LiveCD диска, но если вы используете UEFI, есть более легкое решение, мы сделаем все с помощью Windows 10.

Хотя за основу в этой статье берется Ubuntu, но это также будет работать и для других дистрибутивов. Просто папка, в которой находятся файлы загрузчика будет немного отличатся.

Шаг 1. Запуск cmd

Кликните по иконке поиск в Windows, наберите там cmd и найдите Командную строку Windows. Кликните по ней правой кнопкой и выберите Запустить от имени администратора:

Шаг 2. Подключение раздела EFI

Далее вы можете попытаться угадать как называется файл загрузчика Grub на разделе EFI, но можно поступить по другому и просто посмотреть. Чтобы подключить раздел EFI запустите diskpart. Для этого выполните:

diskpart

Затем выведите список доступных дисков:

list disk

Выберите в качестве активного диск, на который установлена Windows 10 и на котором сейчас находится раздел EFI:

sel disk 0

Далее выведите список разделов на диске:

list vol

Найдите раздел EFI, он обычно отформатирован в файловую систему FAT и занимает около 100 мегабайт места. В данном случае это том 2:

Этому разделу надо присвоить букву. Для этого выполните:

sel vol 2
assign letter=I:

Шаг 3. Поиск загрузчика

Далее надо найти файл загрузчика на разделе EFI. Но открыть этот раздел в проводнике вы не сможете, надо использовать только командную строку. Закройте DiskPart и выполните:

cd /d I:

Затем с помощью команды dir найдите загрузчик Grub. Например:

dir EFI\Ubuntu

Здесь есть файл grubx64.efi. Это он. Загрузчик может называться по другому в других дистрибутивах, именно поэтому я рассказал как всё посмотреть.

Шаг 4. Восстановление Grub

Скопируйте и выполните эту команду:

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

Вам не нужно будет вводить пароль, у вас уже есть права администратора и программа должна отработать нормально. Эта команда обратно запишет вместо загрузчика Windows 10 загрузчик Grub.

Если команда вернула ошибку, вы можете откатить изменения с помощью следующих команд:

bcdedit /deletevalue {bootmgr} path \EFI\ubuntu\grubx64.efi

bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi

Выводы

Восстановление Grub после Windows 10 завершено. Перезапустите компьютер и вы увидите на экране знакомый Grub. Надеюсь, эта краткая инструкция помогла вам выполнить восстановление Grub после установки Windows 10.

Об авторе

Веб разработчик. Создал losst 9 лет назад. Увлекаюсь открытым программным обеспечением, программрованием, Linux, DevOps. Люблю узнавать что-то новое. В качестве основной ОС сейчас использую Fedora.

Contents

  1. Using the Ubuntu CD (Recommended)

    1. The graphical way
    2. The terminal way
  2. Using the Ubuntu Alternate CD
  3. See also

This page documents how to restore or recover the boot-loader (GRUB) after installing Windows. Some reasons to repair your boot-loader might include installing Microsoft Windows after you have installed Ubuntu, adding or removing a hard drive, or changing hard drive settings.

Note: this tutorial does not apply if you had installed Ubuntu inside Windows (via the Wubi installer). In this case, please read this page.

Using the Ubuntu CD (Recommended)

The graphical way

  • Insert your Ubuntu CD, reboot your computer and set it to boot from CD in the BIOS and boot into a live session. You can also use a LiveUSB if you have created one in the past.
  • Install and run Boot-Repair

  • Click «Recommended Repair».
  • Now reboot your system. The usual GRUB boot menu should appear. If it does not, hold Left Shift while booting. You will be able to choose between Ubuntu and Windows.

The terminal way

* Open a terminal. As of Ubuntu 11.10 and 11.04, this can be done by opening the Unity Dash (you can click the Ubuntu logo in the top panel or use the Windows key on your keyboard) and typing in «Terminal», and clicking what comes up. On earlier versions, you can achieve this by going to Applications -> Accessories -> Terminal. Alternately use the Keyboard Shortcut: CTRL + ALT + T.

For full details on using terminal to fix grub on hard drive from Live Installer DVD or Flash: https://help.ubuntu.com/community/Grub2/Installing#via_the_LiveCD_terminal

  • You are then presented with a standard bash prompt, type — this only works to reinstall to MBR of a working system:
sudo grub-install /dev/XXX

where XXX is the device of your Ubuntu install. (eg: grub-install /dev/sdb). Hint: You can also use /dev/disk/by-label/ if the partition you installed on has a label. You can determine the /dev node for such a device by running:

ls -l /dev/disk/by-label/

This will give the output of something like:

lrwxrwxrwx 1 root root 10 Oct 16 10:27 data -> ../../sdb2
lrwxrwxrwx 1 root root 10 Oct 16 10:27 data2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 16 10:27 fat -> ../../sda6
lrwxrwxrwx 1 root root 10 Oct 16 10:27 home -> ../../sda7
lrwxrwxrwx 1 root root 10 Oct 16 10:27 root -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 16 10:27 swap -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 16 10:27 windows -> ../../sdb1

You can also use fdisk if you do not see the /dev/disk/by-label:

$ sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001bc54

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       18725   150403072   83  Linux
/dev/sda2           18725       19458     5884929    5  Extended
/dev/sda5           18725       19458     5884928   82  Linux swap / Solaris

From here, find only the drive name, ignore the partition number, that is, for partitions labeled «root», «data2», «fat», «home» and «swap» it’s all still just sda. This is due to the fact that GRUB is installed in the MBR of the drive, and not on a partition.

Trouble? If other things are messed up, e.g. if you have deleted the partition from where Grub was previously installed, grub-install may return an error message such as «cannot find a device for /… (is /dev mounted?)». You may have to do grub-install a bit differently. Refer to the handy guide on fixing a broken system

Now reboot your system. The usual GRUB boot menu should appear. If it does not, hold Left Shift while booting. You will be able to choose between Ubuntu and Windows.

Using the Ubuntu Alternate CD

  • Boot your system from the Ubuntu Alternate CD.
  • When the Ubuntu splash screen comes up with the boot: prompt, type in rescue and press enter.

  • Choose your language, location (country) and then keyboard layout as if you were doing a fresh install.
  • Enter a host name, or leave it with the default (Ubuntu).
  • At this stage you are presented with a screen where you can select which partition is your root partition (there is a list of the partitions on your hard drive, so you are required to know which partition number Ubuntu is on). This will be dev/discs/discY/partX, where the X is a partition number and Y is the number of the drive.

  • Now proceed as described in «The terminal way» above.

See also

  • GRUB2


CategoryLive CategoryBackupRecovery CategoryBootAndPartition CategoryInstallation CategoryBootAndPartition

RecoveringUbuntuAfterInstallingWindows (last edited 2015-01-27 14:44:04 by iburst-41-56-112-193)

Restore GRUB After Windows Install. When you install Windows alongside Linux, the Windows bootloader overwrites GRUB, preventing you from booting into Linux. This guide explains how to restore or repair GRUB and finally regain access to your Linux system.

How to Restore GRUB after Windows Installation

Here I’ll be covering two methods of restoring GRUB:

  1. Manual Restoration (a hands on process)
  2. Automated Restoration (with the help of Boot Repair)

Both methods of restoring GRUB are reliable and work with Windows 10 and Windows 11 installations.

Why Is Reinstalling GRUB Necessary?

When you install Windows, its installer assumes it’s the only operating system on your machine. As a result, it overwrites the GRUB bootloader with the Windows bootloader, which cannot detect Linux systems. Restoring GRUB is necessary to regain access to your Linux partition and enable dual-boot functionality.

Manual GRUB Restoration

Prerequisites: A Live Linux USB drive (e.g., Ubuntu, Fedora, or Debian). You can create this using YUMI, a preferred tool for creating multiboot bootable USB drives.

Steps to Manually Restore GRUB:

  1. Create a Live USB with YUMI
    • Download YUMI.
    • Run YUMI and follow these steps:
      1. Select your USB drive from the dropdown menu.
      2. Choose a Linux distribution from the list (e.g., Ubuntu or Fedora).
      3. Browse to the Linux ISO file you’ve downloaded (e.g., from Ubuntu Downloads).
      4. Click «Create» to write the ISO to the USB.
    • Once completed, you’ll have a bootable Live USB ready for use.
  2. Boot into the Live Linux Environment
    • Insert your YUMI created Live USB and restart your computer.
    • Ensure the system boots from the USB drive (you may need to access the BIOS or UEFI boot menu by pressing keys like F2, F10, or DEL).
    • Select the «Try Ubuntu» (or equivalent) boot option to access a temporary Linux environment.
    • Open a terminal using Ctrl+Alt+T or your distribution’s terminal shortcut.
  3. Identify the Linux Partition
    Run the following command to list your system’s partitions:

    sudo fdisk -l

    Look for the partition where Linux is installed (e.g., /dev/sda1).

  4. Mount the Linux Partition
    Replace sdx1 with your actual Linux partition name:

    sudo mount /dev/sdx1 /mnt
  5. Mount Essential System Directories
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
  6. Chroot into the Linux Environment
    sudo chroot /mnt
  7. Reinstall the GRUB Bootloader
    Install GRUB to your hard drive. Replace sdx with your actual device name (e.g., /dev/sda):

    sudo grub-install /dev/sdx
  8. Update the GRUB Configuration
    sudo update-grub
  9. Exit the Chroot Environment
    exit
  10. Unmount Partitions
    sudo umount /mnt/dev
    sudo umount /mnt/proc
    sudo umount /mnt/sys
    sudo umount /mnt
  11. Reboot the System
    sudo reboot

Automated GRUB Restoration Using Boot Repair

If you prefer an easier method, you can use the Boot Repair tool, which simplifies the process of fixing boot issues like a missing GRUB bootloader.

Restoring GRUB Using Boot Repair:

  1. Create a Bootable Boot Repair USB Using YUMI
    To create a bootable USB with Boot Repair, follow these steps:

    • Download YUMI from the official YUMI website.
    • Run YUMI and do the following:
      1. Select your USB drive from the dropdown menu.
      2. From the list of distributions, choose Boot Repair ISO or select «Try Unlisted ISO/IMG» if it isn’t listed.
      3. Download the Boot Repair ISO from SourceForge.
      4. Browse to the Boot Repair ISO file you downloaded and select it.
      5. Click Create to write the Boot Repair ISO to the USB drive.
    • Once the process is complete, your Boot Repair USB will be ready.
  2. Boot from the Boot Repair USB
    • Insert the USB drive and restart your computer.
    • Access your BIOS/UEFI settings (press keys like F2, F12, or DEL during startup).
    • Set the USB drive as the first boot device and boot into the Boot Repair environment.
  3. Launch Boot Repair
    • When the Boot Repair environment loads, you’ll see an option to launch the Boot Repair tool.
    • Click on the Recommended Repair option to allow Boot Repair to automatically scan and fix your GRUB installation.

Once Boot Repair has finished restoring GRUB, you should be able to boot into both Linux and Windows after restarting your computer.

Frequently Asked Questions

Why does Windows overwrite GRUB?
Windows assumes it’s the only OS on the system and replaces GRUB with its own bootloader.
What happens if I reinstall GRUB on the wrong drive?
You may encounter boot errors or overwrite another OS’s bootloader. Double check the drive name before running grub-install.

Final Thoughts

It is often necessary to reinstall or restore GRUB after Windows installation if you still want to maintain a dual boot system. Whether you prefer a manual method or the simplicity of using Boot Repair, both approaches are effective for regaining access to Linux. Creating a Live USB with YUMI for Boot Repair makes the process even easier by providing a portable and reliable tool for fixing bootloader issues.

If you follow these steps carefully, you should have no problem restoring GRUB and booting into both Windows and Linux without issues. Feel free to reach out if there’s anything I’ve missed. Happy dual booting!

LINUX

When you install or reinstall Windows on a system that previously had Linux, the Windows installation process often overwrites the GRUB (Grand Unified Bootloader) that allows you to select which operating system to boot. After the Windows installation, you may find that your Linux OS is no longer accessible. This article will guide you through the steps necessary to reinstall and configure GRUB to regain access to Linux after a Windows installation.

Understanding GRUB and Bootloaders

What is GRUB?

GRUB, or the Grand Unified Bootloader, is a boot loader package designed to support multiple operating systems. When your computer boots, GRUB allows you to select which operating system to boot into, including various distributions of Linux as well as Windows.

Why Windows Overwrites GRUB

During the Windows installation, especially in dual-boot configurations, the Windows installer usually rewrites the Master Boot Record (MBR) or updates UEFI firmware settings, replacing the existing GRUB configuration. This action resets your bootloader to point solely to Windows, leading to an inability to access Linux.

Steps to Reinstall GRUB

To restore GRUB, follow these steps:

Prerequisites

  • A live Linux USB or DVD (such as Ubuntu, Fedora, or any other distro containing GRUB)

  • Access to a terminal window

Step 1: Boot from Live USB/DVD

  1. Insert the live USB or DVD into your computer and boot from it.

  2. Select “Try [Distro]” to enter the live session.

Step 2: Identify Your Linux Partition

Before reinstalling GRUB, you must determine where your Linux installation is located.

  1. Open a terminal (usually accessible via Ctrl + Alt + T).

  2. Run the following command to list partitions:

  1. Look for the partition containing Linux, typically denoted by the type ‘Linux filesystem’. For example, it may look like /dev/sda5.

Step 3: Mount the Linux Partition

Now, you need to mount your Linux partition.

  1. Replace /dev/sda5 with your Linux partition identifier from the previous step:

   sudo mount /dev/sda5 /mnt
  1. If you have a separate boot partition, you’ll need to mount it as well:

   sudo mount /dev/sdaX /mnt/boot

(Replace /dev/sdaX with your boot partition identifier if applicable.)

Step 4: Bind the Necessary Directories

To ensure GRUB can access all required parts of the system, bind essential directories:

sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys

Step 5: Chroot into Your Linux Installation

Change the root directory to your mounted partition using chroot:

This command gives you access to your installed Linux environment.

Step 6: Reinstall GRUB

Now it is time to reinstall GRUB. Depending on whether your system uses BIOS or UEFI, the command may vary slightly.

For BIOS Systems:

For UEFI Systems:

Ensure you have grub-efi installed and run:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB

Step 7: Update GRUB Configuration

After reinstalling GRUB, update the GRUB configuration file to include all operating systems available:

This command will detect your Windows installation and add it to the GRUB menu.

Step 8: Exit chroot and Reboot

Exit the chroot environment and unmount everything:

exit
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/dev
sudo umount /mnt

Finally, reboot your computer:

Step 9: Boot into GRUB

On booting, you should see the GRUB menu, allowing you to select either Linux or Windows.

Troubleshooting Common Issues

  • GRUB Menu Not Appearing: If GRUB does not appear but directly boots into Windows, go back to the live session and repeat the reinstall steps, ensuring that you executed grub-install correctly.

  • Missing OS Entries: If the Windows entry is missing, verify that the update-grub command showed the Windows detected. If not, you may need to check your partitioning scheme and ensure Windows is properly installed.

  • Secure Boot Issues: For UEFI systems, disabling Secure Boot in the BIOS settings might be necessary for GRUB to function correctly.

Conclusion

Reinstalling GRUB after a Windows installation is a crucial step to regain access to your Linux operating system in a dual-boot setup. By following this guide, you’ll be able to restore GRUB effectively, ensuring a seamless boot experience between your Windows and Linux installations. For best practices, regularly backup your important data, and maintain a live USB with your preferred Linux distribution on hand for occasions such as these.

Suggested Articles

LINUX

LINUX

LINUX

LINUX

LINUX

LINUX

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows feature experience pack как отключить
  • Download windows update list
  • Как восстановить встроенные приложения в windows 10
  • Фон рабочего стола в виде рабочего стола windows
  • Kb2670838 что за обновление windows 7