diff options
author | Karel Zak | 2016-08-17 12:28:33 +0200 |
---|---|---|
committer | Karel Zak | 2016-08-17 12:28:33 +0200 |
commit | 9a94b634a343e83bfa2a9d311074e3e520abdddd (patch) | |
tree | b1118ead3294be824b9fdbbf01449bb822aad4cf /sys-utils/losetup.8 | |
parent | tests: keep 'hppa' in fdisk/bsd test too (diff) | |
download | kernel-qcow2-util-linux-9a94b634a343e83bfa2a9d311074e3e520abdddd.tar.gz kernel-qcow2-util-linux-9a94b634a343e83bfa2a9d311074e3e520abdddd.tar.xz kernel-qcow2-util-linux-9a94b634a343e83bfa2a9d311074e3e520abdddd.zip |
losetup: add --nooverlap options
This patch introduces overlap detections and loop devices
re-use for losetup(8). We already support this feature for mount(8)
where it's enabled by default (because we mount filesystems and it's
always mistake to share the same filesystem between more loop
devices).
Stanislav has suggested to enable this feature also for losetup by
default. I'm not sure about it, IMHO it's better to keep losetup(8)
simple and stupid by default, and inform users about possible problems
and solutions in the man page.
The feature forces losetup to scan all loop devices always when new
one is requested. This maybe disadvantage (especially when we use
control-loop to avoid /sys or /dev scans) on system with huge number
of loop devices.
Co-Author: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/losetup.8')
-rw-r--r-- | sys-utils/losetup.8 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys-utils/losetup.8 b/sys-utils/losetup.8 index b614416df..805051290 100644 --- a/sys-utils/losetup.8 +++ b/sys-utils/losetup.8 @@ -67,6 +67,11 @@ device is shown. If no option is given, all loop devices are shown. .sp Note that the old output format (i.e. \fBlosetup -a\fR) with comma-delimited strings is deprecated in favour of the \fB--list\fR output format. +.sp +It's possible to create more independent loop devices for the same backing +file. +.B This setup may be dangerous, can cause data loss, corruption and overwrites. +Use \fB\-\-nooverlap\fR to avoid this problem. .SH OPTIONS The \fIsize\fR and \fIoffset\fR @@ -102,6 +107,12 @@ Find the first unused loop device. If a argument is present, use the found device as loop device. Otherwise, just print its name. .TP +.BR \-L , " \-\-nooverlap" +Check for conflicts between loop devices to avoid situation when the same +backing file is shared between more loop devices. If the file is already used +by another device then re-use the device rather than a new one. The option +makes sense only with \fB\-\-find\fP. +.TP .BR \-j , " \-\-associated " \fIfile Show the status of all loop devices associated with the given .IR file . |