Hard Disks and Partitions

Tips Part 9

How to partition, format, or wipe your hard drive

Back Next

DISCLAIMER: the following information is NOT for the novice. If you screw up your system, the author takes no responsibility. The utility programs discussed in this document are POTENTIALLY DANGEROUS to your data, system stability and integrity. They are not toys or games. DO NOT use them lightly. You have been warned.


Contents

Starting with a new, blank hard disk.
Using FDISK
Using FORMAT
Wiping a Hard Disk and Starting Over


Preliminaries and Warnings

If you would like to get familiar with partitioning and formatting hard disks, first do some experimenting with a disk that is blank, or the contents of which you do not care about. The procedures described below will OBLITERATE ALL DATA on the disk, if it is not already blank, and you can NEVER get it back.


Starting with a new, blank, hard drive

Before a hard disk can be used it must be partitioned and formatted.

Partitioning determines how many drives you will end up with, and how big they are. In the DOS/Windows world, this is done with a program called FDISK.EXE.

Formatting encodes the disk with the information necessary for data to be stored on it: the Master Boot Record and the File Allocation Tables. This is done with a program called FORMAT.COM.

You might think of the process as something like this: you have a very large piece of paper, which you decide to cut into 8.5" x 11" sheets (partitioning); then you add lines and margin rules to each sheet (formatting).

Note: Floppy disks cannot be partitioned, only formatted. Most new floppies sold today are pre-formatted.

Physical vs Logical drives

Any hard disk may be partitioned as a single large drive, or split into two or more smaller drives. For example, a 10 gigabyte hard disk may be split into three: one 4G drive, and two 3G drives. They will appear as drives C:, D:, and E: (if you have a CD-ROM it will become drive F:). In this case, you have one physical hard disk (drive), but three logical drives. Sound simple enough? Too bad. It isn't always that way. If you have two hard disks, things get complicated (see below).

Primary and Extended Partitions

You must have a primary partition, which is normally the one the operating system (Windows) will boot from. The primary partition may use the entire disk, or only part of it. If the primary partition does not use the entire disk, then you can either leave the rest of the hard disk blank, or you can create an extended partition. The extended partition, in turn, can use up the rest of the hard disk or not, as you wish. So, after creating the primary and extended partitions, you then define logical drives within the extended partition. Finally, in order to be bootable, the primary partition must be made active. In summary, it's a four-step process:

1. Create the Primary partition, using as much of the hard disk as you wish
2. Make the Primary partition active (this doesn't have to be step 2)
3. Create an Extended partition, using as much of the remaining space as you wish (optional)
4. Create a Logical drive (or several), within the Extended partition

Why would I want to leave part of the hard disk blank?

In case you want to install another operating system, like Linux, or Windows NT/2000/XP, or something else, and make a dual boot machine. With Linux and Unix, you need to install Windows (any version) first. For more about dual-booting, click here.


Using FDISK

One final warning, and I can't emphasize this enough:

Starting with a new, blank hard disk

The following example describes how to partition a 10 gigabyte hard disk into three equally sized drives - or as close to equal as you can get.

You will need a bootable floppy disk. If you don't have one, see Tips Part 8: How to create a bootable floppy disk.

With your computer off, insert the boot floppy into the floppy disk drive, and turn the machine on. When the machine boots, you will see a command prompt, like this:

A:\>

Type "fdisk" (upper or lower case - it doesn't matter), and press Enter. You will see a screen with a lengthy and nerdy message (see Fig. 1), with a question, to which you answer Y or N; just make sure to choose Y. You will not see this message if you have a hard disk smaller than 512Mb.

Fig. 1

FDISK - initial screen

The next screen gives you a list of options:

Fig. 2

You want to select option 1. Create DOS partition or Logical DOS Drive.; then you will see the following screen:

Fig. 3

Again, you want to select option 1. Create Primary DOS Partition.

Next, you will be asked how big you want the Primary DOS Partition to be. You can specify it in either megabytes, or a percentage of the total disk space. Personally, I find it easier to use a percentage figure.

Note: I had to type in the next few "screen shots" manually, because in order to see these next steps in the partitioning process, you need to have a blank hard disk. Perhaps there is a way, but I don't know how to do a screen capture on a computer that does not yet have an operating system...

The X* is a number, which will be the total size of your hard disk.


Create Primary DOS Partition

Current fixed disk drive: 1
Total disk space is X* Mbytes (1 Mbyte = 1048576 bytes)
Maximum space available for partition is X* Mbytes (100%) Enter partition size in Mbytes or percent of disk space (%) to
create Primary DOS Partition..............................[X*]

Press Esc to return to FDISK options


On the line "...create Primary DOS Partition....................[X*]", there will be a blinking cursor between the square brackets; enter whatever number you wish, in Megabytes or %. Since I find it easier just to enter a percentage, I would type "34%", and press Enter. That will leave 66% of the disk for the Extended Partition.

You will then see a message at the bottom of the screen about "verifying drive integrity", and a number counting up from 0% to 100%

Then you will see a screen like this:


Create Primary DOS Partition

Partition Status Type Volume Label Mbytes System Usage
C:1 PriDOS 3565* UNKNOWN 34%

Primary DOS Partition Created

Press ESC to continue


* I'm guessing at the size...



And what does this gibberish mean?

Partition C:1

That is, drive C:, partition 1.

Status

Whether the partition is active (bootable) or not; if it were active, there would be an "A" under "Status".

Type

PriDOS means Primary DOS partition. Even if partitions are (going to be) used for Windows, they are often called DOS partitions, as opposed to NTFS (Windows NT), or ext2/3 (Linux), and others.

Volume Label

This is just a name for the drive. You can give a drive a name, or not, as you wish (see FORMAT).

Mbytes

The size of the drive, in megabytes.

System

What type of file system is on the drive, for example FAT16, FAT32, NTFS, ext2, etc. Since this drive is still unformatted, FDISK can't tell yet.

Usage

What percentage of total hard disk space this drive is occupying.


Making the Primary DOS partition active

Press Esc until you get back to the main menu (Fig. 2). Choose option 2, Set active partition. There will only be one partition available (C:1). Make it active, and press Esc again to return to the main menu.


Creating the Extended DOS Partition

At the main FDISK menu (Fig. 2):

1. Choose option 1, Create DOS partition or Logical DOS drive.
2. Choose option 2, Create Extended DOS partition.

You now have a screen similar to when you created the Primary DOS partition; you are asked how many megabytes, or what percentage of the remaining hard disk space, is to be assigned to the extended DOS partition. If you accept the default (which is in megabytes), or specify 100%, ALL the remaining space on the disk will be assigned to the extended DOS partition.

NOTE: the percentages in this section represent the percentage of space in the Extended DOS Partition; this is NOT the percentage of total hard disk space.

Since we want to assign all the remaining space to an extended DOS partition in this exercise, just press Enter. You will again see the "verifying drive integrity" message, then you will be asked to define logical drives in the extended partition (next).


Creating Logical Drives in the Extended DOS Partition

For the first drive, specify 50%; you will see a line appear at the top your screen, similar to what you saw when you created the primary DOS partition, showing drive D:, its type, size, etc.

Next, you can simply press Enter for the size of drive E:. Whatever the size is (it will be in Mbytes), that will be the other 50% of the extended DOS Partition.

DONE!

Press Esc until you are back at the main FDISK menu (Fig. 2), and choose option 4. Display partition information, to check that everything is as you wish. Then, press Esc until you are back at the A:\> prompt, and re-boot the machine.


Using FORMAT

If you survived partitioning your hard disk (and were successful), using FORMAT will be easy.


After partitioning the hard drive, you must reboot the machine in order for the changes to take effect. You will then see the A: prompt again.

At the A:\> prompt, type:

format c:

You will be warned that this operation will erase all data on the drive, and are you SURE you want to proceed. As long as you are sure, type "Y".

When the format is complete, you will be asked if you want the drive to have a volume label, which is no more than a "name" for the drive. Type one if you wish, or leave it blank. You can always add or change the volume label later.

Now format drives D: and E: the same way: type "format d:", and when that's done, type "format e:" (you don't need to re-boot after formatting a drive, just go ahead and format the next one).


Wiping a hard disk and starting over

THIS OPERATION WILL DESTROY ALL DATA ON THE HARD DRIVE, AND THAT DATA WILL BE LOST FOREVER. YOU HAVE BEEN WARNED.

BEFORE YOU WIPE THAT DISK, there are a few bits of information that you might want to gather.

For more about Device Manager, click here; for more about drivers, click here, and then look here. You should also read about patches; click here.

Using FDISK to wipe a hard disk

WIPING A HARD DISK: THE QUICK AND DIRTY WAY is to blow away a hard disk's partitions with a utility like zapdisk.exe. You can find zapdisk here. Be aware, however, that zapdisk will blank the entire disk, whereas with FDISK, you don't necessarily have to delete every partition (=drive).

A hard drive that already contains partitions and logical drives (created by DOS or Windows) can be wiped clean with FDISK. After the procedure described below, you will have a totally blank hard drive, as if it were brand new. If you are dealing with a single hard drive, things are not too complicated.

Boot from a Windows (not DOS) floppy disk, and type FDISK at the command prompt.

If you don't have a Windows bootable floppy disk, see Windows HELP! - Tips Part 8: How to create a bootable floppy disk.

If you don't know what a command prompt is, see Windows HELP! - Tips Part 6: DOS tips.

If the hard drive to be wiped has more than one partition, this is a three-stage process:

1) delete all logical drives in the extended partition
2) delete the extended partition
3) delete the primary partition

If the hard drive is all one partition (i.e., the entire disk is drive C:), then you only need to perform step 3).


Deleting logical drives in the extended partition

Start FDISK by typing "fdisk" at the command prompt. Type "Y" if you are asked to enable large disk support (as in Fig. 1, above), then you will see the main menu:

Fig. 4

Choose option 3. Delete partition or Logical DOS Drive. You will see another menu:

Fig. 5

Again, choose option 3. Delete Logical DOS Drive(s) in the Extended DOS Partition. You will then see a list of the logical drives in the extended partition. There happens to be only one in this example:

Fig. 6

Type the letter of the drive you wish to delete; you will be asked to confirm the operation. Drives must be deleted one at a time, so simply repeat the above for each drive. At any point, press Esc to go back to the previous menu.


Deleting the Extended Partition

Once all the logical drives are deleted, choose option 2. Delete Extended DOS Partition from the menu in Fig. 5.


Deleting the Primary DOS Partition

From the main menu (Fig.4), choose option 3. Delete partition or Logical DOS Drive. At the next menu (Fig. 5), choose option 1. Delete Primary DOS Partition. You will be asked to confirm the operation, as usual.


Deleting non-DOS partitions

FDISK can sometimes successfully delete non-DOS/Windows partitions. All you can do is try:

From the main menu (Fig.4), choose option 3. Delete partition or Logical DOS Drive. At the next menu (Fig. 5), choose option 4. Delete non-DOS Partition. What happens next depends on what type of partition you are dealing with. Proceed with caution and common sense, and see what happens. You are on your own with this one.

There are more drastic measures one can take to wipe hard disks if FDISK doesn't work, but they are not for the faint of heart, and rather beyond the scope of this document.


If you have successfully partitioned and formatted your hard disk, CONGRATULATIONS! You have just accomplished two things that very few computer users know how to do.

As I said at the beginning of this document, things get a little more complicated if you have two hard disks. That situation is covered in Part 10.


Back Next

Copyright © Michael Ward 1999 - 2009