Mounting an iso file

FreeBSD >= 6.x

As of FreeBSD 5.x there is a new way to mount an iso file.  You might be wondering why  I have only tried this on FreeBSD 6.x and above.

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.