]> git.ipfire.org Git - thirdparty/util-linux.git/blob - mount/losetup.8
Imported from util-linux-2.10s tarball.
[thirdparty/util-linux.git] / mount / losetup.8
1 .TH LOSETUP 8 "Nov 24 1993" "Linux" "MAINTENANCE COMMANDS"
2 .SH NAME
3 losetup \- set up and control loop devices
4 .SH SYNOPSIS
5 .ad l
6 .B losetup
7 [
8 .B \-e
9 .I encryption
10 ] [
11 .B \-o
12 .I offset
13 ]
14 .I loop_device file
15 .br
16 .B losetup
17 [
18 .B \-d
19 ]
20 .I loop_device
21 .ad b
22 .SH DESCRIPTION
23 .B losetup
24 is used to associate loop devices with regular files or block devices,
25 to detach loop devices and to query the status of a loop device. If only the
26 \fIloop_device\fP argument is given, the status of the corresponding loop
27 device is shown.
28 .SH OPTIONS
29 .IP \fB\-d\fP
30 detach the file or device associated with the specified loop device.
31 .IP "\fB\-e \fIencryption\fP"
32 .RS
33 enable data encryption. The following keywords are recognized:
34 .IP \fBNONE\fP
35 use no encryption (default).
36 .PD 0
37 .IP \fBXOR\fP
38 use a simple XOR encryption.
39 .IP \fBDES\fP
40 use DES encryption. DES encryption is only available if the optional
41 DES package has been added to the kernel. DES encryption uses an additional
42 start value that is used to protect passwords against dictionary
43 attacks.
44 .PD
45 .RE
46 .IP "\fB\-o \fIoffset\fP"
47 the data start is moved \fIoffset\fP bytes into the specified file or
48 device.
49 .SH RETURN VALUE
50 .B losetup
51 returns 0 on success, nonzero on failure. When
52 .B losetup
53 displays the status of a loop device, it returns 1 if the device
54 is not configured and 2 if an error occurred which prevented
55 .B losetup
56 from determining the status of the device.
57
58 .SH FILES
59 .nf
60 /dev/loop0,/dev/loop1,... loop devices (major=7)
61 .fi
62 .SH EXAMPLE
63 If you are using the loadable module you must have the module loaded
64 first with the command
65 .IP
66 # insmod loop.o
67 .LP
68 The following commands can be used as an example of using the loop device.
69 .nf
70 .IP
71 dd if=/dev/zero of=/file bs=1k count=100
72 losetup -e des /dev/loop0 /file
73 Password:
74 Init (up to 16 hex digits):
75 mkfs -t ext2 /dev/loop0 100
76 mount -t ext2 /dev/loop0 /mnt
77 ...
78 umount /dev/loop0
79 losetup -d /dev/loop0
80 .fi
81 .LP
82 If you are using the loadable module you may remove the module with
83 the command
84 .IP
85 # rmmod loop
86 .LP
87 .fi
88 .SH RESTRICTION
89 DES encryption is painfully slow. On the other hand, XOR is terribly weak.
90 .SH AUTHORS
91 .nf
92 Original version: Theodore Ts'o <tytso@athena.mit.edu>
93 Original DES by: Eric Young <eay@psych.psy.uq.oz.au>
94 .fi