mapper

package
v2.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mapper uses libcryptsetup to format and map crypt devices.

This is used by the disk-mapper to set up a node's state disk.

All interaction with libcryptsetup should be done here.

Warning: This package is not thread safe, since libcryptsetup is not thread safe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapper

type Mapper struct {
	// contains filtered or unexported fields
}

Mapper handles actions for formatting and mapping crypt devices.

func New

func New(path string, log *logger.Logger) (*Mapper, error)

New creates a new crypt device for the device at path.

func (*Mapper) Close

func (m *Mapper) Close() error

Close closes and frees memory allocated for the crypt device.

func (*Mapper) DiskUUID

func (m *Mapper) DiskUUID() string

DiskUUID gets the device's UUID.

func (*Mapper) FormatDisk

func (m *Mapper) FormatDisk(passphrase string) error

FormatDisk formats the disk and adds passphrase in keyslot 0.

func (*Mapper) IsLUKSDevice

func (m *Mapper) IsLUKSDevice() bool

IsLUKSDevice returns true if the device is formatted as a LUKS device.

func (*Mapper) MapDisk

func (m *Mapper) MapDisk(target, passphrase string) error

MapDisk maps a crypt device to /dev/mapper/target using the provided passphrase.

func (*Mapper) UnmapDisk

func (m *Mapper) UnmapDisk(target string) error

UnmapDisk removes the mapping of target.

func (*Mapper) Wipe

func (m *Mapper) Wipe(blockWipeSize int) error

Wipe overwrites the device with zeros to initialize integrity checksums.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL