This is how to mount an ISO image. Actually, it can be used for other images as
well. See the note at the end of this article for details.
If you have just created an ISO
image, say with mkisofs, there is a way to mount the image and view it without creating a
CD ROM. Let's assume you have an ISO image named image.iso and it resides
in the current directory.
vnconfig /dev/vn0c ./image.iso
mount -t cd9660 /dev/vn0c /cdrom
When you're finished with the image, here's how you reverse the above:
vnconfig -u /dev/vn0c
Thanks to Odinn for asking about this and to blackend for coming up with it.
FreeBSD >= 5.x
As pointed out by Jim Salter in his comment
and by Irritum Nihil via email, the above became deprecated in FreeBSD 5.x. Instead, you should do this:
mdconfig -a -t vnode -f /path/to/image.iso -u 1
mount -t cd9660 /dev/md1 /mnt/cdrom
To reverse the process:
mount -u /mnt/cdrom
mdconfig -d -u 1
In all cases....
NOTE: Once mounted, you cannot write to your ISO image. ISO images are readonly
by design. If you want to change what is in your ISO image, use mkisofs.
If you didn't create the ISO, then you could mount the image, copy everything from the image to
disk, then use mkisofs to create a new ISO.