disktool

package
v0.3.9-2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// MB_SECTORS = 2048 // 1MiB = 2014 sectors
	GPT_SECTORS = 34

	RAID_DRVIER    = "raid"
	NONRAID_DRIVER = "nonraid"
	PCIE_DRIVER    = "pcie"

	LABEL_MSDOS = "msdos"
	LABEL_GPT   = "gpt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskPartitions

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

func (*DiskPartitions) CreatePartition

func (ps *DiskPartitions) CreatePartition(sizeMB int64, fs string, doformat bool, uuid string) error

func (*DiskPartitions) DebugString

func (ps *DiskPartitions) DebugString() string

func (*DiskPartitions) FsToTypeCode

func (ps *DiskPartitions) FsToTypeCode(fs string) string

func (*DiskPartitions) GPTEndSector

func (ps *DiskPartitions) GPTEndSector() int64

func (*DiskPartitions) GetDev

func (p *DiskPartitions) GetDev() string

func (*DiskPartitions) GetDevName

func (ps *DiskPartitions) GetDevName() string

func (*DiskPartitions) GetPartitions

func (ps *DiskPartitions) GetPartitions() []*Partition

func (*DiskPartitions) IsRaidDriver

func (p *DiskPartitions) IsRaidDriver() bool

func (*DiskPartitions) IsReady

func (ps *DiskPartitions) IsReady() bool

func (*DiskPartitions) IsSpaceAvailable

func (ps *DiskPartitions) IsSpaceAvailable(sizeMB int64) bool

func (*DiskPartitions) MBSectors

func (ps *DiskPartitions) MBSectors() int64

func (*DiskPartitions) MakeLabel

func (ps *DiskPartitions) MakeLabel() error

func (*DiskPartitions) ReInitInfo

func (p *DiskPartitions) ReInitInfo() error

func (*DiskPartitions) ResizePartition

func (ps *DiskPartitions) ResizePartition(offsetMB int64) error

func (*DiskPartitions) RetrievePartitionInfo

func (ps *DiskPartitions) RetrievePartitionInfo() error

func (*DiskPartitions) Run

func (ps *DiskPartitions) Run(cmd ...string) ([]string, error)

func (*DiskPartitions) SetInfo

func (p *DiskPartitions) SetInfo(info *types.SDiskInfo) *DiskPartitions

func (*DiskPartitions) String

func (ps *DiskPartitions) String() string

type IPartitionRunner

type IPartitionRunner interface {
	Run(cmds ...string) ([]string, error)
	Term() *ssh.Client
}

type Partition

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

func NewPartition

func NewPartition(
	disk *DiskPartitions,
	index int, bootable bool,
	start int64, end int64, count int64,
	diskType string, fs string, dev string,
) *Partition

func (*Partition) Format

func (p *Partition) Format(fs string, uuid string) error

func (*Partition) Fsck

func (p *Partition) Fsck() error

func (*Partition) GetDev

func (p *Partition) GetDev() string

func (*Partition) GetDisk

func (p *Partition) GetDisk() *DiskPartitions

func (*Partition) GetEnd

func (p *Partition) GetEnd() int64

func (*Partition) GetSizeMB

func (p *Partition) GetSizeMB() (int64, error)

func (*Partition) GetStart

func (p *Partition) GetStart() int64

func (*Partition) ResizeFs

func (p *Partition) ResizeFs() error

func (*Partition) ResizeXfs

func (p *Partition) ResizeXfs() error

func (*Partition) Run

func (p *Partition) Run(cmds ...string) ([]string, error)

func (*Partition) String

func (p *Partition) String() string

type PartitionTool

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

func NewPartitionTool

func NewPartitionTool(runner IPartitionRunner) *PartitionTool

func (*PartitionTool) CreatePartition

func (tool *PartitionTool) CreatePartition(diskIdx int, sizeMB int64, fs string, doformat bool, driver string, uuid string) error

func (*PartitionTool) DebugString

func (tool *PartitionTool) DebugString() string

func (*PartitionTool) Disks

func (tool *PartitionTool) Disks() []*DiskPartitions

func (*PartitionTool) FetchDiskConfs

func (tool *PartitionTool) FetchDiskConfs(diskConfs []baremetal.DiskConfiguration) *PartitionTool

func (*PartitionTool) GetDisks

func (tool *PartitionTool) GetDisks() []*DiskPartitions

func (*PartitionTool) GetPCIEDisks

func (tool *PartitionTool) GetPCIEDisks() []*DiskPartitions

func (*PartitionTool) GetPartitions

func (tool *PartitionTool) GetPartitions() []*Partition

func (*PartitionTool) GetRootDisk

func (tool *PartitionTool) GetRootDisk() *DiskPartitions

func (*PartitionTool) IsAllDisksReady

func (tool *PartitionTool) IsAllDisksReady() bool

func (*PartitionTool) ResizePartition

func (tool *PartitionTool) ResizePartition(diskIdx int, sizeMB int64) error

func (*PartitionTool) RetrieveDiskInfo

func (tool *PartitionTool) RetrieveDiskInfo() error

func (*PartitionTool) RetrievePartitionInfo

func (tool *PartitionTool) RetrievePartitionInfo() error

func (*PartitionTool) Run

func (tool *PartitionTool) Run(cmds ...string) ([]string, error)

type SSHPartitionTool

type SSHPartitionTool struct {
	*PartitionTool
	// contains filtered or unexported fields
}

func NewSSHPartitionTool

func NewSSHPartitionTool(term *ssh.Client, layouts []baremetal.Layout) (*SSHPartitionTool, error)

func (*SSHPartitionTool) Run

func (tool *SSHPartitionTool) Run(cmds ...string) ([]string, error)

func (*SSHPartitionTool) Term

func (tool *SSHPartitionTool) Term() *ssh.Client

Jump to

Keyboard shortcuts

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