Please consider the script (attached) for inclusion into Mtools.
The script runs `dd', `mpartition' and `mformat' in sequence to
construct a DOS hard disk image (i. e., with MBR) consisting of
the specified number of DOS partitions of a given size. E. g.:
$ grep -F x: -- ~/.mtoolsrc
drive x: file="/.../dos-exchange.image" partition=1
$ mkdosdisk /.../dos-exchange.image 640M
0+0 records in
0+0 records out
0 bytes (0 B) copied, 1.9639e-05 seconds, 0.0 kB/s
Warning: no active (bootable) partition present
$
The above creates a DOS hard disk image consisting of a single
640 MiB-long DOS partition with a filesystem, which is already
configured as drive X: for Mtools. Now, test it:
$ mcopy -s \
ftp.glcf.umiacs.umd.edu/glcf/Landsat/WRS2/p148/r023/L71148023_02319990801.ETM-USGS \
x:
$ mdir x:
Volume in drive X has no label
Volume Serial Number is 1959-D83D
Directory for X:/
L71148~1 ETM <DIR> 2009-06-20 0:46 L71148023_02319990801.ETM-USGS
1 file 0 bytes
87 932 928 bytes free
$ mdir x:/L71148~1.ETM/
Volume in drive X has no label
Volume Serial Number is 1959-D83D
Directory for X:/L71148~1.ETM
. <DIR> 2009-06-20 0:46
.. <DIR> 2009-06-20 0:46
L71148~1 JPG 13523 2009-06-20 0:46 L71148023_02319990801.preview.jpg
L71148~2 JPG 431712 2009-06-20 0:46 L71148023_02319990801.browse.jpg
L71148~3 JPG 15857 2009-06-20 0:46 L71148023_02319990801.742.preview.jpg
L71148~1 TIF 59389708 2009-06-20 0:46 l71148023_02319990801_b50.tif
L71148~2 TIF 59389708 2009-06-20 0:46 l71148023_02319990801_b40.tif
L71148~3 TIF 59389708 2009-06-20 0:46 l71148023_02319990801_b30.tif
L71148~4 TIF 14852018 2009-06-20 0:46 l71148023_02319990801_b61.tif
L72148~1 TIF 14852018 2009-06-20 0:46 l72148023_02319990801_b62.tif
L72148~2 TIF 59389708 2009-06-20 0:46 l72148023_02319990801_b70.tif
L72148~3 TIF 237407428 2009-06-20 0:46 l72148023_02319990801_b80.tif
L71148~5 TIF 59389708 2009-06-20 0:46 l71148023_02319990801_b20.tif
L71148~1 GZ 21186574 2009-06-20 0:46 l71148023_02319990801_b10.tif.gz
L71148~4 JPG 512946 2009-06-20 0:46 L71148023_02319990801.742.browse.jpg
15 files 586 220 616 bytes
87 932 928 bytes free
$
And, once the image is no longer needed:
$ rm /.../dos-exchange.image
$
I'm currently trying to use such a temporary partition to allow
for large file sets to be transferred between a host GNU/Linux
system and FreeDOS guests (running under, e. g., Qemu or KVM.)