This section describes how to access a floppy or hard disk image within Linux
using the loop device. Why would you want to do this? Let's say you have made
a small Linux disk image for Bochs, and you want to install some more software
on it. You have already downloaded the software onto your real system, so now
you want to transfer it to the Bochs disk image. A fast way to transfer
the files is to mount the disk image using the loop device.
This section was contributed by Alexander Schuch.
The following example mounts a Windows 95 hard disk image called Windows 95 B (2031-16-63)
into the FreeBSD file system. It is specific to FreeBSD 5.x; for
hints on how to do the same task on FreeBSD 4.x, or for more information in
general, check the proper section of the FreeBSD handbook:
Network, Memory, and File-Backed File Systems.
You can use the same procedure for mounting floppy disk images.
# mdconfig -a -t vnode -f "Windows 95 B (2031-16-63)"
md0 |
mdconfig returns the device, your file now is accessable from.
# mount -t msdosfs /dev/md0s1 /mnt |
If you already have other md devices configured, you need to substitute md0s1
with, for example, md6s1.
Once you are done working with the image, unmount the md device and detach it.
# umount /mnt
# mdconfig -d -u 0 |
And again, if there are other md devices configured, use the proper device
number. In case you forgot the number, just ask
mdconfig, like:
# mdconfig -l
md7
# mdconfig -d -u 7 |