You are not logged in.

#1 2009-01-12 20:22:25

fflarex
Member
Registered: 2007-09-15
Posts: 466

how to create a virtual disc drive?

I need to get my computer to treat an ISO image as if it's a physical optical drive. I've tried mounting it via loop devices, which is very useful, but it's not enough (basically, I need programs to be able to find it as a device, not a mounted filesystem). Any ideas?

Last edited by fflarex (2009-01-12 20:32:28)

Offline

#2 2009-01-12 20:33:43

Cheesebaron
Member
From: Denmark
Registered: 2008-10-31
Posts: 65
Website

Re: how to create a virtual disc drive?

You could create an empty file with dd like this:

dd if=/dev/zero of=disk-image count=40960

That will create a 20 MB file
Then you can format it with a file system:

/sbin/mkfs -t ext3 -q disk-image

Tell it to proceed even if it is not a block specific device.
Mount it and you have a virtual disc drive.

mount -o loop disk-image fs

I borrowed this from here:
http://freshmeat.net/articles/view/1387/

Last edited by Cheesebaron (2009-01-12 20:36:18)

Offline

#3 2009-01-12 20:40:40

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: how to create a virtual disc drive?

What do you mean "which is very useful, but it's not enough"? What are you trying to do exactly and why isn't mounting it good enough?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2009-01-12 20:43:23

Cheesebaron
Member
From: Denmark
Registered: 2008-10-31
Posts: 65
Website

Re: how to create a virtual disc drive?

I think he wants to write to the ISO or a similar file while it's mounted, or that is at least my interpretation.

Last edited by Cheesebaron (2009-01-12 20:43:51)

Offline

#5 2009-01-12 21:07:19

fflarex
Member
Registered: 2007-09-15
Posts: 466

Re: how to create a virtual disc drive?

I want programs to see it as if it is a actual, physical disk drive like /dev/cdrom, not a filesystem under /mnt or /media (for programs that automatically look for such drives but don't let me specify them manually). Cheesebaron's instructions are interesting and might be useful for something else (I may use it to test ext4), but not exactly what I'm looking for. I found similar programs that are available for windows (daemon tools and alcohol 120% came up in google searches), but it seems like this feature should be built in to linux (like nearly every other feature of those programs).

Last edited by fflarex (2009-01-12 21:10:29)

Offline

#6 2009-01-12 21:33:33

fflarex
Member
Registered: 2007-09-15
Posts: 466

Re: how to create a virtual disc drive?

I found what I needed in cdemu (cdemu-daemon and cdemu-client from the community repo). I'll probably add this to the wiki later today, along with mounting loop devices too.

Offline

#7 2009-01-12 22:46:59

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: how to create a virtual disc drive?

Can I ask, what is the benefit of this? As far as I know they are treated the same. The /media/cdrom is created from the /dev/ entry. When mounting an ISO you are just cutting out the need for the /dev/ entry yet for some reason you want it there. Why?


neutral

Offline

#8 2009-01-13 00:14:17

Diaz
Member
From: Portugal
Registered: 2008-04-16
Posts: 366

Re: how to create a virtual disc drive?

AcetoneIso is the answer your looking for.

Offline

Board footer

Powered by FluxBB