summaryrefslogtreecommitdiffstats
path: root/mount/mount.8
diff options
context:
space:
mode:
authorKarel Zak2010-03-15 17:10:35 +0100
committerKarel Zak2010-03-15 17:10:35 +0100
commite580266914734898999f652025f9c7141023df66 (patch)
treec2e96758fdc64e3a0a9f170466e8134f4a6ec95a /mount/mount.8
parentmount: more explicitly explain fstab usage in mount.8 (diff)
downloadkernel-qcow2-util-linux-e580266914734898999f652025f9c7141023df66.tar.gz
kernel-qcow2-util-linux-e580266914734898999f652025f9c7141023df66.tar.xz
kernel-qcow2-util-linux-e580266914734898999f652025f9c7141023df66.zip
mount: automatically detect and loop-mount regular files
This patch allows to automatically create a loop device from a regular file if a filesystem type is not specified, for example: mount /path/disk.img /mnt If the filesystem type is specified than "-o loop" is required. Note that there is not a restriction (on kernel side) that prevents regular file as a mount(2) source argument. A filesystem that is able to mount regular files could be implemented. Based on a patch from Adam Jackson <ajax@redhat.com>. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/mount.8')
-rw-r--r--mount/mount.836
1 files changed, 25 insertions, 11 deletions
diff --git a/mount/mount.8 b/mount/mount.8
index 07edb5c22..9675cc62d 100644
--- a/mount/mount.8
+++ b/mount/mount.8
@@ -2536,18 +2536,37 @@ Since Linux version 2.1.21 xiafs is no longer part of the kernel source.
.SH "THE LOOP DEVICE"
One further possible type is a mount via the loop device. For example,
the command
-
-.nf
-.B " mount /tmp/fdimage /mnt -t vfat -o loop=/dev/loop3
-.fi
-
+.RS
+.sp
+.B "mount /tmp/disk.img /mnt -t vfat -o loop=/dev/loop"
+.sp
+.RE
will set up the loop device
.I /dev/loop3
to correspond to the file
-.IR /tmp/fdimage ,
+.IR /tmp/disk.img ,
and then mount this device on
.IR /mnt .
+If no explicit loop device is mentioned
+(but just an option `\fB\-o loop\fP' is given), then
+.B mount
+will try to find some unused loop device and use that, for example
+.RS
+.sp
+.B "mount /tmp/disk.img /mnt -o loop"
+.sp
+.RE
+The mount command
+.B automatically
+creates a loop device from a regular file if a filesystem type is
+not specified, for example:
+.RS
+.sp
+.B "mount /tmp/disk.img /mnt"
+.sp
+.RE
+
This type of mount knows about four options, namely
.BR loop ", " offset ", " sizelimit " and " encryption ,
that are really options to
@@ -2555,11 +2574,6 @@ that are really options to
(These options can be used in addition to those specific
to the filesystem type.)
-If no explicit loop device is mentioned
-(but just an option `\fB\-o loop\fP' is given), then
-.B mount
-will try to find some unused loop device and use that.
-
Since Linux 2.6.25 is supported auto-destruction of loop devices and
then any loop device allocated by
.B mount