How to Uninstall Linux

Support knowledgebase (tg_deinstall)
Applies to

SuSE Linux: Versions since 4.4

Situation:

You want to uninstall Linux completely.

Procedure:

First, make a backup of all your important data! In case DOS or Windows 3.x/95/98/ME is installed on your machine, too, create a boot floppy of this operating system.

From SuSE Linux 7.3 on:

(Note: If a working SuSE Linux installation is not available, follow the instructions below in the section Generic Method.)

  1. Start the YaST2 Control Center and select

  2. In the next dialog, delete all Linux partitions including the Linux swap partition. The extended partition "Win95 Ext'd (LBA)" can also be deleted if it no longer contains any logical drives. Confirm the changes with Next and the subsequent security advice with Yes. Now the changes will be applied.

  3. To remove LILO or GRUB (if it is installed in the Master Boot Record or MBR), you must rewrite the MBR. Use the program fdisk of your alternative operating system for this purpose. If you use DOS or Windows 3.x/95/98/ME, boot with a DOS rescue floppy and start fdisk with:
     fdisk /mbr
    
    The command for OS/2 is
    fdisk /newmbr
    
    If you use Windows 2000/XP, deinstall LILO or GRUB as described in the article "Uninstalling the Boot Manager LILO from the MBR" (http://sdb.suse.de/en/sdb/html/fhassel_deinstall_lilo.html) (http://sdb.suse.de/en/sdb/html/fhassel_deinstall_lilo.html).

  4. Then you can boot your operating system without LILO or GRUB and repartition the new free space accordingly.

Up to SuSE Linux 7.2:

  1. Boot from the first boot CD as if it were a new installation and select the item Manual installation from the start menu. If this option is not available in previous versions of SuSE Linux, enter manual at the boot prompt. Alternatively, you can also use the included boot floppy.
  2. Select the language, screen resolution, and keyboard layout. Follow the new installation routine until you reach the point where the hard disk is partitioned. Then select:
  3. Delete all Linux partitions by pressing F4 and confirm with Continue. A window reading "Writing new partition table ..." will be displayed. After deleting the Linux partitions, abort the installation process by pressing Abort and reboot.
  4. To remove LILO or GRUB (in case it is installed in the MBR), you must rewrite the MBR. Use the program fdisk of your alternative operating system for this purpose.
    If you deploy DOS or Windows 3.x/95/98/ME, boot with a DOS rescue floppy and start fdisk with:
     fdisk /mbr
    
    The command for OS/2 is
    fdisk /newmbr
    
    . If you use Windows 2000/XP, follow the instructions contained in the article "Uninstalling the Boot Manager LILO from the MBR" (http://sdb.suse.de/en/sdb/html/fhassel_deinstall_lilo.html) (http://sdb.suse.de/en/sdb/html/fhassel_deinstall_lilo.html) to uninstall LILO or GRUB.

  5. Then you can boot your operating system without LILO and repartition the new free space accordingly.

Generic Method

  1. Boot the rescue system (e.g., from the first SuSE Linux CD). Log in to the rescue system as root (no password is required). The Linux partitions can be deleted with fdisk.
  2. First, get an overview of the partitions by entering
    fdisk -l
    
    The output might be like this:
    rescue:~ # fdisk -l
    
    Disk /dev/hda: 255 heads, 63 sectors, 1655 cylinders
    Units = cylinders of 16065 * 512 bytes
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/hda1   *         1        18    144553+  82  Linux swap
    /dev/hda2            19      1655  13149202+   f  Win95 Ext'd (LBA)
    /dev/hda5            19        22     32098+  83  Linux
    /dev/hda6            23      1655  13117041   83  Linux
    
  3. Start fdisk in interactive mode. This can be done by entering the hard disk's device name as a parameter. For example, if the hard disk to edit is connected as primary master (see above), enter the command:
    fdisk /dev/hda
    
  4. fdisk includes the following options:
    
      m    to display a list of the available commands

    p to display a list of the partitions

    d to delete a partition

    q to quit the program WITHOUT saving changes

    w to save the modifications and to exit fdisk

    You can delete the Linux partitions (ID 83) and the Linux swap partition (ID 82) with these commands by pressing "d" then ENTER. The system asks which partition to delete. To delete the last partition (/dev/hda6) in the example above, enter "6" and press ENTER. The extended partition "Win95 Ext'd (LBA)" can also be deleted, if it no longer contains any logical drives. To save the information, press "w" then ENTER.

  5. To remove LILO or GRUB (if installed in the MBR), you must rewrite the MBR. Use the program fdisk of your alternative operating system for this purpose. If you use DOS or Windows 3.x/95/98/ME, boot with a DOS rescue disk and start fdisk with:
         fdisk /mbr
    
    The command for OS/2 reads
         fdisk /newmbr
    
    If you use Windows 2000/XP, uninstall LILO or GRUB as described in the article "Uninstalling the Boot Manager LILO from the MBR" (http://sdb.suse.de/en/sdb/html/fhassel_deinstall_lilo.html) (http://sdb.suse.de/en/sdb/html/fhassel_deinstall_lilo.html) vor.

  6. Then you can boot your operating system without LILO and repartition the new free space accordingly.

Keywords: UNINSTALL, REMOVE, DEINSTALLATION

Categories: Frequently asked Questions

SDB-tg_deinstall, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 16. Mar 1999
SuSE Linux AG - Last generated: 30. Jan 2003 by fhassel (sdb_gen 1.40.0)