1 .TH LOSETUP 8 "2003-07-01" "Linux" "MAINTENANCE COMMANDS"
3 losetup \- set up and control loop devices
20 Print name of first unused loop device:
37 .RB { \-f | \fIloop_device\fP }
43 is used to associate loop devices with regular files or block devices,
44 to detach loop devices and to query the status of a loop device. If only the
45 \fIloop_device\fP argument is given, the status of the corresponding loop
49 It is possible to specify transfer functions (for encryption/decryption
50 or other purposes) using one of the
55 There are two mechanisms to specify the desired encryption: by number
56 and by name. If an encryption is specified by number then one
57 has to make sure that the Linux kernel knows about the encryption with that
58 number, probably by patching the kernel. Standard numbers that are
59 always present are 0 (no encryption) and 1 (XOR encryption).
60 When the cryptoloop module is loaded (or compiled in), it uses number 18.
61 This cryptoloop module wil take the name of an arbitrary encryption type
62 and finds the module that knows how to perform that encryption.
63 (Thus, either one uses a number different from 18 with the
65 option, or one uses a name with the
70 Detach the file or device associated with the specified loop device.
71 .IP "\fB\-E \fIencryption_type\fP"
72 Enable data encryption with specified number.
73 .IP "\fB\-e \fIencryption_name\fP"
74 Enable data encryption with specified name.
76 Find the first unused loop device. If a
78 argument is present, use this device. Otherwise, print its name.
79 .IP "\fB\-o \fIoffset\fP"
80 The data start is moved \fIoffset\fP bytes into the specified file or
82 .IP "\fB\-p \fInum\fP"
83 Read the passphrase from file descriptor with number
85 instead of from the terminal.
88 returns 0 on success, nonzero on failure. When
90 displays the status of a loop device, it returns 1 if the device
91 is not configured and 2 if an error occurred which prevented
93 from determining the status of the device.
97 /dev/loop0, /dev/loop1, ... loop devices (major=7)
100 If you are using the loadable module you must have the module loaded
101 first with the command
105 Maybe also encryption modules are needed.
108 # insmod cryptoloop.o
110 The following commands can be used as an example of using the loop device.
113 # dd if=/dev/zero of=/file bs=1k count=100
114 # losetup -e des /dev/loop0 /file
116 Init (up to 16 hex digits):
117 # mkfs -t ext2 /dev/loop0 100
118 # mount -t ext2 /dev/loop0 /mnt
121 # losetup -d /dev/loop0
124 If you are using the loadable module you may remove the module with
131 DES encryption is painfully slow. On the other hand, XOR is terribly weak.
134 .\" Original version: Theodore Ts'o <tytso@athena.mit.edu>
135 .\" Original DES by: Eric Young <eay@psych.psy.uq.oz.au>