← 返回命令列表

Linux command

cryptsetup-open 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Open

cryptsetup open [/dev/sdXY] [mapping_name]

Example

cryptsetup open -d [path/to/keyfile] [/dev/sdXY] [mapping_name]

Example

cryptsetup open --allow-discards [/dev/sdXY] [mapping_name]

Example

cryptsetup open --allow-discards --persistent [/dev/sdXY] [mapping_name]

Example

cryptsetup open -r [/dev/sdXY] [mapping_name]

说明

cryptsetup open creates a decrypted mapping of an encrypted LUKS volume. The decrypted device appears at /dev/mapper/mapping_name and can be used like any block device. After opening, the mapped device can be mounted or used with LVM, filesystem creation, etc.

参数

-d, --key-file _file_
Use keyfile instead of passphrase
--allow-discards
Allow TRIM/discard passthrough (for SSDs)
--persistent
Store options in LUKS header
-r, --readonly
Open in read-only mode
--type _type_
Specify device type (luks, luks1, luks2, plain, tcrypt, bitlk)

FAQ

What is the cryptsetup-open command used for?

cryptsetup open creates a decrypted mapping of an encrypted LUKS volume. The decrypted device appears at /dev/mapper/mapping_name and can be used like any block device. After opening, the mapped device can be mounted or used with LVM, filesystem creation, etc.

How do I run a basic cryptsetup-open example?

Run `cryptsetup open [/dev/sdXY] [mapping_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d, --key-file _file_ do in cryptsetup-open?

Use keyfile instead of passphrase