mbr-winlock virus: quick removal and restoration of access to the computer. How to remove all partitions on a hard disk if some of them are protected from deletion How to remove mvr partitions from a disk

If we want to get rid of the current structure of the hard disk - remove all partitions on it and return it to its original unallocated space, we can do this in an active Windows environment using its standard tools, subject to two conditions. Firstly, as an operated disk - the one on which we want to remove all partitions, of course, the storage of the current OS should not act.


The storage refers to either all partitions of the system, or at least one of them, for example, bootable. Secondly, there should be no deletion-protected partitions on such an operable disk. If the previously operated disk had a layout style MBR, using the utility included in Windows, we will easily delete all user and system partitions.

And we will turn the disk space into unallocated space, on the basis of which we can create a new partition structure for other tasks.

And here is the space GPT-drives on which Windows was previously installed, so we will not be able to clean it completely. For hidden system EFI-partition, neither the delete function nor any other options will be available.

Even if you get rid of all other partitions, EFI section will remain.

Like the last one, on carriers OEM-devices may also have non-removable service Recovery-partitions needed to roll back Windows to factory settings.

How to clear a hard disk with protected partitions from the structure - delete all partitions, remove the markup style so that it becomes the same as before initialization? Let's consider several options for how this can be done.

1. Command line

A regular Windows tool can clean up data carriers from their structure - command line. Important nuance: it must be run as administrator.

In its window, enter sequentially:

diskpart list disk

Here, instead of zero, everyone must substitute their serial number.

The last step is to enter the command to clear the media from the structure:

clean

Everything - the disk is cleared of partitions and initialization. After that, we can again turn to the utility to form a new structure.

Choose GPT- or MBR- markup style.

2. Windows installation process

The Windows installation process can delete hidden disk partitions. If the installation media of the system is connected to the computer, you can boot from it and remove partitions at the stage of choosing the installation location. And then stop the installation and restart your computer.

True, this option is only suitable for users who know the disk being operated on well. Since the installation process displays the disk space as a list of partitions, there is a high possibility of erroneously corrupting the structure of a non-operable media.

Command-line haters can resort to third-party software to work with disk space like Acronis Disk Director 12. This is a more functional, more usable and even, in some sense, a safer way to carry out operations with the markup of data carriers.

3. Acronis Disk Director 12

And a disk manager from the company Acronis , and its analogues are notable for their clear and understandable presentation of the disc structure. Moreover, such programs Live Disk- this is the only way to solve the problem posed in the article, if the operating medium is the only one in the computer. To use Acronis Disk Director 12 get rid of the disk structure, select it, for example, in the visual representation.

And let's use the function.

Acronis warns us that there are boot partitions on the media being cleared. And thus protects us from rash decisions. The fact is that two Windows installed on different disks can have both their own bootloaders and one common one. It is important to check this point: the abandoned Windows should have its own boot partitions:

OrSystem Reserved (MBR);
Or"Restore" and "EFI" (GPT).

Consideration of the error "the selected disk contains an MBR partition table", identifying ways to eliminate it, and also a description of the solution to the problem regarding disabling the Secure Boot property. The selected disk contains an MBR partition table, which means that Windows is installed on this PC.

This problem occurs when you upgrade your operating system from Windows 7, XP, Vista to a later version using a storage device that HDD remains in the old conversion - MBR.

And Windows 10 and 8 support the GPT orientation of the hard drive, because they are the EFI (Extensible Firmware Interface), or UEFI system, which replaced the BIOS as a more advanced base operating system.

Of course, this innovation is countered by arguments regarding the inability to work with devices that support the BIOS configuration, older models of computers that are still in use, and so on.

However, it's easy to get out of the situation when the old MBR disk format stands in the way of installing the desired Windows number. That is, the way to solve the problem:

  • converting the hard disk to GPT (then the MBR is fully formatted);
  • changing the base operating system to BIOS (then EFI, or UEFI, ceases to operate, and related innovations).

Nevertheless, despite some resistance towards the new base OS (respectively, the GPT format of the disk), it is the conversion of disks or the sale of those with the original GPT that are gaining momentum.

How to resolve the error

Read also: TOP 6 Ways to Completely Clean Hard Disk "C" Junk Files on Windows 7/10

If the disk has an mbr partition table, you can convert it to GPT, after which the information will be completely erased from it, despite the fact that the hard drive consists of several parts.

To do this, you only need a program that installs Windows.

Sometimes the option of making changes to the base OS is used, that is, changing it to the BIOS. But such a path will require additionally: a third-party free program, an entry in the storage device of this program.

How to Convert Hard Drive to GPT

Read also:

To open a line for entering commands, you must use the simultaneous pressing of Shift and F10 (this manipulation is only suitable for OS 10 and 8 on a PC). On a laptop, an additional Fn button may work in addition to the above combination.

It is important to type the command, and then press enter after it:

  • diskpart;
  • list disk (when these two words are entered, it is better to note the number of the disk that you are going to install; it is indicated here by H);
  • select disk H;
  • clean;
  • convert gpt.

Upon completion of the process, you must open again the line for entering commands and select the update in the window where the sections are selected.

After that, an empty space is selected, installation continues. By the way, before that, you can apply the creation point in order to distribute the disk into parts.

Tip: if suddenly the disk is not on the list, you can reboot the personal computer from the flash drive (which is bootable) with the OS and complete the installation.

How to convert a disk to GPT while keeping the information

Read also: We create our own bootable USB flash drive with utilities for Windows (7/8/10)

If the selected partition contains an mbr partition table, you need to convert the disk, and data loss is undesirable, there is a way out.

After that (it is assumed that we are loading the basic EFI operating system), you can overwrite what is in the image to a flash drive.

But before that, you need to format it in FAT32 so that it is bootable. And in the BIOS, the Secure Boot parameter must be deactivated.

After completing the boot process from the storage device, you need to start the program by selecting the appropriate button. When will it launch:

1 Select a disk that is doomed to be converted. Please note that this is nothing else, just a disk.

2 In the column on the left, you need to select the position corresponding to the purpose. conversions

3 Then you need to select Apply, agree with the warning in the window that appears. Then it remains only to wait for a time proportional to the size of the disk. That is, in the case of its small size, the duration will not be delayed. But when his memory is very full, there are many small components or, conversely, several very large ones, then you will have to be patient.

It happens that during the selection of a convertible disk, the computer starts to protest. That is, it gives an error and gives arguments that the disk is a system one and it will not work to complete the user's idea.

Then you can do the following:

1 Find in early stages disk loader Windows, allocate it (as a rule, it takes up to five hundred megabytes).

2 Find the top line in the menu and click Delete. Then apply the process by clicking Apply. It is recommended to use the freed space for the bootloader, which will be in FAT32 (file system).

After the above manipulations, you can close the program and install Windows according to the plan.

Changing the underlying operating system as a solution to the problem with MBR partitions

Read also: How to save passwords when reinstalling the system: Methods of 2019

As described earlier, there are two options for solving the problem with an error about MBR partitions.

The first was to change the format of the hard drive, that is, this MBR should change to GPT, which fully meets the requirements of the basic EFI OS that new Windows systems work with.

But the option of changing not the disk format, but the base OS, that is, from EFI to BIOS, is also available.

Many experts believe that this idea does not meet the current realities, where it is difficult to pull out on a rather primitive OS (compared to the new version).

They think that computers are being filled with more and more information, programs, and so on. And with the BIOS policy, the PC will not perform its functions, which will eventually lead to great inconvenience in operation.

But, perhaps, just such a scheme will suit someone more, if only because the PC itself is from older models, and it would be difficult for him to pull such innovations.

When booting a PC with the participation of the flash drive that is the installation one, it is important to use the Boot Menu. In this case, it must be taken into account that you need exactly the button that leads to the use of a storage device without a UEFI (EFI) icon. This will start the computer in Legacy order.

By the way, in the BIOS settings of the storage device, you can also configure settings with or without EFI using UEFI.

Moreover, the EFI parameters quite allow you to deactivate the boot function using UEFI, and then install Legacy or Compatibility Support Mode.

This option is also suitable when using a storage device that is inserted into the drive.

It should be noted that, at times, this option may fail, an error, but to fix this, it is enough to change the settings in the BIOS to deactivate Secure Boot, sometimes it is worth checking the OS setting, it should not be Windows.

Guide to disable Secure Boot

Read also: Windows Installer Package Error: Causes and Solutions in 2019

This is not a setting that belongs to any version of Windows, but rather a property of the operating system. It controls the absence of extraneous programs and systems when starting the computer.

That is, in general, this is a necessary detail, but sometimes it gets in the way. And the case of the impossibility of installing another OS may be precisely because of the Secure Boot property. What you need to know to deactivate it:

In order to configure the operating system correctly, you need to get into the appropriate window.

So, in Windows 8, you can simply go to changing the settings through the left panel and find the PC settings (UEFI) in the advanced options.

Each Windows OS number has an individual path to these properties.

There is also a more universal way: in the process, when the PC turns on, simultaneously use the "delete" and F2 keys. Keep in mind that Notebook may respond to the combination of Fn and F2 .

Disabling Asus hardware from Secure Boot

Read also: How to change the Windows network type: Instructions for all versions (7/8/10)

To disable laptops or motherboards under this name, you need to go to the EFI settings, where the boot tab will lead to a secure boot, and there you already need to select “other OS” (other OS) in the “OS type” (type OS). F10 will help to fix the settings.

It should be noted that in certain cases with Asus, you should find a security or tab bot, there you can already configure Security Boot.

I want to go back to a normal MBR. I found some tips here and did:

Parted /dev/sda mklabel msdos quit

But when I get to the mklabel option it spits out a warning that I will lose all data on /dev/sda . Is there a way to get back a normal MBR without formatting the drive?

5 Solutions collect form web for “Remove GPT - default back to MBR”

However, according to the man page, gdisk , which is used to convert MBR -> GPT, also has an option in the "recovery and convert" menu to convert GPT -> MBR; g key:

Convert GPT to MBR and exit. This option converts as many partitions as possible to MBR form, destroys the GPT data structures, saves the new MBR, and exits. Use this option if you have tried GPT and found that MBR works best for you. Note that this feature generates up to four MBR primary partitions or three primary partitions and as many logical partitions as can be generated. Each logical partition needs at least one unallocated block immediately before its first block.

I would try this first.

Most of the previous respondents are correct when they say you can usually do what you want with a GPT partition table layout, but since there are good reasons for using MBR I think I'll just answer your question instead of assuming that you are wrong to ask.

To get rid of GPT, you need to remember that in this format in end the disk has a partition table written to it, where it will stay if you just try to remove it with fdisk or a non-GPT file system tool. What you did with partitioned didn't access that partition table.

To remove GPT you need to use something like gdisk. Enter gdisk as root at the prompt, and then tell gdisk which device you want to watch on (e.g. /dev/sd??). Use gdisk to write the protective MBR to disk to make sure you have access to some MBR data structure. You can then go to the expert options section (click "in different program prompts" to view the options available to you in different time) and look for the "Zap (destroy) GPT data structures and exit" option. The program will ask for confirmation and then ask you if you want to keep the MBR structure. Save it.

After that, it should be as simple as rebooting your computer (because the kernel will still use the old partition table and it will need a reboot to update) and then running fdisk and deleting the rest of the GPT partition. You will still see the same warning about using GNU Parted that you saw before, but this time you can ignore it, as it will disappear when you delete the partition.

This will give you an MBR partition table on an empty drive that you can reinstall the OS to. If you're trying to do this with existing partitions, it's a little more difficult, and in some cases even impossible, so I would recommend that you just back up your data and do it that way.

This must work in most cases. You know that you can't use MBR if you have partitions larger than 2TB or more than 15 partitions.

  • Use separately to check partition sizes (i.e. parted /dev/sdX p Anything less than 2 TB?), parted /dev/sdX p
  • If there are large partitions, shrink the file system and whatever else needs to be done. (More on this at the end of this post.)
  • Dump all exact partition sizes, parted /dev/sdX u B p (parted /dev/sdX u B p sizes in bytes), so you know how you can eventually recreate the layout of the partition. Use your phone to take a picture from both parted outlets.
  • Remember that you only have four main partitions with MBR due to its internal structure. So if you have more partitions you need some free space somewhere on your drive (of which you need to know where it might be!) to create a logical partition where the VBR can be placed so you can "allocate" another th / 5th partition that previously existed.
  • Use gdisk to gdisk GPT.
  • Create a new MBR.
  • Restore partitions, 1st/2nd/3rd as primary partitions, then in some free space (WHERE NO DATA IS LOCATED!) Create a logical partition, then create the rest.
  • Save, exit.
  • Pray.
  • Reboot.

For all this you have to use liveisk as grml. If you did something wrong, reboot and try again.

As long as you don't write any data to disk, nothing is lost. Remember that you still have your partition layout on your phone, so you can recreate the original GPT if you really need to.

In case you really fucked something and didn't take pictures, try testdisk for partition boundary detection. But don't make any money on it once your layout is anything out of the ordinary.

Based on resizing material for smaller partitions, bird perspectives:

  • You always need to compress the file system first. Easy for ext4 (resize2fs -M dev/sdX) but impossible for XFS because it can't be compressed. Know what you are using and google before trying this kind of tricks.
  • If you have LVM, shrink the logical volume. (lvreduce -L 20G /dev/mapper/ -)
  • LVM's next step reduces the physical volume. pvresize --setphysicalvolumesize 25G /dev/sdX is the way to go.
  • After that use the partition tool of choice, delete the partition your lvm is on and re-create it.

The dimensions for all the items mentioned here are similar to: File system

To be able to do all this if you have PARTITION + LUKS + LVM + FILESYSTEM, here are some tips on how to do it from the shell:

  • df -h is your friend showing filesystem size when mounting partition
  • lsblk and lsblk -f are your friends for displaying partitions
  • If you are using LUKS, open the crypto container via cryptsetup open /dev/sdX asdf , enter your password and it will become available unter /dev/mapper/asdf . Crypto containers do not need to be resized. (Skip this if you don't have an encrypted partition, of course.)
  • vgchange -aay to activate all logical volumes so you can work with them.
  • mkdir asdf; mount /dev/mapper -asdf mkdir asdf; mount /dev/mapper -asdf and then df -h to check the size of your filesystem before resizing.
  • umount asdf so that it will unmount again.
  • resize2fs -M /dev/mapper/ - .
  • mount /dev/mapper/ -asdf; df -h mount /dev/mapper/ -asdf; df -h to check how big your file system is.
  • Make LV 1GB bigger than the file system. Most likely, this will not be enough. Do it even more if it can be done otherwise linux will tell you after reboot that it won't work. DONT does a FS check when prompted, reloads into liveisk and restarts, no data is lost if this is the case.
  • Make PV 1GB bigger than LV.
  • Make the 1GB partition larger than the PV. 100M should be enough too, since LVM creates 4M extents (it's somewhat like hard disk blocks, but for LVM), and you want it to not skip the last degree, making the partition too small. But like I said must. Don't calculate everything, just adjust things and fix them if they break. It's still linux, let's do it.

Make things bigger than they need to be so you don't have to reboot as often.

To easily distinguish what's with LVM, always use your hostname as the name for the VG and mountpoint (root , swap , var , ...) for the LV when creating your LVM installation, if you haven't already. This is a general hint, not something you need to do for any of the above steps.

GParted did the job for me (tested on Kali Linux USB Live v2.1) by simply doing:

Device --> Create Partition Tablet --> Type MSDOS

First remove all partitions.

Use gdisk /dev/sda

Note:/dev/sda refers to the person who asked this question but changed it to your drive name.

Once you are using gdisk use:

X extra functionality (experts only)

then when you type p to see all the options, you'll see this:

Expert command (? for help): ? a set attributes c change partition GUID d display the sector alignment value e relocate backup data structures to the end of the disk g change disk GUID h recompute CHS values ​​in protective/hybrid MBR i show detailed information on a partition l set the sector alignment value m return to main menu n create a new protective MBR o print protective MBR data p print the partition table q quit without saving changes r recovery and transformation options (experts only) s resize partition table t transpose two partition table entries u Replicate partition table on new device v verify disk w write table to disk and exit z zap (destroy) GPT data structures and exit ? print this menu

Use z

Expert command (? for help): z About to wipe out GPT on /dev/xvdf. Proceed? (Y/N): Y GPT data structures destroyed! You may now partition the disk using fdisk or other utilities. Blank out MBR? (Y/N): Y

Subscribe:

Very often, users have a problem 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 provide new technologies.

Let's try to figure out how it is possible to fix such a nuisance and bring the installation of Windows 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 the cause of the error in question. In general, the reason for this may be the only 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 has the MBR style, not GPT. Most often this happens if up to this point the computer was using Windows XP or 7.

Two fundamentally different approaches can be used to solve the problem:

1. Make the transition from MBR partition style to GPT

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

Let's consider in more detail each of the ways to solve the problem.

Change MBR disk to GPT style

To perform an operation to change the style of an MBR disk to GPT, call the console and use the service commands to perform this procedure, however, it involves deleting all information on the hard drive. This makes it difficult to transfer important data, but this method is more correct.

1. To convert using the console, at the stage of an error, click Shift+F10. In the window that appears, type the following commands in sequence:

  • Diskpart (calling 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 is displayed opposite the disk on which you plan to install);
  • select disk N (instead of the N character, 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 (create a partition);
  • assign (direct connection to the system);
  • exit (exit from the "master" of this procedure).

After the above steps, the Windows installation process will continue as usual. Only sometimes there are times 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 this method is less acceptable in the opinion of experts.

Solve the problem without converting MBR disk to GPT

This method, speaking in a normal language, does not mean changing the style of the partition, but changing the boot method (from EFI to Legacy). This procedure can be done 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 when setting the boot priority of a particular device. In the UEFI settings, you can change the EFI settings to Legacy (performed in a tab that contains devices boot priority items, etc.).

Important, whichever method you take, be sure to set the BIOS to “Off” on the Secure Boot item.

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