Removing Non-DOS Partitions with Debug

This article was previously published under Q106419
This article has been archived. It is offered "as is" and will no longer be updated.


There are currently several different versions of MS-DOS in thepersonal-computer environment, both in the OEM-licensed versions andin the Microsoft packaged-product versions. The hard-disk-managementcapabilities of MS-DOS vary from one version to another. For example,MS-DOS versions 3.2 and 3.21 can address a single hard-disk partitionof up to 32 megabytes (MB); MS-DOS version 3.3 can address multiplehard-disk partitions, with a primary DOS partition of up to 32 MB andan extended DOS partition containing logical drives of up to 32 MBeach; and MS-DOS versions 4.0, 4.01, 5.0, 6.0, and 6.2 can addressmultiple hard-disk partitions with sizes up to 2 gigabytes (GB).

For those using versions of MS-DOS that have lesser levels of hard-disk support, such as MS-DOS versions 3.2 and 3.21, there are a numberof third-party hard-disk-management software packages that allow MS-DOS to access multiple partitions and/or partitions in excess of 32MB. However, these third-party packages may use non-DOS constructs toassist in managing the hard disk, possibly including non-DOSpartitions. These non-DOS constructs can cause problems when youupgrade to later versions of MS-DOS because versions of MS-DOS earlierthan 5.0 assume that non-DOS constructs are owned by another operatingsystem and, therefore, do not use, delete, or change non-DOSpartitions or other non-DOS constructs in any way.
WARNING: Some computers require the use of third-party hard-disk- partitioning software because the system ROM BIOS does not fully support the drive parameters of the hard disk that is being used or because the hard disk has more than 1024 data cylinders. If you are unsure if your system supports your hard disk, consult your hardware manufacturer or the manufacturer of your partitioning software before proceeding.
To detect if your system makes use of Drive Overlay software, see the following article:
186057 How to Tell If Drive Overlay Program Is Installed in Windows

Using Debug to Remove a Non-DOS Partition

The Debug script on the following page, used with the MS-DOS Debugprogram, deletes non-DOS partitions when you upgrade to a new versionof MS-DOS, enabling the entire hard disk to be used by MS-DOS. It doesso, however, by clearing out the entire partition table on the harddisk, which results in the deletion of ALL partitions on the harddisk. You need to use this method if your current version of MS-DOScannot delete non-DOS partitions.
WARNING: Because all data on your hard disk will be destroyed by this procedure, you must back up your hard disk before using this Debug script.
There are two ways to use the following Debug script:
  • Run Debug and type the Debug commands from the center column of Table 1 at the corresponding Debug prompt. (The left column of the table shows the prompts that are displayed by Debug. You do not need to type the comments in the right column.)
  • Type the command in the center column of Table 1 into a file using a text editor such as MS-DOS Editor and then use input redirection to feed the resulting file into Debug. For example, if you typed the commands into a file called HDPART.SCR, you would clear your partition table by typing the following at the MS-DOS command prompt and then pressing ENTER:
    debug < hdpart.scr
          Table 1:  Debug Script to Erase Hard-Disk Partition Table   ----------------------------------------------------------------      Debug        Enter Debug       Comments      Prompts      Commands   ----------------------------------------------------------------      -            A 100             Assemble from CS:0100.      nnnn:0100    INT 13            Call interrupt 13.      nnnn:0102    press the         (nnnn in the segment address).                   ENTER key      -            RAX               Replace AX register.      AX 0000      :            0301              Write on sector.      -            RBX               Replace BX register.      BX 0000      :            0200              Start from ES:200.      -            F 200 L 200 0     We want to write zeros.      -            RCX               Replace CX register.      CX 0000      :            0001              Cylinder, 0, sector 1.      -            RDX               Replace DX register.      DX 0000      :            0080              First physical hard disk, head                                     0. (Substitute 0081 for this                                     entry if you are clearing the                                     table on the second physical                                     hard disk, 0082 if you are                                     clearing the third physical                                     hard disk, and so forth).      -            P                 Proceed (Debug will display                                     several lines of information).      -            Q                 Quit Debug.   ----------------------------------------------------------------						
This script completely clears the partition table on your hard disk,preparing the hard disk for repartitioning using the MS-DOS Fdiskprogram. (When you run Fdisk for the first time after using thisprocedure and before reinstalling MS-DOS, the message "No partitionsdefined" should be displayed if the partition deletion procedure wassuccessful.) For more information about using Fdisk, see the MicrosoftMS-DOS" User's Guide and Reference" for version 3.2, 3.21, 3.3, 4.0,4.01, or 5.0, or the Microsoft MS-DOS" User's Guide" for version 6.0or 6.2.

For additional information on how to recreate a partition using the Fdisk utility, click the article number below to view the article in the Microsoft Knowledge Base:
255867 How to Use Fdisk and Format to Partition or Repartition a Hard Disk
Non-DOS partitions on your hard disk are also erased if you perform alow-level format. Consult your hardware manufacturer for specificinstructions on performing a low-level format on your hard disk.
WARNING: Performing a low-level format will completely erase all data on your hard disk, including all defined partitions.
6.00 6.20 6.21

Article ID: 106419 - Last Review: 12/04/2015 09:49:06 - Revision: 2.0

Microsoft MS-DOS 6.0 Standard Edition, Microsoft MS-DOS 6.2 Standard Edition, Microsoft MS-DOS 6.21 Standard Edition

  • kbnosurvey kbarchive kbinfo KB106419