<s>
In	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
a	O
loop	B-Application
device	I-Application
,	O
vnd	O
(	O
vnode	B-Application
disk	I-Application
)	O
,	O
or	O
lofi	O
(	O
loop	O
file	O
interface	O
)	O
is	O
a	O
pseudo-device	O
that	O
makes	O
a	O
computer	B-Operating_System
file	I-Operating_System
accessible	O
as	O
a	O
block	O
device	O
.	O
</s>
<s>
Before	O
use	O
,	O
a	O
loop	B-Application
device	I-Application
must	O
be	O
connected	O
to	O
an	O
extant	O
file	O
in	O
the	O
file	B-Application
system	I-Application
.	O
</s>
<s>
The	O
association	O
provides	O
the	O
user	O
with	O
an	O
application	O
programming	O
interface	O
(	O
API	B-General_Concept
)	O
that	O
allows	O
the	O
file	O
to	O
be	O
used	O
in	O
place	O
of	O
a	O
block	O
special	B-Application
file	I-Application
(	O
cf	O
.	O
</s>
<s>
device	B-Application
file	I-Application
system	O
)	O
.	O
</s>
<s>
Thus	O
,	O
if	O
the	O
file	O
contains	O
an	O
entire	O
file	B-Application
system	I-Application
,	O
the	O
file	O
may	O
then	O
be	O
mounted	B-Application
as	O
if	O
it	O
were	O
a	O
disk	O
device	O
.	O
</s>
<s>
Files	O
of	O
this	O
kind	O
are	O
often	O
used	O
for	O
CD	O
ISO	B-General_Concept
images	I-General_Concept
and	O
floppy	B-Device
disk	I-Device
images	O
.	O
</s>
<s>
Mounting	B-Application
a	O
file	O
containing	O
a	O
file	B-Application
system	I-Application
via	O
such	O
a	O
loop	O
mount	O
makes	O
the	O
files	O
within	O
that	O
file	B-Application
system	I-Application
accessible	O
.	O
</s>
<s>
A	O
loop	B-Application
device	I-Application
may	O
allow	O
some	O
kind	O
of	O
data	O
elaboration	O
during	O
this	O
redirection	O
.	O
</s>
<s>
In	O
such	O
a	O
case	O
,	O
the	O
file	O
associated	O
with	O
a	O
loop	B-Application
device	I-Application
may	O
be	O
another	O
pseudo-device	O
.	O
</s>
<s>
This	O
is	O
mostly	O
useful	O
when	O
this	O
device	O
contains	O
an	O
encrypted	O
file	B-Application
system	I-Application
.	O
</s>
<s>
If	O
supported	O
,	O
the	O
loop	B-Application
device	I-Application
is	O
in	O
this	O
case	O
the	O
decrypted	O
version	O
of	O
the	O
original	O
encrypted	O
file	O
and	O
can	O
therefore	O
be	O
mounted	B-Application
as	O
if	O
it	O
were	O
a	O
normal	O
file	B-Application
system	I-Application
.	O
</s>
<s>
After	O
mounting	B-Application
a	O
file	O
that	O
holds	O
a	O
file	B-Application
system	I-Application
,	O
the	O
files	O
in	O
that	O
system	O
can	O
be	O
accessed	O
through	O
the	O
usual	O
file	B-Application
system	I-Application
interface	O
of	O
the	O
operating	O
system	O
,	O
without	O
any	O
need	O
for	O
special	O
functionality	O
,	O
such	O
as	O
reading	O
and	O
writing	O
to	O
ISO	B-General_Concept
images	I-General_Concept
,	O
in	O
applications	O
.	O
</s>
<s>
Loop	O
mounting	B-Application
has	O
several	O
uses	O
.	O
</s>
<s>
It	O
is	O
a	O
convenient	O
method	O
for	O
managing	O
and	O
editing	O
file	B-Application
system	I-Application
images	O
offline	O
,	O
that	O
are	O
later	O
used	O
for	O
normal	O
system	O
operation	O
.	O
</s>
<s>
This	O
includes	O
CD	O
or	O
DVD	B-Application
images	I-Application
or	O
installation	O
systems	O
.	O
</s>
<s>
It	O
may	O
be	O
used	O
to	O
install	O
an	O
operating	O
system	O
onto	O
a	O
file	B-Application
system	I-Application
without	O
repartitioning	O
a	O
disk	O
.	O
</s>
<s>
It	O
also	O
provides	O
a	O
permanent	O
segregation	O
of	O
data	O
,	O
for	O
example	O
,	O
when	O
simulating	O
removable	O
media	O
on	O
a	O
faster	O
and	O
more	O
convenient	O
hard	O
disk	O
or	O
encapsulating	O
encrypted	O
file	B-Application
system	I-Application
.	O
</s>
<s>
Various	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
provide	O
the	O
loop	B-Application
device	I-Application
functionality	O
using	O
different	O
names	O
.	O
</s>
<s>
In	O
Linux	B-Application
,	O
device	B-Application
names	I-Application
are	O
encoded	O
in	O
the	O
symbol	O
table	O
entries	O
of	O
their	O
corresponding	O
device	O
drivers	O
.	O
</s>
<s>
The	O
device	O
is	O
called	O
a	O
"	O
loop	O
"	O
device	O
and	O
device	B-Application
nodes	I-Application
are	O
usually	O
named	O
/dev/loop0	O
,	O
/dev/loop1	O
,	O
etc	O
.	O
</s>
<s>
They	O
can	O
be	O
created	O
with	O
makedev	O
for	O
the	O
static	O
device	O
directory	O
,	O
dynamically	O
by	O
the	O
facilities	O
of	O
the	O
device	B-Application
file	I-Application
system	O
(	O
udev	B-Application
)	O
,	O
or	O
directly	O
with	O
mknod	O
.	O
</s>
<s>
The	O
management	O
user	O
interface	O
for	O
the	O
loop	B-Application
device	I-Application
is	O
losetup	B-Application
,	O
which	O
is	O
part	O
of	O
the	O
package	O
util-linux	B-Application
.	O
</s>
<s>
Sometimes	O
,	O
the	O
loop	B-Application
device	I-Application
is	O
erroneously	O
referred	O
to	O
as	O
loopback	B-Protocol
device	O
,	O
but	O
this	O
term	O
is	O
reserved	O
for	O
a	O
networking	O
device	O
in	O
operating	O
systems	O
.	O
</s>
<s>
The	O
concept	O
of	O
the	O
loop	B-Application
device	I-Application
is	O
distinct	O
.	O
</s>
<s>
In	O
BSD-derived	O
systems	O
,	O
such	O
as	O
NetBSD	B-Device
and	O
OpenBSD	B-Operating_System
,	O
the	O
loop	B-Application
device	I-Application
is	O
called	O
"	O
virtual	O
node	O
device	O
"	O
or	O
"	O
vnd	O
"	O
,	O
and	O
generally	O
located	O
at	O
/dev/vnd0	O
,	O
/dev/rvnd0	O
or	O
/dev/svnd0	O
,	O
etc.	O
,	O
in	O
the	O
file	B-Application
system	I-Application
.	O
</s>
<s>
FreeBSD	B-Operating_System
followed	O
the	O
same	O
conventions	O
as	O
other	O
BSD	O
systems	O
until	O
release	O
version	O
5	O
,	O
in	O
which	O
the	O
loop	B-Application
device	I-Application
was	O
incorporated	O
into	O
the	O
memory	O
disk	O
driver	O
(	O
"	O
md	O
"	O
)	O
.	O
</s>
<s>
In	O
Solaris/OpenSolaris	O
,	O
the	O
loop	B-Application
device	I-Application
is	O
called	O
"	O
loopback	B-Application
file	I-Application
interface	I-Application
"	O
or	O
lofi	O
,	O
and	O
located	O
at	O
/dev/lofi/1	O
,	O
etc	O
.	O
</s>
<s>
Available	O
is	O
also	O
a	O
3rd-party	O
driver	O
fbk	O
(	O
File	O
emulates	O
Blockdevice	O
)	O
,	O
for	O
SunOS/Solaris	O
since	O
summer	O
1988	O
.	O
</s>
<s>
UnixWare	B-Operating_System
includes	O
a	O
dynamically	O
loadable	O
device	O
driver	O
marry(7 )	O
and	O
the	O
utility	O
marry(1M )	O
.	O
</s>
<s>
The	O
regular	O
file	O
can	O
be	O
accessed	O
through	O
either	O
a	O
block	O
device	O
,	O
/dev/marry/regfile	O
,	O
or	O
as	O
a	O
character	O
device	O
,	O
/dev/marry/rregfile	O
.	O
</s>
<s>
MacOS	B-Application
implements	O
a	O
native	O
image	O
mounting	B-Application
mechanism	O
as	O
part	O
of	O
its	O
random	O
access	O
disk	O
device	O
abstraction	O
.	O
</s>
<s>
The	O
command	O
hdiutil	O
attach	O
-imagekey	O
diskimage-class	O
=	O
CRawDiskImage	O
-nomount	O
<filename>	O
causes	O
a	O
block	O
device	O
to	O
appear	O
in	O
/dev	B-Application
as	O
a	O
regular	O
disk	O
device	O
and	O
subdevices	O
for	O
recognized	O
partitions	O
.	O
</s>
<s>
In	O
the	O
user	O
interface	O
it	O
is	O
automatically	O
activated	O
by	O
opening	O
the	O
disk	B-Application
image	I-Application
.	O
</s>
<s>
MacOS	B-Application
can	O
handle	O
disk	O
(	O
.dmg	O
or	O
.iso	B-General_Concept
)	O
,	O
CD-ROM	O
or	O
DVD	B-Application
images	I-Application
in	O
various	O
formats	O
.	O
</s>
<s>
Loop	O
mounting	B-Application
was	O
not	O
available	O
on	O
Microsoft	B-Application
Windows	I-Application
operating	I-Application
systems	I-Application
until	O
,	O
where	O
this	O
functionality	O
is	O
natively	O
implemented	O
,	O
and	O
available	O
through	O
the	O
diskpart	B-Application
utility	O
.	O
</s>
<s>
However	O
,	O
the	O
facility	O
is	O
often	O
added	O
using	O
third-party	O
applications	O
such	O
as	O
Daemon	B-Application
Tools	I-Application
and	O
Alcohol	B-Application
120%	I-Application
.	O
</s>
<s>
In	O
A2	B-Application
,	O
formerly	O
AOS	O
then	O
Bluebottle	O
,	O
a	O
file-based	O
virtual	O
disk	O
is	O
created	O
with	O
VirtualDisks.Create	O
.	O
</s>
<s>
A	O
file	B-Application
system	I-Application
can	O
be	O
installed	O
in	O
such	O
a	O
"	O
disk	O
"	O
with	O
VirtualDisks.Install	O
.	O
</s>
<s>
Mounting	B-Application
a	O
file	O
containing	O
a	O
disk	B-Application
image	I-Application
on	O
a	O
directory	O
requires	O
two	O
steps	O
:	O
</s>
<s>
association	O
of	O
the	O
file	O
with	O
a	O
loop	B-Application
device	I-Application
node	O
,	O
</s>
<s>
The	O
first	O
operation	O
may	O
be	O
performed	O
by	O
programs	O
such	O
as	O
losetup	B-Application
in	O
Linux	B-Application
,	O
or	O
lofiadmlofiadm	O
,	O
Sun	O
System	O
Administration	O
Command	O
manual	O
in	O
SunOS	O
.	O
</s>
<s>
As	O
an	O
example	O
,	O
if	O
example.img	O
is	O
a	O
regular	O
file	O
containing	O
a	O
file	B-Application
system	I-Application
and	O
/home/you/dir	O
is	O
a	O
Linux	B-Application
user	O
's	O
directory	O
,	O
the	O
superuser	B-Application
(	O
root	O
)	O
may	O
mount	O
the	O
file	O
on	O
the	O
directory	O
by	O
executing	O
the	O
following	O
two	O
commands	O
:	O
</s>
<s>
The	O
overall	O
effect	O
of	O
executing	O
these	O
two	O
commands	O
is	O
that	O
the	O
content	O
of	O
the	O
file	O
is	O
used	O
as	O
a	O
file	B-Application
system	I-Application
rooted	O
at	O
the	O
mount	O
point	O
.	O
</s>
<s>
To	O
identify	O
an	O
available	O
loop	B-Application
device	I-Application
for	O
use	O
in	O
the	O
above	O
commands	O
,	O
the	O
superuser	B-Application
(	O
root	O
)	O
can	O
use	O
:	O
</s>
<s>
At	O
a	O
lower	O
level	O
application	O
programming	O
interface	O
(	O
API	B-General_Concept
)	O
,	O
the	O
association	O
and	O
disassociation	O
of	O
a	O
file	O
with	O
a	O
loop	B-Application
device	I-Application
is	O
performed	O
with	O
the	O
ioctl	B-Operating_System
system	B-Operating_System
call	I-Operating_System
on	O
a	O
loop	B-Application
device	I-Application
.	O
</s>
