View Full Version : removing both Fedora and Windows 7 from hard drive

28th September 2017, 01:59 AM
Hi, at the moment i have a double boot Windows 7 and Fedora 26 via GRUB(2) menu. when i was in Windows 7 (diskmgt.msc in command line) i noticed that i have 100 Mb of EFI system virtual disk. also, when i was in BIOS in Startup->Boot order, i noticed that there is a virtual disk Fedora, that appeared after the installation of Fedora Linux.
i would like to delete both Fedora 26 and Windows 7 completely, and to make new reinstallation. my questions - 1) how i can delete both Fedora and Windows 7 ? 2) how i can delete EFI system disk that was installed during Fedora installation ? 3) how i can delete GRUB(2) (menu) ? 4) how i can delete Fedora virtual disk from BIOS menu (Boot order) ?
i tried to use Windows 7 installation disk, went to the repair mode and used the command line and issued the commands both "bootrec /fixmbr", and "bootrec /fixboot", but it did not help - GRUB menu, EFI virtual disk (that i can see in Windows disk management utility), and Fedora virtual disk (that i can see in BIOS) are remained. i would appreciate help in the Forum. Thanks.

28th September 2017, 01:35 PM
There are lots of ways to clear the hard drive. One way is to boot up a live disk or a rescue disk and fill the hard drive with zeros:
For the mbr, something like:

dd if=/dev/zero of=/dev/sda bs=1 count=512

For the rest of the disk something like:

dd if=/dev/zero of=/dev/sda bs=1M

where sda is the first hard drive on your system.

28th September 2017, 01:50 PM
Or, you may want to use the installation media for whatever you are going to install to reformat and repartition the hard drive.

Additional comments:

I would be very cautious about removing or reformatting the EFI partition. Maybe it is OK, and I know there are utilities for creating an EFI partition.
But there is firmware to consider also, and if the wiping of the whole drive results in a "difference of opinion" between the firmware and the EFI
partition, you may end up with a "brick".

28th September 2017, 02:59 PM
Do an Internet search on "brick firmware uefi".

Additional comments:

You can use the Fedora tool "efibootmgr" to remove Fedora from the efi boot list. From the efibootmgr man page:

This application can create and destroy boot entries, change the boot order, change the next running boot option, and more.

29th September 2017, 04:34 AM
What I have found with installing on a clean hard drive is that I needed to use the function key indicated on the first screen from the "BIOS" which showed all the boot options. I've forgotten which function key it is on this computer, but it's clearly indicated on that first screen. With the installation media in place, a dvd in the dvd-drive in my case, after hitting that function key the boot options appear with one of them being for an EFI installation. When choosing that option, the installation proceeds to create an EFI installation. I use custom partitioning to partition the drive, create an EFI partition, and the rest follows cordially to install the distribution without problems.

As I understand it, the EFI partition in FAT format contains software in data which provides the instructions for the EFI firmware (which is located elsewhere) to use for booting.

29th September 2017, 04:00 PM
I would be very cautious about removing or reformatting the EFI partition . . .

I, too, would be very careful about getting rid of the EFI partition -- especially if it is on a laptop. As dswaner says, firmware support is crucial and on a laptop there is generally a lot more proprietary firmware. You should be able to remove the Fedora efi directory from inside of the the EFI partition with no problem, however.