partition

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package partition provides common utils for system partition format.

Package partition provides common utils for system partition format.

Index

Constants

View Source
const (
	MiB = 1024 * 1024

	EFISize      = 100 * MiB
	BIOSGrubSize = 1 * MiB
	BootSize     = 1000 * MiB
	MetaSize     = 1 * MiB
	StateSize    = 100 * MiB
)

Partition default sizes.

Variables

This section is empty.

Functions

func Format

func Format(devname string, t *FormatOptions) error

Format zeroes the device and formats it using filesystem type provided.

Types

type FileSystemType

type FileSystemType = string

FileSystemType is used to format partitions.

const (
	FilesystemTypeNone FileSystemType = "none"
	FilesystemTypeXFS  FileSystemType = "xfs"
	FilesystemTypeVFAT FileSystemType = "vfat"
)

Filesystem types.

type FormatOptions

type FormatOptions struct {
	Label          string
	PartitionType  Type
	FileSystemType FileSystemType
	Size           uint64
	Force          bool
}

FormatOptions contains format parameters.

func NewFormatOptions

func NewFormatOptions(label string) *FormatOptions

NewFormatOptions creates a new format options.

type Type

type Type = string

Type in partition table.

const (
	EFISystemPartition  Type = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
	BIOSBootPartition   Type = "21686148-6449-6E6F-744E-656564454649"
	LinuxFilesystemData Type = "0FC63DAF-8483-4772-8E79-3D69D8477DE4"
)

GPT partition types.

TODO: should be moved into the blockdevice library.

Jump to

Keyboard shortcuts

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