Linux Know-How provides a collection of introductory texts on often needed Linux skills.


Uninstalling Linux

If you really wanted to "uninstall" Linux, you could run the following two commands (from under DOS or MS Windows):

LOCK C:

FDISK/MBR

which will get rid of LILO--it overwrites the master boot record (MBR) of your first hard drive, where LILO resides. The "lock" command allows "raw" writing to disk, which is normally disallowed on more recent DOS versions as an antiviral measure. The problem with FDISK/MBR is that it does not report back any success or failure, so it is better to proceed it with the "lock" command. After this you can remove the Linux partitions using the DOS "FDISK" utility to re-claim the hard drive space.

Apparently, MS FDISK does not always cope with removing the Linux partitions. In this case, I may use Linux fdisk. The simplest may be to boot from the Linux installation floppy/CD, and to remove the partition using the Linux partitioning tool when it pops up during the "installation" procedure. After that I abort the "installation" and Linux is gone.

If you still have problems, here are the ultimate solutions for zeroing the MBR (after: http://www.linuxgazette.com/issue63/okopnik.html, edited for space):

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Note: The following advice will completely wipe your Master Boot Record (MBR), which contains all your partition information. DO NOT DO THIS unless you know that this is exactly the result you want - it will leave your hard drive in an unbootable state, in effect bringing it back to "factory-fresh", i.e., empty of data and requiring partitioning and formatting.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Linux-based solution. If you can boot Linux - say via boot floppy - you can simply invoke "dd":

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

This fills up the MBR with zeros. Obviously, you have to be root to do this.

DOS-based solution . Boot with a DOS floppy that has "debug" on it; run

debug

At the '-' prompt, "block-fill" a 512-byte chunk of memory with zeroes:

f 9000:0 200 0

Start assembly mode with the 'a' command, and enter the following code:

mov dx,9000

mov es,dx

xor bx,bx

mov cx,0001

mov dx,0080

mov ax,0301

int 13

int 20

Press <Enter> to exit assembly mode, take a deep breath - and press "g" to execute, then "q" to quit "debug". Your HD is now in a virgin state, and ready for partitioning and installation.


Last Update: 2010-12-16