3. Hard disk setup

3.1. How do I use my hard disk with dosemu?

First, mount your dos hard disk partition as a Linux subdirectory. For example, you could create a directory in Linux such as /dos (mkdir -m 755 /dos) and add a line like:

    /dev/hda1       /dos     msdos   umask=022

to your /etc/fstab. (In this example, the partition is mounted read-only. You may want to mount it read/write by replacing "022" with "000" and using the -m 777 option with mkdir). Now mount /dos.

Now you can run (for instance) lredir f: linux\fs/dos at the DOS prompt to map drive F to /dos. Re-redirecting C using lredir c: linux\fs/dos works too but then you need to copy all your dosemu utilities (in c:\dosemu) to a place where they can still be found. If you want to boot via /dos, read on.

The README.txt says:

you just can have a Linux directory containing all what you want to have under your DOS C:. Copy your IO.SYS, MSDOS.SYS or what ever to that directory (e.g. $HOME/.dosemu/bootdir), put $_hdimage = "bootdir" into your $HOME/.dosemurc, and up it goes. Alternatively you can specify an absolute path such as "/dos" or "/home/username/dosemu/freedos". DOSEMU makes a lredir'ed drive out of it and can boot from it. You can edit config.sys and autoexec.bat within this directory before you start dosemu. Further more, you may have a more sohisticated setup. Given you want to run the same DOS drive as you normal have when booting into native DOS, then you just mount you DOS partition under Linux (say to /dos) and put links to its subdirectories into the boot dir. This way you can decide which files/directories have to be visible under DOSEMU and which have to be different. Here's a small and incomplete example bootdir setup:

    config.sys
    autoexec.bat
    command.com -> /dos/command.com
    io.sys -> /dos/io.sys
    msdos.sys -> /dos/msdos.sys
    dos -> /dos/dos
    bc -> /dos/bc
    windows -> /dos/windows

3.2. How can I access the hdimage from Linux?

Use mtools. With a line in /etc/mtools.conf like:

    drive n:  file="/path/to/hdimage" MTOOLS_SKIP_CHECK=1 \
    MTOOLS_LOWER_CASE=1 MTOOLS_NO_VFAT=1 partition=1 offset=128

you can use the mtools on the hdimage, like "mdir n:". "mcopy n:/config.emu /tmp" copies the config.emu file from the hdimage to /tmp/config.emu. You can edit it there and copy it back. Use a drive letter you find sensible. "N:" is only an example.

3.3. Can I use my stacked/double-spaced/super-stored disk?

At this time, compressed drives cannot be accessed via the redirector (lredir or emufs) on a standard kernel. There is a patch for the kernel to mount compressed files under the name "dmsdosfs". Find it on ibiblio.org and its mirrors http://ibiblio.org:/pub/Linux/system/filesystems/dosfs/. A good idea is also to look in http://ibiblio.org:/pub/Linux/Incoming for a newer version. The "wholedisk" option in older versions of dosemu is no longer allowed in recent versions, however, a line like

    $_hdimage = "/dev/hda1"

may work, if you have read and write access to this device and at the risk that you could lose all data in that partition on a dosemu crash. Also it is extremely dangerous to let two dosemu sessions access the partition at the same time.

If your dos partition is already mounted with write access and you try to run dosemu with partition access, dosemu will print a warning message and abort. This prevents DOS and Linux from making independent writes to your disk and trashing the data on your dos partition (95/8/11).

Holger Schemel reported (94/2/10) that:

Works even fine under dosemu with MS-DOS 6.0. If you have problems, then you have to edit the file `DBLSPACE.INI' manually and change the disk letter to the letter your drive gets under dosemu.

3.4. Creating your own hdimage file.

There is an extra util program called mkfatimage16 which allows for creating a hdimage file headers. The full information is in the manpage (man/mkfatimage16.1) included in your distribution.

To create a hard disk image file with a geometry corresponding to that of a real hard disk of 32 megabytes run:

    mkfatimage16 -k 32768 > hdimage

This is probably too large for most needs; if you need this much space, consider using the disk redirector.

Usually it is a good idea to format the drive after it.