cryptsetup API
Public cryptsetup API
|
Macros | |
#define | CRYPT_WIPE_NO_DIRECT_IO (UINT32_C(1) << 0) |
Enumerations | |
enum | crypt_wipe_pattern { CRYPT_WIPE_ZERO , CRYPT_WIPE_RANDOM , CRYPT_WIPE_ENCRYPTED_ZERO , CRYPT_WIPE_SPECIAL } |
enum | { CRYPT_LUKS2_SEGMENT = -2 , CRYPT_NO_SEGMENT = -1 } |
Functions | |
int | crypt_wipe (struct crypt_device *cd, const char *dev_path, crypt_wipe_pattern pattern, uint64_t offset, uint64_t length, size_t wipe_block_size, uint32_t flags, int(*progress)(uint64_t size, uint64_t offset, void *usrptr), void *usrptr) |
int | crypt_wipe_hw_opal (struct crypt_device *cd, int segment, const char *password, size_t password_size, uint32_t flags) |
#define CRYPT_WIPE_NO_DIRECT_IO (UINT32_C(1) << 0) |
Use direct-io
enum crypt_wipe_pattern |
int crypt_wipe | ( | struct crypt_device * | cd, |
const char * | dev_path, | ||
crypt_wipe_pattern | pattern, | ||
uint64_t | offset, | ||
uint64_t | length, | ||
size_t | wipe_block_size, | ||
uint32_t | flags, | ||
int(*)(uint64_t size, uint64_t offset, void *usrptr) | progress, | ||
void * | usrptr | ||
) |
Wipe/Fill (part of) a device with the selected pattern.
cd | crypt device handle |
dev_path | path to device to wipe or NULL if data device should be used |
pattern | selected wipe pattern |
offset | offset on device (in bytes) |
length | length of area to be wiped (in bytes) |
wipe_block_size | used block for wiping (one step) (in bytes) |
flags | wipe flags |
progress | callback function called after each wipe_block_size or NULL |
usrptr | provided identification in callback |
int crypt_wipe_hw_opal | ( | struct crypt_device * | cd, |
int | segment, | ||
const char * | password, | ||
size_t | password_size, | ||
uint32_t | flags | ||
) |
Safe erase of a partition or an entire OPAL device. WARNING: ALL DATA ON PARTITION/DISK WILL BE LOST. If the CRYPT_NO_SEGMENT is passed as the segment parameter, the entire device will be wiped, not just what is included in the LUKS2 device/partition.
cd | crypt device handle |
segment | the segment number to wipe (0..8), or CRYPT_LUKS2_SEGMENT to wipe the segment configured in the LUKS2 header, or CRYPT_NO_SEGMENT to wipe the entire device via a factory reset. |
password | admin password/PSID (for factory reset) to wipe the partition/device |
password_size | length of password/PSID |
flags | (currently unused) |