<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Loop_device</id>
	<title>Loop device - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Loop_device"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Loop_device&amp;action=history"/>
	<updated>2026-10-26T20:21:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Loop_device&amp;diff=2438481&amp;oldid=prev</id>
		<title>imported&gt;Wiiformii: /* top */ Typo fixing, typo(s) fixed: existant → existent</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Loop_device&amp;diff=2438481&amp;oldid=prev"/>
		<updated>2025-01-05T21:29:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;top: &lt;/span&gt; &lt;a href=&quot;/wiki143/index.php?title=WP:AWB/T&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:AWB/T (page does not exist)&quot;&gt;Typo fixing&lt;/a&gt;, &lt;a href=&quot;/wiki143/index.php?title=WP:AWB/T&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:AWB/T (page does not exist)&quot;&gt;typo(s) fixed&lt;/a&gt;: existant → existent&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Unix pseudo-device}}&lt;br /&gt;
In [[Unix-like]] operating systems, a &amp;#039;&amp;#039;&amp;#039;loop device&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;vnd&amp;#039;&amp;#039;&amp;#039; (vnode disk), or &amp;#039;&amp;#039;&amp;#039;lofi&amp;#039;&amp;#039;&amp;#039; (loop file interface) is a [[Device file#Pseudo-devices|pseudo-device]] that makes a [[computer file]] accessible as a [[Device file system#Block devices|block device]].&lt;br /&gt;
&lt;br /&gt;
Before use, a loop device must be connected to an existent file in the [[file system]]. The association provides the user with an application programming interface ([[API]]) that allows the file to be used in place of a block special file (cf. [[device file system]]). Thus, if the file contains an entire file system, the file may then be [[Mount (computing)|mounted]] as if it were a disk device.&lt;br /&gt;
&lt;br /&gt;
Files of this kind are often used for CD [[ISO image]]s and [[floppy disk]] images. Mounting a file containing a file system via such a &amp;#039;&amp;#039;&amp;#039;loop mount&amp;#039;&amp;#039;&amp;#039; makes the files within that file system accessible. They appear in the [[mount point]] directory.&lt;br /&gt;
&lt;br /&gt;
A loop device may allow some kind of data elaboration during this redirection. For example, the device may be the unencrypted version of an encrypted file. In such a case, the file associated with a loop device may be another pseudo-device. This is mostly useful when this device contains an encrypted file system. If supported, the loop device is in this case the decrypted version of the original encrypted file and can therefore be mounted as if it were a normal file system.&lt;br /&gt;
&lt;br /&gt;
==Uses of loop mounting==&lt;br /&gt;
After mounting a file that holds a file system, the files in that system can be accessed through the usual file system interface of the operating system, without any need for special functionality, such as reading and writing to ISO images, in applications.&lt;br /&gt;
&lt;br /&gt;
Loop mounting has several uses. It is a convenient method for managing and editing file system images offline, that are later used for normal system operation. This includes CD or DVD images or installation systems. It may be used to install an operating system onto a file system without repartitioning a disk. It also provides a permanent segregation of data, for example, when simulating removable media on a faster and more convenient hard disk or encapsulating encrypted file system.&lt;br /&gt;
&lt;br /&gt;
==Availability==&lt;br /&gt;
Various Unix-like operating systems provide the loop device functionality using different names.&lt;br /&gt;
&lt;br /&gt;
In Linux, device names are encoded in the symbol table entries of their corresponding device drivers. The device is called a &amp;quot;loop&amp;quot; device and device nodes are usually named &amp;#039;&amp;#039;/dev/loop0&amp;#039;&amp;#039;, &amp;#039;&amp;#039;/dev/loop1&amp;#039;&amp;#039;, etc. They can be created with [[makedev]] for the static device directory, dynamically by the facilities of the device file system ([[udev]]), or directly with [[mknod]]. The management user interface for the loop device is &amp;#039;&amp;#039;losetup&amp;#039;&amp;#039;, which is part of the package [[util-linux]].&lt;br /&gt;
&lt;br /&gt;
Sometimes, the loop device is erroneously referred to as [[loopback]] device, but this term is reserved for a networking device in operating systems. The concept of the &amp;#039;&amp;#039;loop&amp;#039;&amp;#039; device is distinct.&lt;br /&gt;
&lt;br /&gt;
In BSD-derived systems, such as [[NetBSD]] and [[OpenBSD]], the loop device is called &amp;quot;virtual node device&amp;quot; or &amp;quot;vnd&amp;quot;, and generally located at &amp;#039;&amp;#039;/dev/vnd0&amp;#039;&amp;#039;, &amp;#039;&amp;#039;/dev/rvnd0&amp;#039;&amp;#039; or &amp;#039;&amp;#039;/dev/svnd0&amp;#039;&amp;#039;, etc., in the file system. The program &amp;#039;&amp;#039;vnconfig&amp;#039;&amp;#039; is used for configuration.&lt;br /&gt;
&lt;br /&gt;
[[FreeBSD]] followed the same conventions as other BSD systems until release version 5, in which the loop device was incorporated into the memory disk driver (&amp;quot;md&amp;quot;). Configuration is now performed using the utility &amp;#039;&amp;#039;mdconfig&amp;#039;&amp;#039;.&amp;lt;ref&amp;gt;{{Cite web|url=https://www.freebsd.org/cgi/man.cgi?mdconfig|title=mdconfig|website=freebsd.org}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In [[Solaris (operating system)|Solaris]]/[[OpenSolaris]], the loop device is called &amp;quot;loopback file interface&amp;quot; or lofi,&amp;lt;ref&amp;gt;{{cite web |url=http://docs.sun.com/app/docs/doc/819-2254/lofi-7d |title=Man pages section 7: Device and Network Interfaces - Sun Microsystems |accessdate=2009-09-28 |url-status=dead |archiveurl=https://web.archive.org/web/20101230183509/http://docs.sun.com/app/docs/doc/819-2254/lofi-7d |archivedate=2010-12-30 }}&amp;lt;/ref&amp;gt; and located at &amp;#039;&amp;#039;/dev/lofi/1&amp;#039;&amp;#039;, etc. SunOS has the configuration program &amp;#039;&amp;#039;lofiadm&amp;#039;&amp;#039;. &amp;#039;&amp;#039;lofi&amp;#039;&amp;#039; supports read-only compression and read-write encryption. Available is also a 3rd-party driver &amp;#039;&amp;#039;fbk&amp;#039;&amp;#039; (&amp;#039;&amp;#039;File emulates Blockdevice&amp;#039;&amp;#039;), for SunOS/Solaris since summer 1988.&amp;lt;ref&amp;gt;{{Cite web|url=https://sourceforge.net/projects/schilytools/files/kernel/fbk/|title=Schily Tools - Browse /kernel/fbk at SourceForge.net|website=sourceforge.net}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[UnixWare]] includes a dynamically loadable device driver &amp;#039;&amp;#039;marry&amp;#039;&amp;#039;(7) and the utility &amp;#039;&amp;#039;marry&amp;#039;&amp;#039;(1M).&amp;lt;ref&amp;gt;{{Cite web|url=http://uw714doc.sco.com/en/FS_manager/fsD.marry.html|title=Using marry to create filesystem images on files|website=uw714doc.sco.com}}&amp;lt;/ref&amp;gt;  The marry driver allows a regular file to be treated as a device.  The regular file can be accessed through either a block device, &amp;#039;&amp;#039;/dev/marry/regfile&amp;#039;&amp;#039;, or as a character device, &amp;#039;&amp;#039;/dev/marry/rregfile&amp;#039;&amp;#039;. The command &amp;#039;&amp;#039;marry&amp;#039;&amp;#039; also supports encrypting and decrypting of the regular file.&lt;br /&gt;
&lt;br /&gt;
[[MacOS]] implements a native image mounting mechanism as part of its random access disk device abstraction. The command &amp;#039;&amp;#039;hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount &amp;lt;filename&amp;gt;&amp;#039;&amp;#039; causes a block device to appear in &amp;#039;&amp;#039;/dev&amp;#039;&amp;#039; as a regular disk device and subdevices for recognized partitions. Reads from and writes to those devices are sent to a user-mode helper process, which reads the data from the file or writes it to the file. In the user interface it is automatically activated by opening the disk image. MacOS can handle disk (.dmg or .iso), CD-ROM or DVD images in various formats.&lt;br /&gt;
&lt;br /&gt;
Loop mounting was not available on [[Microsoft Windows]] operating systems until {{nowrap|[[Windows 7]]}}, where this functionality is natively implemented, and available through the [[diskpart]] utility.&amp;lt;ref&amp;gt;{{Cite web|url=https://docs.microsoft.com/en-us/archive/blogs/7/|title=GES on Windows 7|website=docs.microsoft.com|date=25 September 2024 }}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite web|url=https://www.sevenforums.com/tutorials/2953-virtual-hard-drive-vhd-file-create-start-boot.html|title=Virtual Hard Drive VHD File - Create and Start with at Boot - Windows 7 Help Forums|website=sevenforums.com}}&amp;lt;/ref&amp;gt; However, the facility is often added using third-party applications such as &amp;#039;&amp;#039;[[Daemon Tools]]&amp;#039;&amp;#039; and &amp;#039;&amp;#039;[[Alcohol 120%]]&amp;#039;&amp;#039;. Freely-available tools from [http://www.vmware.com/download/eula/diskmount_ws_v55.html VMware (Disk Mount Utility)] and [http://www.ltr-data.se/opencode.html#ImDisk LTR Data (ImDisk)] can also be used to achieve similar functionality. Under Windows XP and Vista it is also possible to use the virtual hard disk feature by adding some component from Microsoft Virtual Server 2005 R2.&amp;lt;ref&amp;gt;{{Cite web|url=https://www.tech-recipes.com/rx/3595/windows-xpvista-how-to-attach-a-vhd-file/|title=Windows XP/Vista: How to Attach a VHD File|date=November 12, 2008|website=Tech-Recipes: A Cookbook Full of Tech Tutorials}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In [[A2 (operating system)|A2]], formerly AOS then Bluebottle, a file-based virtual disk is created with &amp;#039;&amp;#039;VirtualDisks.Create&amp;#039;&amp;#039;.  A file system can be installed in such a &amp;quot;disk&amp;quot; with &amp;#039;&amp;#039;VirtualDisks.Install&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Mounting a file containing a disk image on a directory requires two steps:&lt;br /&gt;
# association of the file with a loop [[device node]],&lt;br /&gt;
# mounting of the loop device at a mount point directory&lt;br /&gt;
&lt;br /&gt;
These two operations can be performed either using two separate commands, or through special flags to the mount command. The first operation may be performed by programs such as &amp;#039;&amp;#039;losetup&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;{{Cite web|url=https://man7.org/linux/man-pages/man8/losetup.8.html|title=UNIX Manual Page: man 8 losetup|website=man7.org}}&amp;lt;/ref&amp;gt; in [[Linux]], or &amp;#039;&amp;#039;lofiadm&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;[http://docs.sun.com/app/docs/doc/819-2240/lofiadm-1m?a=view lofiadm, Sun System Administration Command manual] {{webarchive|url=https://web.archive.org/web/20090502024151/http://docs.sun.com/app/docs/doc/819-2240/lofiadm-1m?a=view |date=2009-05-02 }}&amp;lt;/ref&amp;gt; in SunOS. As an example, if &amp;lt;code&amp;gt;example.img&amp;lt;/code&amp;gt; is a regular file containing a file system and &amp;lt;code&amp;gt;/home/you/dir&amp;lt;/code&amp;gt; is a Linux user&amp;#039;s directory, the [[superuser]] (root) may mount the file on the directory by executing the following two commands:&lt;br /&gt;
 losetup /dev/loop0 example.img&lt;br /&gt;
 mount /dev/loop0 /home/you/dir&lt;br /&gt;
&lt;br /&gt;
The second command mounts the device on the directory &amp;lt;code&amp;gt;/home/you/dir&amp;lt;/code&amp;gt;. The overall effect of executing these two commands is that the content of the file is used as a file system rooted at the mount point.&lt;br /&gt;
&lt;br /&gt;
To identify an available loop device for use in the above commands, the superuser (root) can use:&lt;br /&gt;
 losetup -f&lt;br /&gt;
&lt;br /&gt;
The mount utility is usually capable of handling the entire procedure:&lt;br /&gt;
 mount -o loop example.img /home/you/dir&lt;br /&gt;
&lt;br /&gt;
The device can then be unmounted with the following command:&lt;br /&gt;
 umount /home/you/dir&lt;br /&gt;
 # or, after finding the associated loop number by e.g. mount | grep &amp;quot;/home/you/dir&amp;quot; &lt;br /&gt;
 # or losetup -a | grep example.img&lt;br /&gt;
 umount /dev/loop&amp;lt;N&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At a lower level application programming interface ([[API]]), the association and disassociation of a file with a loop device is performed with the [[ioctl]] [[system call]] on a loop device.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Device file system]]&lt;br /&gt;
* [[Network block device]]&lt;br /&gt;
* [[cloop]]&lt;br /&gt;
* [[Disk image]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist|2}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://bochs.sourceforge.net/doc/docbook/user/loop-device-usage.html Mounting a disk image using the loop device] from the &amp;#039;&amp;#039;[[Bochs]] User Manual&amp;#039;&amp;#039;&lt;br /&gt;
* {{man|8|losetup|die.net}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Unix file system technology]]&lt;br /&gt;
[[Category:Linux kernel features]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Wiiformii</name></author>
	</entry>
</feed>