Merge branch 'upstream' into tizen
[platform/upstream/cryptsetup.git] / man / cryptsetup-open.8.adoc
1 = cryptsetup-open(8)
2 :doctype: manpage
3 :manmanual: Maintenance Commands
4 :mansource: cryptsetup {release-version}
5 :man-linkstyle: pass:[blue R < >]
6 :COMMON_OPTIONS:
7 :ACTION_OPEN:
8
9 == Name
10
11 cryptsetup-open, cryptsetup-create, cryptsetup-plainOpen, cryptsetup-luksOpen, cryptsetup-loopaesOpen, cryptsetup-tcryptOpen, cryptsetup-bitlkOpen, cryptsetup-fvault2Open - open an encrypted device and create a mapping with a specified name
12
13 == SYNOPSIS
14
15 *cryptsetup _open_ --type <device_type> [<options>] <device> <name>*
16
17 == DESCRIPTION
18 Opens (creates a mapping with) <name> backed by device <device>.
19
20 Device type can be _plain_, _luks_ (default), _luks1_, _luks2_,
21 _loopaes_ or _tcrypt_.
22
23 For backward compatibility there are *open* command aliases:
24
25 *create* (argument-order <name> <device>): open --type plain +
26 *plainOpen*: open --type plain +
27 *luksOpen*: open --type luks +
28 *loopaesOpen*: open --type loopaes +
29 *tcryptOpen*: open --type tcrypt +
30 *bitlkOpen*: open --type bitlk
31
32 *<options>* are type specific and are described below for individual
33 device types. For *create*, the order of the <name> and <device> options
34 is inverted for historical reasons, all other aliases use the standard
35 *<device> <name>* order.
36
37 === PLAIN
38 *open --type plain <device> <name>* +
39 plainOpen <device> <name> (*old syntax*) +
40 create <name> <device> (*OBSOLETE syntax*)
41
42 Opens (creates a mapping with) <name> backed by device <device>.
43
44 *<options>* can be [--hash, --cipher, --verify-passphrase, --sector-size,
45 --key-file, --keyfile-size, --keyfile-offset, --key-size, --offset,
46 --skip, --device-size, --size, --readonly, --shared, --allow-discards,
47 --refresh, --timeout, --verify-passphrase, --iv-large-sectors].
48
49 Example: 'cryptsetup open --type plain /dev/sda10 e1' maps the raw
50 encrypted device /dev/sda10 to the mapped (decrypted) device
51 /dev/mapper/e1, which can then be mounted, fsck-ed or have a filesystem
52 created on it.
53
54 === LUKS
55 *open <device> <name>* +
56 open --type <luks1|luks2> <device> <name> (*explicit version request*) +
57 luksOpen <device> <name> (*old syntax*)
58
59 Opens the LUKS device <device> and sets up a mapping <name> after
60 successful verification of the supplied passphrase.
61
62 First, the passphrase is searched in LUKS2 tokens unprotected by PIN.
63 If such token does not exist (or fails to unlock keyslot) and
64 also the passphrase is not supplied via --key-file, the command
65 prompts for passphrase interactively.
66
67 If there is valid LUKS2 token but it requires PIN to unlock assigned keyslot,
68 it is not used unless one of following options is added: --token-only,
69 --token-type where type matches desired PIN protected token or --token-id with id
70 matching PIN protected token.
71
72 *<options>* can be [--key-file, --keyfile-offset, --keyfile-size,
73 --readonly, --test-passphrase, --allow-discards, --header, --key-slot,
74 --volume-key-file, --token-id, --token-only, --token-type,
75 --disable-external-tokens, --disable-keyring, --disable-locks, --type,
76 --refresh, --serialize-memory-hard-pbkdf, --unbound, --tries, --timeout,
77 --verify-passphrase, --persistent].
78
79 === loopAES
80 *open --type loopaes <device> <name> --key-file <keyfile>* +
81 loopaesOpen <device> <name> --key-file <keyfile> (*old syntax*)
82
83 Opens the loop-AES <device> and sets up a mapping <name>.
84
85 If the key file is encrypted with GnuPG, then you have to use
86 --key-file=- and decrypt it before use, e.g., like this: +
87 gpg --decrypt <keyfile> | cryptsetup loopaesOpen --key-file=- <device>
88 <name>
89
90 *WARNING:* The loop-AES extension cannot use the direct input of the key
91 file on the real terminal because the keys are separated by end-of-line and
92 only part of the multi-key file would be read. +
93 If you need it in script, just use the pipe redirection: +
94 echo $keyfile | cryptsetup loopaesOpen --key-file=- <device> <name>
95
96 Use *--keyfile-size* to specify the proper key length if needed.
97
98 Use *--offset* to specify device offset. Note that the units need to be
99 specified in number of 512 byte sectors.
100
101 Use *--skip* to specify the IV offset. If the original device used an
102 offset and but did not use it in IV sector calculations, you have to
103 explicitly use *--skip 0* in addition to the offset parameter.
104
105 Use *--hash* to override the default hash function for passphrase
106 hashing (otherwise it is detected according to key size).
107
108 *<options>* can be [--cipher, --key-file, --keyfile-size, --keyfile-offset,
109 --key-size, --offset, --skip, --hash, --readonly, --allow-discards, --refresh].
110
111 === TrueCrypt and VeraCrypt
112 *open --type tcrypt <device> <name>* +
113 tcryptOpen <device> <name> (*old syntax*)
114
115 Opens the TCRYPT (TrueCrypt and VeraCrypt compatible) <device> and sets
116 up a mapping <name>.
117
118 *<options>* can be [--key-file, --tcrypt-hidden, --tcrypt-system,
119 --tcrypt-backup, --readonly, --test-passphrase, --allow-discards,
120 --veracrypt (ignored), --disable-veracrypt, --veracrypt-pim,
121 --veracrypt-query-pim, --header,
122 --cipher, --hash, --tries, --timeout, --verify-passphrase].
123
124 The keyfile parameter allows a combination of file content with the
125 passphrase and can be repeated. Note that using keyfiles is compatible
126 with TCRYPT and is different from LUKS keyfile logic.
127
128 If *--cipher* or *--hash* options are used, only cipher chains or PBKDF2
129 variants with the specified hash algorithms are checked. This could
130 speed up unlocking the device (but also it reveals some information
131 about the container).
132
133 If you use *--header* in combination with hidden or system options, the
134 header file must contain specific headers on the same positions as the
135 original encrypted container.
136
137 *WARNING:* Option *--allow-discards* cannot be combined with option
138 *--tcrypt-hidden*. For normal mapping, it can cause the *destruction of
139 hidden volume* (hidden volume appears as unused space for outer volume
140 so this space can be discarded).
141
142 === BitLocker
143 *open --type bitlk <device> <name>* +
144 bitlkOpen <device> <name> (*old syntax*)
145
146 Opens the BITLK (a BitLocker compatible) <device> and sets up a mapping
147 <name>.
148
149 *<options>* can be [--key-file, --keyfile-offset, --keyfile-size, --key-size,
150 --readonly, --test-passphrase, --allow-discards --volume-key-file, --tries,
151 --timeout, --verify-passphrase].
152
153 === FileVault2
154 *open --type fvault2 <device> <name>* +
155 fvault2Open <device> <name> (*old syntax*)
156
157 Opens the FVAULT2 (a FileVault2 compatible) <device> and sets up a mapping
158 <name>.
159
160 *<options>* can be [--key-file, --keyfile-offset, --keyfile-size, --key-size,
161 --readonly, --test-passphrase, --allow-discards --volume-key-file, --tries,
162 --timeout, --verify-passphrase].
163
164 include::man/common_options.adoc[]
165 include::man/common_footer.adoc[]