In DOS and Windows, use the Windows
fdisk utility to create a new MBR with the undocumented flag
/mbr. This ONLY rewrites the MBR to boot the primary DOS partition. The command should look like the following:
If you need to remove Linux from a hard drive and have attempted to do this with the default DOS (Windows)
fdisk, you will experience the Partitions exist but they do not exist problem. The best way to remove non-DOS partitions is with a tool that understands partitions other than DOS.
To begin, insert the Red Hat Enterprise Linux DVD and boot your system. When the boot prompt appears, type:
linux rescue. This starts the rescue mode program.
You are prompted for your keyboard and language requirements. Enter these values as you would during the installation of Red Hat Enterprise Linux.
Next, a screen appears telling you that the program attempts to find a Red Hat Enterprise Linux install to rescue. Select
on this screen.
, you are given a command prompt where you can access the partitions you would like to remove.
First, type the command
list-harddrives. This command lists all hard drives on your system that are recognizable by the installation program, as well as their sizes in megabytes.
Be careful to remove only the necessary Red Hat Enterprise Linux partitions. Removing other partitions could result in data loss or a corrupted system environment.
To remove partitions, use the partitioning utility
parted, where /dev/hda is the device on which to remove the partition:
print command, view the current partition table to determine the minor number of the partition to remove:
print command also displays the partition's type (such as linux-swap, ext2, ext3, ext4 and so on). Knowing the type of the partition helps you in determining whether to remove the partition.
Remove the partition with the command
rm. For example, to remove the partition with minor number 3:
The changes start taking place as soon as you press [Enter], so review the command before committing to it.
After removing the partition, use the
print command to confirm that it is removed from the partition table.
Once you have removed the Linux partitions and made all of the changes you need to make, type
quit to quit
exit at the boot prompt to exit rescue mode and reboot your system, instead of continuing with the installation. The system should reboot automatically. If it does not, you can reboot your computer using Control+Alt+Delete .