REGISTER  


Linux virtual CD/DVD driver
This thread belongs to soger.forumgeeks.net


2009-04-13 09:24 GMT   |   #1

Comments: 14

I've been using Daemon tools under Windows XP to mount ISO images as virtual CD but now I would like an alternative under Linux, because I have a lot of movies stored in ISO images and I don't want to burn them to my rewritable DVD all the time. Any suggestion for a good alternative would be appreciated.

2009-04-14 23:16 GMT   |   #2

Comments: 42

Well, if you only have ISO images you don't really need anything to install anything. Linux has a so called loop device which makes a file accessible as if it were a block device. All you have to do is:

mount -tiso9660 -oloop filename.ISO /media/any_directory

And there you go, you have the device /dev/loop0 mounted.
But if you have CUE or NRG images you need to install a program. For example here is one (although I have to confess I have never tried it);

http://cdemu.sourceforge.net/

2009-04-16 07:13 GMT   |   #3

Comments: 14

Wow, thanks, that is pretty cool.

I just have one more question, I have to su myself to root every time I want to mount an ISO. Should I set the execution bit of /bin/mount ?

2009-04-18 23:26 GMT   |   #4

Comments: 42

Yes, why not, if you are sure you are the only one who uses your linux box, that is probably the most comfortable solution. However a system upgrade might remove the execution bit from /bin/mount so I recommend you to use sudo which gives you more control and a system upgrade will not affect your sudo settings. For example create a file like this:

root@linuxbox# nano /usr/local/bin/vcd

#!/usr/bin/perl
$file=shift;
exit exec "mount -tudf,iso9660 -oloop '$file' /mnt/vcd" if $file;
exit exec "umount /mnt/vcd";

Then you add execution rights to the file and you give yourself permission to run this script as root using visudo. Just add the line:

soger ALL=NOPASSWD: /usr/local/bin/vcd *

Of course replace soger with your usrname. And you are done.
To mount an image you just have to say:

sudo vcd filename.iso

no password will be asked. To umount say:

sudo vcd
I hope that's easy enough



Last edited by soger at 2009-04-21 12:09 GMT
2009-04-19 22:42 GMT   |   #5

Comments: 14

Thanks a lot,
LINUX ROCKS