GRUB - why and how to remove it, as well as how to restore the Windows bootloader. GRUB operating system loader: settings, description. Installing and restoring GRUB

The matter today is simple. But when there are two operating systems, and one of them needs to be removed without affecting the other, this is where difficulties can arise. Selected problems appear when restoring the Windows bootloader.

Some users install in parallel with Windows Linux, it has many advantages, for example, completely free use. But two systems on one electronic computer They still begin to conflict, so one has to be deleted. And if you decide to remove Linux, leaving Windows intact, you will have to decide how to remove the Grub boot loader. But erasing the program is not enough; you need to know how to restore the Windows bootloader immediately after removal in order to start the OS. Our recommendations will help you complete all the procedures; first determine which OS you have and follow the right path.

Grub is an abbreviation of the English GRand Unified Bootloader and is an OS bootloader developed by GNU. The utility allows you to select the operating system from the installed ones when turning on or restarting the PC, namely the one that the user needs. The latest version of the program supports several operating systems, such as Solaris, Linux, FreeBSD. Unsupported OSes are booted by Grub passing this function to another boot loader (NTLDR on Windows).

Grub 2 is built with a multi-module design and can even be configured to load games. Externally it may look like a black and white table or have stylish design. Provides normal functioning different file systems: FAT 16, 32; NTFS, XFS, ext, ISO.

Removing Grub

Some users find it difficult to figure out how to remove Grub. Although the process itself is simple, applicable various ways, depending on installed second systems.

Removal with Windows XP installed

If the PC is running Windows XP, the problem of how to remove Grub is not solved so quickly, but without any particular difficulties. Run a hard drive manager, which will remove software components marked ext. Well suited for the removal procedure of Power Quest PartitionMagic 8.0. You will then need to restore the Windows boot loader to run your PC after uninstalling Linux. Follow the algorithm.

Using the utility, delete partitions labeled ext

  1. Bottom of the application window color designation sections. After deleting exploited Linux, free up space, it will be grayed out.
  2. The smart machine will reboot and the message “NTLDR is missing” will be displayed. It says that the system cannot start Windows OS and files need to be restored.
  3. Launch the recovery console and connect the CD or bootable USB flash drive.
  4. The console will ask you to specify which copy of the OS should be logged into. Put "1".
  5. You will be asked for an administrator password, enter it.
  6. Then enter the fixmbr command, which repairs the partition tables and overwrites the boot area.
  7. The console will display a warning and ask you to confirm the process, enter "Y".
  8. The boot area is created, then enter fixboot command to write the boot sector to the main disk.
  9. Confirm the operation when prompted by typing "Y".

The computer will reboot, bootloader recovery will be completed successfully, and Windows XP will start.

Removal with Windows 7, 8 installed

Procedure for installed Windows 7-8 is easier than the one described above. IN in this case you don't need bootable flash drives or running the console. Follow the algorithm:

  1. Go to “Start” - “Run”.
  2. In the field of the utility opening window, enter list disk, press Enter, after which you will see a list of devices available on your PC.
  3. Enter “select disk No...”, indicating the number of the disk with Grub installed.
  4. Press Enter. A message will appear indicating that the disk has been selected.
  5. Type the command “clean” - “Enter”.
  6. A message appears indicating that the disk was erased successfully.

Removal with FreeDos

When FreeDos is installed, the loader program can be removed using the command line. You simply format the disk with the boot area.

  1. Launch Command Prompt.
  2. View the contents of the disks by issuing the "dir" command.
  3. Having discovered boot sector, format the entire partition by entering the “format” command and indicating on the same line required disk, for example, "with:".
  4. After completing the procedure, Grub will be removed from the hard drive.

Removing Grub4Dos

If you have the Grub4Dos bootloader installed, you can easily remove it via the command line. Type the command “sudo apt-get purge grub2 grub-pc” there and Grub will remove itself. Next, using a boot disk or a special console, you restore the bootloader and launch the existing OS.

Although Linux has many advantages over other systems, modern OSes are often chosen or two systems installed. But transitions between them are difficult, conflicts arise in the software, and you have to remove such a familiar, convenient Linux. Above, we described in detail how to perform the removal without disrupting the operation of the second system. Now you can, by removing Grub, leave only one OS on your PC; Do you know how to restore the Windows bootloader? Carry out the operations carefully, follow the manual supplied with the loader, and you will successfully complete everything necessary.

Grub is the default boot loader on most Linux distributions. Grub stands for GRand Unified Bootloader, it supports booting not only Linux, but also Windows and DOS.

If you installed Linux, and then for some reason decided to remove it and return to Windows or create a bootable Linux flash drive, but now you no longer need it, you need to remove the Grub bootloader. In this instruction, we will look at how to remove the Grub bootloader from the MBR or from the UEFI, and we will also talk about how to remove Grub from a flash drive.

How to remove Grub bootloader and restore Windows

If you have two operating systems installed on your computer, Windows and Linux, and you want to erase Linux and its bootloader by restoring the Windows bootloader, and you are using an MBR table, then this is very easy to do.

The network often recommends a method: take the installation Windows disk, boot from it in recovery mode and run the commands:

bootrec\fixboot

This is truly the answer to the question "how to remove Grub and repair the Windows bootloader?" and it works. But there is a much simpler way. You don't even have to restart your computer. The Bootice utility allows you to restore the Windows bootloader and remove Grub from your hard drive in a few clicks.

You can download the utility from softpedia, because everything on the official website is in Chinese. Just choose the correct bit size for your system. Launch the utility, highlight the drive on which you have Grub installed, then click the button Process MBR:

Then Windows NT 5.x/6.x MBR:

And press the button Config/Install:

And that's it: you were able to successfully remove the Grub bootloader completely. You can reboot and check.

How to remove Grub bootloader in UEFI

This problem can also be solved using the Bootice utility. Only this time you need the 64-bit version of the program.

One of benefits of UEFI on MBR is that here you can install several boot loaders on a special partition at once. To remove the Grub boot loader and restore Windows functionality, simply move Grub a little lower in the UEFI boot queue.

Open the program, go to the UEFI tab and click Edit Boot Enteries. The following window will open:

Here you have two options. Or lower Grub below the Windows bootloader using the button Down, or completely delete the bootloader entry using the button Del. But in both cases, the bootloader files will remain on the disk. You need to completely remove the Grub boot loader with all its files from the command line. That's not a lot difficult process, but we’ll still look into it.

Click in the lower left corner of the screen right click mouse, in the context menu that opens, select Command line on behalf of administrator.

Then look at the available disks:

And we select our only disk on which Windows is now installed, and Ubuntu was previously installed:

Once the disk has been selected, we can view the list of partitions on it:

Among these partitions there is also a section with EFI files, for conventional system it is hidden, but not for this utility. In our case, this is Volume 2. As a rule, this is a small partition with the FAT32 file system and marked as system.

We selected this section as current using the command:

Then we’ll assign a letter to it so we can work with it:

assign letter=D:

Go to the EFI folder:

Delete the folder with the Ubuntu boot loader files:

Done: Grub boot loader removal is complete and its files are no longer on the system.

How to remove Grub from a flash drive

On flash drives, as a rule, a table is used MBR partitions. To remove the Grub bootloader from a flash drive, it is not enough to simply format it. The bootloader is written to MBR table, and therefore we will have to recreate it. I strongly do not recommend using this method to remove the Grub bootloader from your hard drive, because you will lose all your data.

We will work in Linux system. First, look at the device name of your flash drive, for example, using the Gparted program or in the terminal with the command:

Then delete it completely existing table sections:

dd if=/dev/zero of=/dev/sdc count=512

Now, using the same Gparted, we create new table sections:

Create a partition on the flash drive and format it to the FAT32 file system:

Now you know how to remove MBR from a flash drive, just don’t erase it from your hard drive, because it will be difficult to restore later.

conclusions

I don't know why you needed to uninstall Linux. This is an excellent operating system, although there are still hardware that it does not support or does not fully support. Don't give up quickly: if Linux doesn't work on one device, maybe in the future you'll get another computer or the kernel will start supporting your laptop. Try and experiment. In any case, now you know how to remove Grub from your hard drive. If you have any questions, ask in the comments.

Installing Windows or Linux is a fairly simple process. But when two operating systems are installed on one PC at the same time, and one of them needs to be removed while keeping the other, some problems most often arise. This is not so easy to do. Restoring the standard Windows bootloader causes some difficulties.

Many people today use the Linux operating system. It has many advantages over Windows OS, one of the most important is that it is completely free and open architecture. But you have to pay for everything, and the coexistence of OS data on one PC is fraught with certain conflicts.

That is why it is quite problematic to remove one of the OS without consequences for the second. Especially if you want to remove the Grub bootloader and leave Windows intact.

Most often, the Grub boot loader looks like this:

What is Grub?

In order to understand how to remove the Grub boot loader, you need to know what it is. The abbreviation Grub in English sounds exactly like GRand Unified Bootloader. What does it mean - operating system loader. It is developed by the GNU company.

The bootloader in question is essentially a kind of selector that allows the user to choose the one he needs. this moment operating system. The choice can only be made while the PC is rebooting or at startup.

Grub 2 (the latest version of the bootloader developed by the company) supports many operating systems:

  • FreeBSD;
  • Linux;
  • Solaris.

But even if the system you need to start is not supported, the Grub boot loader can delegate the task of starting the PC to another. For example, on Windows it is NTLDR. It is also possible to run MS-DOS, OS/2 and other similar operating systems.

The capabilities of the bootloader in question are quite wide:


Removing Grub and methods for restoring it

Many users are wondering how to remove GNU Grub? This is quite simple to do, but the method and required applications different for different cases. Also, a situation often arises when Grub is removed accidentally, and for normal operation It is very important to restore the bootloader correctly on your computer.

You can do this in several ways:

  • by using installation disk Linux;
  • using a bootable USB flash drive that contains Linux;
  • when one of the disk partitions has a bootloader distribution.

Video: Installing Ubuntu 10.10 on Windows XP and restoring the GRUB bootloader

Recovery using Rescue Mode

To begin recovery, you must first download all the necessary modules. IN this mode The following commands are available:

  • Unset;
  • Insmode.

You must select the first team. It will look like this - is /boot/grub. In response, the PC will display a list of all files in the directory.

  • Insmod ext2;
  • Insmode normal;
  • Normal.

After this, Grub will be fully restored and will switch to full functionality mode. All operating systems will be found and the screen will display standard menu Grub bootloader. This recovery method is universal, no matter what OS is installed on your PC.

Recovering Grub using a USB flash drive

We start the system from USB. Using the key combination Alt+F2, turn on the terminal. When it is open, you need to give the PC the gnome-terminal command. After this, it is important to familiarize yourself with the partition table.

To do this, you need to run the command sudo fdisk -1. The following table should appear on the screen:
When the partition in which the operating system is located is known (in this case it is sda1), you can begin to restore the bootloader

(besides the bootloader itself, several additional directories will be repaired).
The command sudo chroot /mnt will change into a chroot environment.

Photo: using the sudo chroot command

AND final stage bootloader recovery - run the command grub-instal /dev/sda. If you encounter any problems during recovery, you can use the following commands:

Photo: executing the command grub-instal /dev/sda

If you have Windows XP installed

If Windows XP is installed on your computer, then removing the Grub boot loader is not difficult. You just need to launch a manager hard sections disk, and remove all components marked ext. The optimal application in this regard is Power Quest PartitionMagic 8.0. It looks like this:

There is a stripe at the bottom, it is outlined in different colors. Lilac and burgundy represent partitions used by Linux. They need to be removed. After this you will receive free place, unmarked area. It will be highlighted in grey.

What does it mean that Windows cannot boot due to lack of necessary files. To restore them, you need to launch the “Recovery Console”.

Photo: Windows XP Recovery Console

The easiest way to do this is using a CD, but if it is missing, you need to create a bootable USB flash drive on another computer.

Once the Recovery Console is running, you can proceed directly to recovering the Windows boot loader:


The PC is rebooted and the operating system Windows system XP should start without any problems.

New launching Ubuntu Grub is only possible after reinstallation Linux to the newly created partition.

Windows 7 or 8 installed

If your PC is running Windows older than Vista, then there is an extremely simple way to remove the Grub boot loader without any tricks - creating bootable flash drives, console launch and others complex actions. This can be done without a Windows distribution disk.

Procedure:


FreeDOS installed

If the FreeDos operating system is installed on your PC, you can remove the Grub bootloader using command line mode. You simply need to format the disk on which the boot area is located.

This operation is performed as follows:


After performing this operation, the Grub bootloader will be completely removed from the hard drive.

Removing Grub4Dos

Removing this bootloader is quite simple. You just need to enter the following on the command line: sudo apt-get purge grub2 grub-pc. After that, this bootloader will simply delete itself.

But it is important to remember that running the operating systems available on the PC will no longer be possible in normal mode; you will need to use some recovery programs or a special Windows console.

Photo: installation or removal options

Grub is an extremely convenient boot loader; it acts as a selector for operating systems. Allows many different operating systems to coexist on one machine without conflicts. Makes it possible to launch what is needed at a given time as simply and quickly as possible.

Grub 2 or more early version This bootloader is quite easy to configure. To implement it, you don’t need to be a highly experienced IT specialist; you just need to know a few commands. Removal or installation is also not very difficult. It is only important to be as careful as possible when performing all operations, to do everything according to the manual that comes with the loader.

More than a dozen new non-Windows users greet the phrase “bootloader” with a fair amount of doubt and skepticism these days. And there is an absolutely logical reason for this: most beginners, before switching to using other, less common operating systems on the market, used the same Windows in their everyday life. In it, this bootloader is implemented as primitively and transparently as possible. And although this to some extent adds convenience for the average user, it also reduces functionality already the most popular and versatile OS. Therefore, all those who have decided to pay attention to other products of the IT industry should definitely familiarize themselves with the universal bootloader GRUB, which in the future will significantly help in working with several operating systems installed on one computer.

A universal tool for non-universal systems

First of all, let's start with the name GNU GRUB. This abbreviation from English translates as “main unified bootloader”. Its creator is non-profit organization The GNU Project, which became famous in the IT field for its freely distributed software. GRUB itself is essentially a boot selection menu required by the user OS from a whole list of supported systems:

  • Linux.
  • FreeBSD.
  • Solaris.

In this case, GRUB will be able to work even with Windows. However, for launching such systems that are not directly supported by this bootloader, there are special nuances that we will study a little later in all the details and details.

Technology development path

The continuously growing popularity of GRUB was the fundamental reason that prompted the steady development and improvement of the boot loader in the future. The very first version of the bootloader, called GRUB Legacy, still copes well with the tasks of a unified bootloader for UNIX-like systems. Widespread support from serious companies (like RedHat and Novell) and server distributions ensured its continued existence in general.

However, even this circumstance had absolutely no impact on the further improvement of the bootloader, thanks to which users received the latest version of GRUB 2 at the moment. Being rewritten from scratch, GRUB 2 hardly has anything in common with the outdated GRUB Legacy, except for the name itself . Today, being used by default since version 9.10 of the Ubuntu operating system, GRUB of the second revision, due to its more advanced and powerful structure, has completely stopped any further development of Legacy, which has already proven itself so well in the past.

However, from the very beginning, a beginner should understand that GRUB 2 is a more complex boot loader compared to the previous version. Therefore, in order to protect users from possible difficulties and problems, then all will be described simply and in detail the smallest details, understanding of which will allow you to take full advantage of all the innovations in the latest version, and there are quite a few of them:

  • Script support (cycles, conditions, variables and functions).
  • Graphical interface adds flexible changes appearance bootloader to suit the individual taste of the user (GRUB 2 can be easily changed from a black and white table to a stylish multi-colored window).
  • Possibility of dynamic loading of modules. This will allow you to expand the functionality not at the assembly stage, but directly during execution.
  • Compatible with different architectures.
  • Added support for loading Mac OS.
  • Added stable work with file systems such as: FAT16, FAT32, NTFS, any version ext, XFS And ISO
  • The cross-platform installation type will make it possible to install GRUB2 from a different architecture
  • Introduction safe mode in case of problem situations.
  • Fixed errors from the old GRUB Legacy that initially could not be fixed due to the requirements

Has everyone heard of LILO?

Of course, the choice of users among OS loaders is not limited to GRUB alone. A similar analogue is LILO - the Linux initial loader (LInux LOader), which still does not completely lose its relevance. However, in favor of GRUB, several should be taken into account distinctive features, which a direct competitor definitely cannot boast of yet:

  • LILO supports only 16 boot configurations, while GRUB supports an unlimited number of such configurations.
  • GRUB can boot by local network, which cannot be said about LILO.
  • Finally, LILO does not have that very command interactive interface, the convenience of which users have long been accustomed to latest version GRUB.

The only common feature of both loaders is the need to compile all changes made to the menu each time. The automatic saving function has long been absent from the proprietary Linux boot loader. GRUB 2 also does not boast such a convenient feature. But even taking into account this inconvenient everyday use nuance, LILO is inferior to its competitor on several points, thanks to which it is becoming increasingly widespread among home computer users.

Installing GRUB: all the nuances and details of the process

From the very beginning, make sure you have either installed Ubuntu, or there is a boot disk (LiveCD). After starting the system, you need to call the terminal using the key combination Ctrl+Alt+F2, and then enter the following commands in it:

Sudo add-apt-repository ppa:cjwatson/grub,

Sudo add-get update && sudo add-get install grub2,

Sudo update-grub2.

And even if you do not have Ubuntu installed, but have a LiveCD, the procedure remains the same with only one tiny difference. After booting from this, select the “Try Ubuntu” option - this way you will start the system without any changes on your computer. After that, continue installing the GRUB boot loader in the same way from the terminal call stage.

Check installed version bootloader can be commanded grub-install -v, as well as directly during Ubuntu boot itself.

GRUB startup algorithm

As GRUB Install completes, the boot loader first changes the MBR code to its own. MBR is a sector containing the master boot record (from English containing:

  • main bootloader code (446 bytes);
  • partition table with a description of both primary and secondary partitions of the hard disk (64 bytes).

Due to the small volume MBR sector, launching GRUB fits into two conditional stages:

  1. The MBR contains a link to the configuration file (which can be located on any hard drive, at the discretion of the user). It is by this that the entire loading stage, starting at the second stage, will be determined.
  2. Their configuration file takes into account all the settings and data necessary for GRUB to work. If at the second stage the configuration file was not found, then the boot process will be terminated and the user will have to manually select the boot configuration from the command line.

This boot structure allows GRUB to be more widely configurable and flexible than many other analogues, in which this process is simplified to maximum compactness.

Most commonly used console commands

The considerable scope of working possibilities in the console mode of the latest version of GNU GRUB, setting and configuration capabilities will also not leave users indifferent. In order to get into it, just press the “C” key while the boot menu is displayed, after which all you have to do is enter the commands you need correctly:

TeamsDescriptionExample console input
lsA universal command for working with lists of hard drives and partitions. Can be used to display the contents of a folder.ls /boot/grub
Its use will give full information absolutely about any section. This will indicate the type of file system on it, its label, UUID, as well as the date of the last changes.
catDisplay information about the contents of a specific file.cat /path/filename
linuxAn analogue of the GRUB kernel command from good old version Legacy, which allows the specified Linux kernel to be loaded.

linux kernel file

option1=value

option2 option3

chainloaderTransferring boot control to another bootloader along the chain. The bootloader will be searched exclusively in the partition that is specified as root (of course, indicating the specific executable file).

chainloader /path/filename

rootWhen using the command without any parameters, the user will receive information about the root partition, as well as the type of file system on it.root
Less often (due to the likelihood incorrect operation) is used to move root to another partition.

*,* - disk number and partition number on it, respectively

setMost often, due to its stability and performance, it is used to reassign the root partition on a disk.

set root= (hd*,*)

*,* - disk number and partition number on it, respectively

search

Command to search for a section UUID, label, or specifically given file. The following keys are used to set search parameters:

  • u (or --fs-uuid) - search for a partition by UUID;
  • l (or --label) - search by section label;
  • f (or --file) - search for a specific file;
  • n (or --no-floppy) - skip when checking a floppy drive;
  • s (or --set) - set the found section as the value of the specified variable.

The command will be useful if the numbering of disks and partitions goes wrong, which is why the set root command will either lead to nowhere or to the wrong partition of the wrong disk.

search -u uuid_of_the_partition

search -l partition label

search -f /path/filename

lsfontsDisplaying a list of downloaded currently fonts.lsfonts
helpUsed to display the entire list of availablehelp
Or to output commands starting with a certain combination of characters.

help s - display help for all commands starting with s.

help set - displays help about the set command.

terminal_output.consoleSwitch to black and white color scheme display.terminal_output.console
background_image

Change background image in real time. It only helps in selecting a design option for fonts so that they are distinguishable against a given background.

Please note: the command does not change the design settings - the image remains in the background only during the current session until the next shutdown.

background_image /path/filename

bootBoot your computer.boot
rebootTo restart a computer.reboot
Turn off computer.halt

Post-installation GRUB: setup and useful software

The main configuration file in GRUB2, unlike the previous version of Legacy, is not /boot/grub/menu.lst, and already /boot/grub/grub.cfg. However, there is no point in editing it directly - it will be generated with each saved change in the settings file /etc/default/grub and in the scripts directory /etc/grub.d.

IN /etc/default/grub Customization is mainly limited to changing the default boot item and/or menu display time:

  • The parameter responsible for the first point of change is GRUB_DEFAULT, the value of which indicates the number of the item in the boot menu. When selecting any other item, the user must know its order from the general list (to do this, you need to view the contents /boot/grub/grub.cfg and find by account the desired entry). At the same time, do not forget the numbering rules: the first item is assigned the value 0, the second - 1, the third - 2, and so on.
  • The parameter responsible for delaying the display of the boot menu is GRUB_TIMEOUT, whose assigned value in quotes denotes the number of seconds during which this splash screen will appear. There is one tricky feature in editing this parameter: by setting the value to "-1", the screen saver will hang exactly until the user selects an item.

A set of scripts in /etc/grub.d find everything on the computer installed systems and nuclei, forming boot menu in grub.cfg. Two main ones are responsible for searching for kernels and other operating systems: 10_linux and 30_os-prober. The 40_custom file allows you to modify GRUB by adding own points boot, which is useful for working with special types of system startup (note that any changes must end empty line, otherwise the last download item from all those proposed will simply not be displayed).

However, an even easier way to edit GRUB on an Ubuntu system is the Grub-Customizer utility. Thanks to its simplicity and intuitiveness clear interface, this is the best option for setting up the bootloader, most suitable for inexperienced beginners. To install, launch the terminal (Ctrl+Alt+T), then enter the following commands in it one by one:

Sudo add-apt-repository ppa:danielrichter2007/grub-customizer,

Sudo add-get update,

Sudo add-get install grub-customizer.

And although the translation of the Grub-Customizer program leaves much to be desired, it is very easy to understand:

  • List configuration- menu settings when loading the system. Here the order of its points is changed.
  • basic settings- selecting the system to boot by default, as well as determining the waiting time.
  • Appearance - editing the appearance of the boot menu.

In addition to all the variety of settings, the user should definitely pay attention to the well-proven software for working with GRUB, the configuration and diagnostics of which will become much more comfortable:

  • Super Grub Disk- simple and handy tool For quick recovery bootloader. At the same time, it can work not only with GRUB and LILO, but even with Windows itself. Runs from a CD, flash drive or floppy disk.
  • GParted- disk partition editor, launched directly from the CD. With its help, you can perform operations with partitions and file systems on them, such as: creating, deleting, resizing, checking, moving and copying.
  • SystemRescueCD - Linux distribution, specifically designed for disaster recovery.
  • TestDisk- a utility that allows you to diagnose and restore both individual partitions and boot disks entirely.

How does the bootloader handle Windows OS?

Directly, unfortunately, GRUB cannot in any way boot Windows x86 (the 64-bit version is also no exception), which is why it is necessary to create an appropriate launch chain mechanism. To do this in configuration file grub.cfg you need to add several lines of specific commands:

Title Windows,

Rootnoverify (hd*,*),

Chainloader +1,

Example and detailed description the latter was just given in the table console commands. Now the very practical case has come when it will come in handy at work. However, before it there are a couple more equally important for Windows boot lines:

  • rootnoverify (hd*,*)- the same analogue set root. It informs GRUB about the location of the partition on which the next part of the boot code is located, but does not mount it (for the obvious reason that GRUB cannot do this). Please note once again that part (hd*,*)- this is the disk number and partition number, respectively, on which Windows is installed.
  • makeactive- the command gives the specified root partition boot status.

Now the same team chainloader +1, which transfers all further boot control directly to the Windows boot loader.

Finally, the final boot command starts the boot, after which you can safely work in the selected operating system.

It also happens that not one, but two or even more versions of Windows are installed on the hard drive. And then carry out a stable launch without additional commands hide/show ( hide/unhide) sections is simply unrealistic. The bottom line is that if the GRUB configuration file specifies the hiding of any partition of the drive, then Windows simply will not be able to read it. And if the partition is visible, then it will be possible to boot from it.

If you have multiple operating systems, first decide which instance you want to boot, then check its exact location - you need to know on which partition of the hard drive it is installed. For example, there are two different Windows versions, located respectively on the first and second partitions of one drive, and the user needs to load the second one. To do this, you need to make the following changes to the menu.lst file:

Title Windows,

Unhide (hd0,1),

Rootnoverify(hd0,1),

Chainloader +1,

Commands have been added compared to the previous code sample hide And unhide, thanks to which the user can boot the desired operating system from a given hard drive partition.

Reinstalling GRUB in case of critical problems

Even in case of technical problems, restoring GRUB is a completely simple task. First, download the installation LiveCD, open the terminal using the keyboard shortcut CTRL+ALT+T.

After this, enter the commands one by one:

  • sudo grub-install /dev/sda - install GRUB directly into the MBR (sda is the boot disk);
  • sudo update-grub - search for others boot records on your hard drive (for example, Windows).

Now all that remains is to restart the computer and make sure that the reinstalled bootloader is fully functional.

Question about reboot loop protection

The need for such a protection system integrated into the GRUB boot loader appears when the size of the logs located in the /var/log directory grows to unacceptable volumes due to uncontrolled recording of information in them. In a normally operating system there are special services, archiving and cleaning these logs automatically. Thus, in most cases, the user absolutely does not need to spend time controlling their volume.

However, these same services start only after the operating system boots. Before this, the size of the log files is absolutely not monitored by anything, which is why in the event of an unexpected system crash and further reboots, the logs will only grow in volume. And this uncontrolled growth will continue exactly as long as the reboots last due to a failure in the system. Subsequently, all this can lead to complete filling of the partition on which the /var/log directory is located, which can lead to the system freezing and making it impossible to even start recovery mode.

It is from this catastrophic situation that the protection system integrated into GRUB saves cyclical reboots, output "stuck" GRUB menu, awaiting explicit user intervention. The protection itself is based on the value of the recordfail variable specified in the /boot/grub/grub.cfg script. During each boot it is installed as recordfail=1, and at the final boot stage it is reset to recordfail=0. And if just such a reset did not happen, then automatic download the same GRUB protection is completely prevented and activated.

To do this, in /etc/defaul/grub we find the variable GRUB_RECORDFAIL_TIMEOUT and assign it a value of the number of seconds during which the GRUB menu will wait for user intervention if recordfail is not reset from 1 to 0. After which we save the changes with the command sudo update-grub, thereby disabling protection against loopy reboots.

Who might benefit from this? Only for stations and servers that do not have a keyboard for input/output of information. Without it, in case similar problems, loading the system is generally impossible. Cases of boot loops are not that common and mostly occur due to either power issues or software glitches.

Uninstalling GRUB and returning to Windows: fast, easy and painless

If the question arises “How to remove GRUB and leave the bootloader of another operating system?”, then first of all the user will need its installation disk/flash drive. Let's look at everything in concrete terms simple example: user deletes from his Linux computer, leaving in the end only Windows, but at the same time cannot load it due to an error Grub error. For complete solution problems, you need to restore the Windows x86/64 bit bootloader:

  1. We boot from the installation drive, having previously set it to first priority when loading into the BIOS
  2. Booting from installation media, select the system recovery partition.
  3. From the list of tools that appears, select the command line, in which we write the following commands one by one:
  • BOOTREC.EXE /FixBoot.
  • BOOTREC.EXE /FixMbr.

Since GRUB can be removed in a few steps, after all successful operations we reboot the computer and work without any problems in the Windows system.

After several unsuccessful attempts dual boot Ubuntu 15.04 and Windows 10 on one hard drive and on a computer with UEFI firmware, and not knowing what caused the first unsuccessful attempt, I decided that subsequent unsuccessful attempts must have happened due to the existing Ubuntu GRUB in the Boot EFI folder.

Moreover, the device always freezes when the installer tries to install GRUB

So I thought that if I could just delete the ubuntu folder from the Boot EFI folder then the installation would complete successfully. Ultimately it didn't happen, but I did figure out how to remove GRUB files from Windows 10 from the command line.

This topic describes how this was done. It included listing and selecting detected ones from the command line hard drives, listing the partitions on the hard drive, and then finally listing and deleting target folder. Another reason you might want to do this is to remove Linux partitions, which will not lead to automatic deletion GRUB files from the Boot EFI folder.

So start answering the question ““.

To get started, log into Windows 10, click the Command Prompt menu, PowerShell, or click the search box and type cmd. Then right-click on the Terminal application icon and select Run as administrator. Figure 1 shows the commands (underlined) used to complete the first step—enumerate and choice of hard disk. To make copy and paste possible for those who may need it, I have provided the commands in the code block after the last image.

In this figure the target disk is shown as HDD 465 GB capacity with GPT partition

Picture 1: Using diskpart for a list of hard drives detected in Windows 10

After selection target disk its partitions will be listed so that the partition (volume) corresponding to the Boot EFI folder can be identified. In Figure 2, this partition is volume 2. Typically this is the only volume with FAT32 in the Fs column ( file system) and System in the Info column. Once it has been identified and selected, you assign it a drive letter to make things easier. In this example, I have assigned it the drive letter D. After that, exit diskpart.


Figure 2: List of disk partitions in Windows 10

The final task is to navigate to the Boot EFI folder and specify its contents to determine which subfolder the GRUB files will be. It will be located in the EFI folder. GRUB files for the installed distribution will be located in a folder with the same name as the distribution. For example, if Ubuntu was installed, as in this example, the folder name would be ubuntu. Delete the folder using rmdir command/s. This is the Windows 10 equivalent of the Unix/Linux command rm -r.

Figure 3: Removing a non-empty Ubuntu GRUB directory on Windows 10

All commands used are listed in this code block.


Translation made from the site linuxbsdos.

You might also be wondering how to refresh your Ubuntu system and shell.

Please note that this procedure is not necessarily the best or only way to do this, so if you are aware of best method, post a comment on our website. I will definitely add to the article if your option turns out to be more convenient.

If you have questions on the topic “How to remove the Grub bootloader,” then write them also in the comment form on our website. Thank you for your visit!

If you find an error, please highlight a piece of text and click Ctrl+Enter.