Print View

Mount Images With mdconfig
Created: 02/19/2007


General Information

This guide explains how to mount a floppy image and/or a CD-Rom ISO using mdconfig.

Requirements

  1. Root access.
  2. A floppy image or a CD-Rom ISO.

Usage

Mounting a floppy image

To mount a floppy image, create a virtual device, /dev/md0, for the floppy image.
# mdconfig -a -t vnode -f /tmp/boot.flp -u 0
Now mount the virtual device.
# mount /dev/mnt0 /mnt

Mouting a CD-Rom ISO

To mount a CD-Rom ISO, create a virtual device, /dev/md0, for the CD-Rom ISO.
# mdconfig -a -t vnode -f /tmp/cdrom.iso -u 0
Now mount the virtual device.
# mount_cd9660 /dev/mnt0 /mnt

Unmounting and Deleting a Virtual Device

To unmount and delete a virtual device, first unmount the virtual device.
# umount /mnt
Then delete the virtual device, /dev/md0.
# mdconfig -d -u 0

Author: Jared Barneck
jared at bsdcertification dot com

Find this guide useful?
Support the author:



5 Comments

Posted by vermaden on February 25, 2007 at 5:54:22 pm EET

I just use simple loop.sh script for that:

#! /bin/sh
dev_node=`mdconfig -a -t vnode -f ${1}`
mount_cd9660 /dev/${dev_node} ${2}


usage: # loop.sh file.iso /mnt

after you have finished work with it just unmount it: # umount /mnt

works both for floppy and cdrom images.


Posted by mk on March 14, 2007 at 7:26:13 am EET

Pls show me my wrong :
dhcppc0# loop.sh /home/mk/FC-One-20070121.iso
/bin/loop.sh: Permission denied.
dhcppc0# chown root:wheel /bin/loop.sh
dhcppc0# chmod +x /bin/loop.sh
dhcppc0# loop.sh /home/mk/FC-One-20070121.iso
usage: mount_cd9660 [-begjrv] [-C charset] [-o options] [-s startsector]
                    special node
HOWTO fix this? Thanks.


Posted by Jon on March 15, 2007 at 4:27:43 am EET

dhcppc0# loop.sh /home/mk/FC-One-20070121.iso
usage: mount_cd9660 [-begjrv] [-C charset] [-o options] [-s startsector]
                    special node


You need to specify where you want to mount the image, for example:

dhcppc0# loop.sh /home/mk/FC-One-20070121.iso /mnt


Posted by vermaden on March 27, 2007 at 2:04:19 am EEST

/bin/loop.sh: Permission denied.

... and You need to have rights to mount, You can use security/sudo for that, like that for example:

% sudo loop.sh FC-One-20070121.iso /mnt


Posted by mk on March 28, 2007 at 1:33:49 am EEST

Thanks a lot! Now I can mount *.iso files!
mk


Copyright 2003 - 2008 BSD Guides.  All rights reserved.

About | Terms of Use | Privacy | Contact