partition

package
v0.4.5-alpha1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPartitionFound = errors.New("no partition found after partition creation")

Functions

func CreatePartitionTable

func CreatePartitionTable(rootDevice string) error

func DeletePartition

func DeletePartition(rootDevice string, number int) error

rootDevice - root device, e.g. /dev/sda

number - partition number, e.g. 1

func FormatPartition

func FormatPartition(partitionDevice string) error

partitionDevice - partition device, e.g. /dev/sda1

func GetDevicePath

func GetDevicePath(uuid string) (string, error)

func ProbePartition

func ProbePartition(device string) error

inform the operating system about partition table changes

Types

type Partition

type Partition struct {
	LSBLKProperties map[string]string
	PARTXProperties map[string]string
}

func AddPartition

func AddPartition(rootDevice string) ([]Partition, error)

rootDevice - root device, e.g. /dev/sda

func GetPartitions

func GetPartitions(path string) ([]Partition, error)

path - device path, e.g. /dev/sda

Jump to

Keyboard shortcuts

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