Remove GPT - default to MBR. How to remove the MBR banner in the boot sector of the disk before Windows boots (MBRLock) How to erase the boot record from the disk

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 created a bootable Linux USB 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 the advantages of UEFI on MBR is that 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. This is a bit of a complicated process, but we'll break it down anyway.

Right-click in the lower left corner of the screen and select from the context menu that opens Command line as 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; it is hidden for a normal system, 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

Flash drives typically use the MBR partition table. To remove the Grub bootloader from a flash drive, it is not enough to simply format it. The bootloader is written to the MBR table, so 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 on a 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 we will completely delete the existing partition table:

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

Now, using the same Gparted, we create a new partition table:

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.

How to remove a banner blocking your computer

IN Lately A new type of banners have become widespread, which are written to the boot sector of the disk (MBR) and block the computer even before Windows boots. This is the so-called MBR.Lock (MBR-lock).

They all look equally primitive, since they are executed in text mode when the computer starts. Usually this is red text on a black background, which in general is nothing new, with a requirement to pay a fine for viewing gay porn, child porn and video materials containing violence. In RuNet, MBR locks are being distributed with the requirement to pay a fine to the subscriber's MTS or BEELINE account, in Ukraine and Belarus to the WebMoney electronic wallet (WebMoney)

The MBR.Lock banner appears immediately after turning on the computer before selecting the OS

Naturally, you don’t need to pay anyone - it won’t help. After all, the payment terminal mobile phone It just can't print any unlock code. Looking for an unlock code is also pointless. Often there are simply no codes to unlock banners.

In this article, we will look at methods to combat the MBR.Lock Trojan for Windows XP and Windows 7.

Removing a banner in the boot sector of Windows XP through the recovery console

Not everything is as scary as it seems. In fact, removing the MBR.lock banner is much easier than in the case of the desktop banner. You need to perform MBR (Master Boot Record) repair.

2) Set the BIOS to boot from a disk or flash drive (depending on what you recorded). Loading up. In the ERD Commander version selection menu, select version 6.5 for Windows 7.

The download will begin. For some time there may just be a black screen and the feeling that the computer has frozen. This is wrong. The image is simply loaded into RAM first and nothing is displayed on the screen.

3) Once the download is complete, you will be prompted to connect to the network in the background. We refuse.

4) Click Yes to the question about reassigning drive letters.

5) Select the keyboard layout.

7) In the menu that appears, select Command line

A command prompt window will appear. Enter the command bootrec.exe /fixmbr and press Enter.

Recovering Windows 7 MBR using ERD Commander

8) Close command line and restart the computer in normal mode. The MBRlock Trojan has been neutralized

Subscribe:

Very often, users have problems installing Windows 10 or 8 at the stage of working with partitions due to the fact that the partition style is made using MBR tables, which is completely unsuitable for new operating systems, because they contain new technologies.

Let's try to figure out how to fix this problem and bring the Windows installation to its logical conclusion.

What to do if Windows installation is not possible due to partition style - MBR tables

For reference. First of all, you need to figure out what could be causing the error in question. In general, the reason for this may be a single factor: the installation flash drive or disk with Windows OS is made in EFI mode (typical for the tenth and eighth versions), but the necessary partition for installing the system is MBR style, not GPT. Most often this happens if up to this point the computer was using Windows XP or 7.

To solve the problem, you can use two fundamentally different approaches:

1. Make the transition from MBR to GPT partition style

2. Leave the current style and change the BIOS (UEFI) value from EFI to Legacy in the boot priority menu.

Let's take a closer look at each of the ways to solve the problem.

Change MBR disk to GPT style

To carry out the operation to change the MBR disk style to GPT, call the console and use service commands to complete this procedure, however, it involves deleting all information located on the hard drive. This creates difficulties in transferring important data, but this method is more correct.

1. To perform the conversion using the console, at the stage of the error, click Shift+F10. In the window that appears, type the following commands sequentially:

  • Diskpart (call a procedure that should remake a specific disk);
  • list disk (after this operation, all available disks for installing the OS will be displayed on the screen. Be sure to remember the number that appears next to the disk on which you plan to install);
  • select disk N (instead of the N symbol, use the number that marked the disk in the previous step);
  • clean (this stage cleans the selected disk, that is, deletes all data);
  • convert gpt (direct conversion);
  • create partition primary (partition creation);
  • assign (direct connection to the system);
  • exit (exit the “master” of this procedure).

After these steps have been completed, the Windows installation process will continue as usual. Only sometimes there are cases when a reboot is required to fully install the OS.

If you want to convert an MBR disk to GPT without losing all the information, you need to use one of the special programs, but in the opinion of experts this method is less acceptable.

Solve the problem without converting MBR disk to GPT

This method, in normal language, does not imply changing the partition style, but changing the boot method (from EFI to Legacy). This procedure can be performed in the following ways:

When selecting the device you want to boot from, find and select Boot from removable media, but without the EFI pointer.

You can achieve the desired result in the BIOS by setting the boot priority of a particular device. In the UEFI settings, you can change the EFI parameters to Legacy (this is done in the tab that contains device boot priority items, etc.).

Important, no matter which method you choose, be sure to set the Secure Boot item to “Off” in the BIOS.

Both options have a right to life, but based on personal observations of IT specialists, it is best to use conversion using service commands (with complete deletion of all information in the section).

The situation is as follows. There is a 160GB screw. It has 2 partitions - 40GB and 120GB. In order to install Ubuntu as a second system, a breakdown of 120GB -> 100+10+2+8 was made.
Results
1. When the system boots, the message MBR helper not found is displayed;
2. fdisk shows one large 160GB disk.

The fool understands that this is the beginning of a fun night.
Further, under the cut, solutions to the issue.

1. Partition table recovery

1.1. Parted magic
This LiveCD\USB distribution kit, 100 MB in size, contains a huge bunch of software for working with disks. From breakdown to restoration.
Of all of them, we will need gpart, testdisk, fdisk And ms-sys.
1.2. Gpart
gpart is a utility that scans a disk sector by sector for partitions that are present on the media but not in the table. In its work, it ignores the already existing table (if present). The program was developed by the German programmer Michail Brzitwa and is no longer supported by him. Slow development is carried out by the Fedora and Debian teams. Current version is 0.1h.

The utility allows you to quickly and easily restore the partition table, but it has several disadvantages. Firstly, the development was abandoned a long time ago, and secondly, it sometimes does not quite correctly define sections.

Gpart can work in 2 modes. This is a quick analysis and detailed scan. In some cases, the first mode is sufficient. We will look at the second one.

Gpart -if /dev/sda

-i- interactive mode. For each part found, a question will be asked whether to save it or skip it.
-f- full disk scan.

After quite some time, a report will be created with possible sections. This is what you need to look through as carefully as possible before recording.
Sample report (not mine):

Begin scan...
Possible partition(DOS FAT), size(1907mb), offset(0mb)
Possible partition(SGI XFS filesystem), size(5730mb), offset(1907mb)
End scan.
Checking partitions...
Partition(DOS or Windows 95 with 32 bit FAT, LBA): primary
Partition(Linux ext2 filesystem): primary
Ok.
Guessed primary partition table:
Primary partition(1)
type: 012(0x0C)(DOS or Windows 95 with 32 bit FAT, LBA)
size: 1907mb #s(3906544) s(16-3906559)
chs: (0/1/1)-(1023/19/16)d (0/1/1)-(12207/19/16)r
Primary partition(2)
type: 131(0x83)(Linux ext2 filesystem)
size: 5730mb #s(11736000) s(3906560-15642559)
chs: (1023/19/16)-(1023/19/16)d (12208/0/1)-(48882/19/16)r
Primary partition(3)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)

Primary partition(4)
type: 000(0x00)(unused)
size: 0mb #s(0) s(0-0)
chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

If everything is OK, then we agree to write to the partition table, cross our fingers and reboot.
In my case, the program identified the partitions that were there before the partition (40 and 120), which was not suitable and forced me to look for alternative recovery methods.

1.3. testdisk
Note: this utility is described in more detail in this post, I will not repeat it here.

This utility is similar to the previous one, but has a number of advantages:
1. more recent and actively supported;
2. subjective, it works much faster;
3. more functional;
4. there is a simple console interface based on ncurses.

Go!
1. in the first window, select Create a new log file;
2. select the desired disk (/dev/sda) -> Proceed;
3. mark the partition type as Intel;
4. select Analyze current partition structure and search for lost partitions;
5. if the found partitions are correct, click Backup and go to step 6, it is possible to quickly rescan the disk if there is an error somewhere (Quick search);
6. A green list with sections is already visible here. If ok, then write it down, otherwise run Deep search.;

In my case, the result was similar to the result of gpart, which is incorrect.
Having launched Deep search, after waiting about 40 minutes, I received an answer that made my soul feel so much better.
Several partitions were found that overlapped one another (these were the original (before manipulation) 120GB and the new one, 100GB). Having marked the unnecessary one as deleted, I wrote the table to disk and rebooted. Fortunately, everything worked out and the computer returned to its original state, and I could clear conscience Go to bed.

3. MBR recovery

For this task, we have the ms-sys tool in our arsenal.
First, let's find out what's wrong with our MBR.

Ms-sys /dev/sda
/dev/sda has an x86 boot sector
it is unknown boot sector

Now you can see that this disk does not have a boot sector.
The utility can work with the MBR of various operating systems. The list can be obtained by running the program without arguments. In my case, it was needed from Windows 7.
Write MBR to disk:

Ms-sys -7 /dev/sda
Windows 7 master boot record successfully written to /dev/sda

We check:

Ms-sys /dev/sda
it is Microsof 7 master boot record, like the one this
program creates with the switch -7 on a hard disk device.

That's all, the required MBR is installed and you can reboot.

3. Outro

This post is an example of how you can create a problem for yourself out of nowhere and spend half the night doing the wrong thing. But it gave invaluable experience, which I tried to present here.
Perhaps it will be useful to someone. After all, it’s not very difficult to get into such a situation, but there isn’t really a detailed manual.


Description of the problem:
Immediately after turning on the computer's power, the verification procedure begins POST (Power On Self Test). Procedure POST reads from hard drive master boot record ( MBR - Master Boot Record) and writes it into the computer's RAM. The Master Boot Record contains the boot program and a partition table that describes all the partitions on the hard drive. Boot viruses, when infected, replace the master boot record, after which the computer boots as usual, but the virus is already in memory and can control the operation of all programs and drivers. After this, every time the computer boots, the virus gains control and places itself resident in memory.

Solutions to the problem: If the antivirus cannot remove the virus from MBR sectors, then to solve the problem you can use Windows tools, namely system recovery. Using System Restore, you can overwrite the master boot record of the boot partition, and thus remove the virus. To work you will need a Windows boot disk.

To start system recovery, you need to start the computer from a boot disk. To boot from a boot disk, you need to turn on the computer and press the Delete button to enter the BIOS settings, Set to boot from CD-ROM. Insert the boot disk with the Windows installation package and reboot the computer. When the Windows installer loads its files into the PC’s RAM, the dialog window Windows installation, which contains a selection menu from which you can select *To restore Windows using the Recovery Console, click .

A key must be pressed R. The Recovery Console will load. If the PC has one OS installed and it is (by default) installed on disk C:,

then the following message will appear:

Which copy of Windows should I sign in to?

Need to enter 1 , press Enter and enter the administrator password. The system prompt appears, enter fixmbr.

A message appears:

**WARNING**

This computer has a non-standard or invalid Master Boot Record. Using FIXMBR may damage your existing partition table. This will result in loss of access to all partitions of the current hard drive.

Did you like the article? Share with friends: