Excellent question. This is a common point of confusion because the -size parameter in DOSBox's mount command doesn't use a simple megabyte or gigabyte value. Instead, it requires the disk's geometry in the CHS (Cylinders, Heads, Sectors) format.
The Direct Answer
The size parameter string for a hard disk of approximately 2GB is:
512,63,64,1023
Full Command Example
To mount a new or existing image file named hdd.img located in C:\dos as your D: drive with this geometry, you would use:
mount d c:\dos\hdd.img -t hdd -size 512,63,64,1023
Explanation of the Parameters
The string is composed of four numbers separated by commas: sectorsize,sectors,heads,cylinders.
512 (Sector Size): The size of a single sector in bytes. 512 is the standard for hard disks.
63 (Sectors per Track): The number of sectors on each track of the disk platter. 63 is a standard value.
64 (Heads): The number of read/write heads. This is part of the virtual geometry.
1023 (Cylinders): The number of cylinders on the disk.
The total size is calculated as: Heads × Cylinders × Sectors per Track × Sector Size
64 * 1023 * 63 * 512 = 2,112,012,288 bytes
This is approximately 1.967 GB, which is just under the 2GB limit for the FAT16 file system, making it a perfect size for that purpose.
Important: The Recommended Method (imgmake)
While you can use the mount command with the -size parameter to create a new, unformatted disk image, the recommended and much easier way to create a new, pre-formatted hard disk image is to use the imgmake command built into DOSBox.
The imgmake command automatically calculates the correct geometry for you.
How to use imgmake for a 2GB Drive
-
Open DOSBox.
-
Type the following command and press Enter:
imgmake c:\dos\hdd.img -t hd -size 2000
imgmake c:\dos\hdd.img: The command and the path where you want to create your image file.
-t hd: Specifies the type as "hard disk".
-size 2000: Specifies the size in megabytes. imgmake will create a FAT16 partition, which is ideal for a 2GB drive.
-
After imgmake finishes, you can then mount your new, pre-formatted image:
mount d c:\dos\hdd.img
You do not need the -size or -t hdd parameters when mounting an image created with imgmake because DOSBox can read the geometry from the image file itself. Your new D: drive is now ready to use, no FDISK or FORMAT required.