Author Topic: Mounting a VDI image as a drive  (Read 4339 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Mounting a VDI image as a drive
« on: January 04, 2019, 02:59:17 pm »
Hi

Do you know if there is a way to mount a VDI hard disk image as a drive on OS/2 running on real hardware (not virtualized)?
If it is not VDI, are there any other formats that can be mounted?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1593
  • Karma: +4/-2
    • View Profile
Re: Mounting a VDI image as a drive
« Reply #1 on: January 04, 2019, 05:42:30 pm »
DFSEE can read VDI files, for file extraction, as long as they contain a file system known to DFSEE, but it doesn't mount them as a drive. Some other virtual disk formats are supported in that way. DFSEE can also extract files from real file systems, that it knows about, even when the host system doesn't know what they are.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Mounting a VDI image as a drive
« Reply #2 on: January 04, 2019, 10:14:24 pm »
2Martin: Why not  use fat32.ifs or loop.add driver supplied with it? Fat32.ifs can mount FAT/FAT32/exFAT
disk images on a subdirectory on another FAT/FAT32/exFAT drive. Also, with help of loop.add block device
driver, it is possible to mount any file system, having an IFS driver for OS/2, on a drive letter. The disk images
can be raw ones (floppy images, CD/DVD ISO images, or any VM disk images, like .vhd/.vdi/.vmdk/.qcow/etc
-- for details, see fat32.inf file). Note that this feature is still in development. Currently, there are problems
with mounting file systems other than FAT/FAT32/exFAT/iso9660. These listed are mounted fine. JFS/HPFS
are mounted successfully, but there are problems with using strat2/strat3 in loop.add driver. So, you can
view directory listings, but if you try to copy something bigger than 1 MB, you can see a hang when cache
is flushed. But FAT/FA32/exFAT/CDFS work fine as they use strat1 only.

For reading/writing different VM disk images, fat32.ifs and loop.add uses a special qemuimg.dll library I ported
from QEMU. The library is loaded by cachef32.exe daemon, and executes read/write/open/close requests, issued
by fat32.ifs or loop.add, and returns results back.

Note that currently, there is a bug in this library, which causes to show trash is some subdirectories. This is
currently not fixed.
« Last Edit: January 04, 2019, 10:18:55 pm by Valery Sedletski »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Mounting a VDI image as a drive
« Reply #3 on: January 04, 2019, 10:49:53 pm »
Hi

I forgot to say that it is a VDI hard disk image with JFS format.

I want to try valery's experimental stuff. Do I just install your FAT32 driver? Are the instructions to use loop.add there? Or can you quickly tell me how to mount the drive with it ?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Mounting a VDI image as a drive
« Reply #4 on: January 04, 2019, 11:05:16 pm »
2Martin: Everything is documented in fat32.inf. If it is  JFS, then no way to extract files from the image currently.
As I said, JFS uses strat3, so it doesn't work currently. But FAT/FAT32/exFAT/CDFS will work.

You need to use current version of fat32.ifs, and add the

Quote
basedev=loop.add

statement to your config.sys. Then use f32mount utility to mount the image, like this:

Quote
f32mount <path_to_image> /block /p:<partition_number>

PS: You can mount JFS, and may be, copy some small file from it, but if you'll try something
bigger, it will hang.
PPS: the "/block" parameter means mounting to a block device (i.e., a drive letter). After you
used the drive letter, you can "eject" it like any other removable. If you use mounting to a directory
on another FAT/FAT32/exFAT drive as a mountpoint, you use path to that directory, instead of
"/block" word. To unmount the image, use the same "f32mount" command you used for mounting,
with "/d" appended.
« Last Edit: January 04, 2019, 11:20:09 pm by Valery Sedletski »