partition

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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