The Imitation Game

Hello all -

Is there a mechanism by which one may mount an ISO image in such a way that the system (or at least an application) believes that it is a physical disk?

Certain operations demand that I load a CD containing drivers, data or what have you and won’t let me point them to an arbitrary directory, so I need to burn these items off onto a disc; rather than doing this, I would prefer to fool them into thinking that the ISO image or directory is actually physical media present in /dev/sr0 or some such.

For those who do not read carefully, I do not mean mount –o loop et cetera.

While I ask partly because the environmentalist in me is displeased with burning single-use media, it is also (at least in my mind) an interesting question.

Is this doable without a rewrite of the kernel?

Thanks!

I do not get all of this.

Mounting a file system is invented to hide the fact that it is a different file system from applications (and the user).

The application (the user) refers to a directory without any inside knowledge if this is part of which file system. There is only one directory tree in Unix/Linux (build from one or more file systems that are planted in the tree (mounted) at the desired point.

How can an application wanting to be sure that a directory it refers to is a mount point? And then it requires that the file system is stored on a physical disk? Not a partition of a physical disk, not a Logical Volume of the Logical Volume Manager, not a tmpfs in memory?

Sorry, this may not help you, but :question:

The above is not only to express my amazement. It think it is important to find out what the real requirements of that program are. You suggest e.g. to create an ISO 9660 file system on a DVD, but will the application accept that type of file system?

In other words, what is the definition used by the application of what you call “physical disk”. Must it spin, or is any mass-storage device OK. ???

Hi
To make it think you have your iso image mounted as /dev/sr0 install cdemu client and daemon (https://cdemu.sourceforge.io/).

I have just popped the ISO image of Leap 15.2 into a USB port, clicked on Removeable devices manager in LXQT which prompted it to load Konqueror which gave me access to all the files as in a normal directory.

Hi
AFAIK, the game is looking for a /dev/srN (eg cd/dvd) and the files, not a loopback device (check the output from lsblk);


llsblk | grep sr0


cdemu-daemon 
Starting CDEmu daemon with following parameters:
 - num devices: 1
 - control device: /dev/vhba_ctl
 - audio driver: null
 - bus type: session
 - default CDEmu debug mask: 0x0
 - default libMirage debug mask: 0x0

 lsblk | grep sr0
sr0          11:0    1  1024M  0 rom

I concur that cdemu is the way to go for this. A basic guide…
https://www.unixmen.com/cdemu-virtual-cddvd-drive-linux/
Available from the openSUSE OSS repo, so install with…

zypper in gcdemu cdemu-client

I put the System Rescue ISO into the DVD drive and clicked on Open in File Manager and this time PCManFM opened up. Either way all the files are accessible.

lsblk | grep sr0
sr0     11:0    1   871M  0 rom  /run/media/john/SYSRCD602

Hi
Yes, but AFAICT it’s not the OP’s issue, likely a drm issue where it needs a physical drive and media to directly read the device (/dev/sr0) rather than files/mount point.

Hi
Yes, but AFAICT it’s not the OP’s issue, likely a drm issue where it needs a physical drive and media to directly read the device (/dev/sr0) rather than files/mount point. The OP does not want to burn any media :wink:

OT, excellent thread title.:wink:

Burn CDRW/DVDRW disks instead of CDR/DVDR.
You may rewrite CDRW/DVDRW disks about 1000 times (and even more with DVD-RAM).
8 cm disks are also available.

…or just use cdemu as already proposed.

Thanks! That’s a significant help.

Hey all -

Thanks to all who responded, and cdemu filled the bill; the difficulty arose because certain programmes wish to mount media in their own way rather than simply being pointed at a filesystem.

Thanks!

It’s most likely a drm issue, as it requires a physical drive and media to read the device directly.