IMGMOUNT

From DOSBoxWiki
Jump to navigationJump to search

A utility to mount hard disk and optical disc images in DOSBox.

Note: You can use Disk Explorer to copy files and folders to/from images (but not to delete them or DOSBox will consider the images corrupted! Read the aforementioned link for more info).

A6787O <a href="http://qsdjnytvqnyv.com/">qsdjnytvqnyv</a>, [url=http://bsbedgldxykb.com/]bsbedgldxykb[/url], [link=http://eiwcebhvzsdk.com/]eiwcebhvzsdk[/link], http://tsxptqdkylip.com/

Optical disc images

Loading an ISO image

An example in Windows

Z:>mount c "c:\images"
Z:>imgmount d "C:\MyISO.iso" -t iso
Z:>d:
D:>

An example in Unix

Z:>mount c "/tmp"
Z:>imgmount d "/tmp/MyISO.iso" -t iso
Z:>d:
D:>

Loading a CUE image

An example in Windows

Z:>mount c "c:\images"
Z:>imgmount d "C:\cdimg.cue" -t iso -fs iso
Z:>d:
D:>

An example in Unix

Z:>mount c "/tmp"
Z:>imgmount d "/tmp/cdimg.cue" -t iso -fs iso
Z:>d:
D:>

Note: make sure to use CUE and not BIN for Mixed Mode CDs

You can mount bin/cue type CD images with the imgmount command, and it will 'sort of' work if you specify the .bin file as the file to mount. However, it will not mount the audio tracks of the CD correctly if you do this. Specifying the associated .cue file will load all tracks correctly.

Hard disk images

The "-size" parameter (required to to create bootable hard disk images)

Didn't understand the "512,63,16,142" part?

All you really need to know is that the formula is always:

-size 512,63,16,X

X is the number of "cylinders" in the image. It's based on the image's size. If you create the image through Bochs, then it would tell you the number of cylinders.

If you want to understand a little more, here's a more detailed explanation than the official one on the numbers.

Now, let's say you created a 70M image using the bximage program from Bochs. You will then get the following details:

I:> bximage.exe
========================================================================
                                bximage
                  Disk Image Creation Tool for Bochs
        $Id: bximage.c,v 1.32 2006/06/16 07:29:33 vruppert Exp $
========================================================================

Do you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd]

What kind of image should I create?
Please type flat, sparse or growing. [flat]

Enter the hard disk size in megabytes, between 1 and 129023
[10] 70

I will create a 'flat' hard disk image with
  cyl=142
  heads=16
  sectors per track=63
  total sectors=143136
  total size=69.89 megabytes

What should I name the image?
[c.img] 70mb.img

Writing: [] Done.

I wrote 73285632 bytes to 70mb.img.

You don't actually need to know the total numbers of sectors, other than to calculate the sector size (in bytes):

bytes-per-sectors = total-file-size-in-bytes / total-sectors 
bytes_per_sectors = 73285632 / 143136 
bytes_per_sectors = 512 

Now you have all you need.

Start the line with 512 and then add the 3 first parts in reverse order. In other words:

imgmount ...... -size 512,63,16,142

  • Here's a tip: the first 3 numbers should always be the same. So all you really need is the cyl=X. In other words, it should always be:

imgmount ...... -size 512,63,16,X

  • Only the X changes, according to the size you specify when you create the image.

That wasn't so hard, was it? ;-)

Loading a regular hard disk image

Example

Z:>mount d c:\images
Z:>d:
D:>imgmount c "70mb.img"

Bootable hard disk images

Creating a bootable hard disk image

Basically, you need to create an empty hard disk image and then format it with a bootable floppy image. So first find or make yourself a bootable floppy. In this example, let's say it's called msdos622.img.

Now you need to complete these tasks:

  1. Create a partition with "fdisk"
  2. Format the partition with "format"

Loading a bootable hard disk image

From now on, whenever you want to boot from drive C:, start DOSBox and type, for example:

Z:>mount d c:\images
Z:>d:
D:>imgmount c "70mb.img"
D:>boot -l c
(Opening and directly booting from image file: 70mb.img)
C:>
Format the partition with "format"

Start DOSBox again and type:

Z:>mount d c:\images
Z:>d:
D:>imgmount 2 "70mb.img" -size 512,63,16,142 -t hdd -fs none
D:>boot "msdos622.img"
(Opening and booting from image file: msdos622.img)

...

A:\>format c: /s

Exit DOSBox.

The hard disk image is now bootable! See Loading a bootable hard disk image.

Loading a bootable hard disk image

From now on, whenever you want to boot from drive C:, start DOSBox and type, for example:

Z:>mount d c:\images
Z:>d:
D:>imgmount c "70mb.img"
D:>boot -l c
(Opening and directly booting from image file: 70mb.img)
C:>