partition

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 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(rootDevice string) ([]Partition, error)

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

Jump to

Keyboard shortcuts

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