14. How to Uninstall Linux

If for any reason you want to uninstall Mandriva Linux, you can do so. The process of uninstalling Mandriva Linux is done in two steps:

[Warning]Warning

Removing partitions on your hard drive will inevitably result in the loss of all data stored on those partitions. Please make sure you've backed up all of the data you want to keep before proceeding.

  1. Remove the bootloader, LILO in this example, from the Master Boot Record (MBR). To do so, execute lilo -U in a console, as root. Doing this will not only uninstall LILO but will also restore the previous master boot record, if any.

    If you have a different boot loader, please refer to its documentation to determine how to regenerate the master boot record.

  2. Delete all partitions related to Mandriva Linux on your hard drive (usually partitions hosting ext3 file systems and the Swap partition) and — optionally — replace them with a single partition using fdisk.

    1. Log out from your current session and log back in as root.

    2. Open a terminal window and run fdisk /dev/hda (if the hard disk containing Mandriva Linux is other than the 1st IDE disk, change /dev/hda accordingly).

    3. Use the p command to display partition information, and then use the d command to delete all unneeded partitions.

    4. If you want to create a single partition, use the c command, specify 1 as the partition number, make it use the whole space available, and when asked for the partition type use the L command to list the supported partition types and choose the right one for the OS you plan to install later. Some examples: c for a FAT32 (Windows® 9x) partition, 7 for a NTFS (Windows® NT/Windows® 2000/XP) partition, 83 for a GNU/Linux partition. Finally use the w command to write changes back to disk.

Once this is done, just reset or shutdown the machine “the hard way”.