I am mounting an iso file, and looking at this tutorial. They use the command:
I'm trying to understand the use of -o loop
. I have two questions:
When I look at the long man page for mount, it takes time to find that -o
option. If I do man mount | grep '-o'
I get and error, and when I look in the file I do not find info that 'loop' is a command text for option -o
. Where is that documented?
Select the disk or the disk's partition in the list on the left, then File → New → Disk Image from. Once the image is created, you can mount it like any other volume and if you selected read/write you can read/write to the image like a mounted volume. The image is mounted in the same place as the original disk would be: /Volumes.
Also, what is the 'loop device' concept for mounting?
3 Answers
loop device is a pseudo ('fake') device (actually just a file) that acts as a block-based device. You want to mount a file (disk1.iso) that will act as entire filesystem, so you use loop.
The -o comes from the -options.
And the last thing, if you want to search for '-o' you need to escape the '-'. Try:
Traditionally, UNIX systems have had various types of nodes in their filesystems:
- directory
- file
- symlink
- block device
- character device
- FIFO
- UNIX domain socket
While there are now exceptions, generally block devices containing filesystems are mounted on directories.
Since you want to mount a file, you must first create a loop
block device that is backed by the file. This can be done using losetup
, but mount -o loop
is a shortcut that handles that behind the scenes.
Loop device is a device driver that allows you to mount a file act as a block device ( loop device is not actually device type.it's an ordinary file ). For example : file :demo.img
You can now look at the /mnt/DEMO
subdirectory for the contents of the demo