Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Create a virtual CD/DVD using an image on Linux (See related posts)

On Linux, if you have an ISO file and need to create a virtual CD/DVD, just run the command below.

dd if=/dev/cdrom of=/directory/filename.iso

mount -o loop /directory/filename.iso /mountpoint/

Comments on this post

Thempleton posts on Nov 04, 2008 at 23:12
You should specify that the first command copies the content of a CD-R to the file at /directory/filename.iso overwriting it if already existent.
This is dangerous if you are attempting what the title of this snippet aims to be able to, due to the fact the to be virtualized iso file will be lost by the use of this command (the length will be zeroed or the file overwritten with the content of the CD-R).

Beware! use the first command to create the iso file only!

The second command only mounts the iso file as a virtual CD/DVD. So if you already have the iso file to virtualize use the second command only and never use the first one!

Regards

You need to create an account or log in to post comments to this site.