Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertFromBytesToMb(sizeInBytes uint64) uint64
- func ConvertFromKbToBytes(sizeInKb uint64) uint64
- func ConvertFromMbToBytes(sizeInMb uint64) uint64
- func IsGPTError(err error) bool
- func NewPartitionStrategy(retryable boshretry.Retryable, timeService clock.Clock, logger boshlog.Logger) boshretry.RetryStrategy
- type EphemeralDevicePartitioner
- func (p *EphemeralDevicePartitioner) GetDeviceSizeInBytes(devicePath string) (uint64, error)
- func (p *EphemeralDevicePartitioner) GetPartitions(devicePath string) (partitions []ExistingPartition, deviceFullSizeInBytes uint64, err error)
- func (p *EphemeralDevicePartitioner) Partition(devicePath string, partitions []Partition) error
- func (p EphemeralDevicePartitioner) RemovePartitions(partitions []ExistingPartition, devicePath string) error
- func (p *EphemeralDevicePartitioner) ResizeSinglePartition(devicePath string) (err error)
- func (p *EphemeralDevicePartitioner) SinglePartitionNeedsResize(devicePath string, expectedPartitionType PartitionType) (needsResize bool, err error)
- type ExistingPartition
- type FileSystemType
- type Formatter
- type LinuxDiskManagerOpts
- type Manager
- type Mount
- type Mounter
- type MountsSearcher
- type Partition
- type PartitionType
- type Partitioner
- func NewPartedPartitioner(logger boshlog.Logger, cmdRunner boshsys.CmdRunner, timeService clock.Clock) Partitioner
- func NewRootDevicePartitioner(logger boshlog.Logger, cmdRunner boshsys.CmdRunner, deltaInBytes uint64) Partitioner
- func NewSfdiskPartitioner(logger boshlog.Logger, cmdRunner boshsys.CmdRunner, timeService clock.Clock) Partitioner
- type PersistentDevicePartitioner
- func (p *PersistentDevicePartitioner) GetDeviceSizeInBytes(devicePath string) (uint64, error)
- func (p *PersistentDevicePartitioner) GetPartitions(devicePath string) (partitions []ExistingPartition, deviceFullSizeInBytes uint64, err error)
- func (p *PersistentDevicePartitioner) Partition(devicePath string, partitions []Partition) error
- func (p *PersistentDevicePartitioner) RemovePartitions(partitions []ExistingPartition, devicePath string) error
- func (p *PersistentDevicePartitioner) ResizeSinglePartition(devicePath string) (err error)
- func (p *PersistentDevicePartitioner) SinglePartitionNeedsResize(devicePath string, expectedPartitionType PartitionType) (needsResize bool, err error)
- type Settings
- type Util
Constants ¶
View Source
const MaxFdiskPartitionSize = uint64(2 * 1024 * 1024 * 1024 * 1024)
Variables ¶
View Source
var ErrGPTPartitionEncountered = errors.New("sfdisk detected a GPT partition")
Functions ¶
func ConvertFromBytesToMb ¶
func ConvertFromKbToBytes ¶
func ConvertFromMbToBytes ¶
func IsGPTError ¶
func NewPartitionStrategy ¶
Types ¶
type EphemeralDevicePartitioner ¶
type EphemeralDevicePartitioner struct {
// contains filtered or unexported fields
}
func NewEphemeralDevicePartitioner ¶
func NewEphemeralDevicePartitioner( partedPartitioner Partitioner, logger boshlog.Logger, cmdRunner boshsys.CmdRunner, ) *EphemeralDevicePartitioner
func (*EphemeralDevicePartitioner) GetDeviceSizeInBytes ¶
func (p *EphemeralDevicePartitioner) GetDeviceSizeInBytes(devicePath string) (uint64, error)
func (*EphemeralDevicePartitioner) GetPartitions ¶
func (p *EphemeralDevicePartitioner) GetPartitions(devicePath string) (partitions []ExistingPartition, deviceFullSizeInBytes uint64, err error)
func (*EphemeralDevicePartitioner) Partition ¶
func (p *EphemeralDevicePartitioner) Partition(devicePath string, partitions []Partition) error
func (EphemeralDevicePartitioner) RemovePartitions ¶
func (p EphemeralDevicePartitioner) RemovePartitions(partitions []ExistingPartition, devicePath string) error
func (*EphemeralDevicePartitioner) ResizeSinglePartition ¶
func (p *EphemeralDevicePartitioner) ResizeSinglePartition(devicePath string) (err error)
func (*EphemeralDevicePartitioner) SinglePartitionNeedsResize ¶
func (p *EphemeralDevicePartitioner) SinglePartitionNeedsResize(devicePath string, expectedPartitionType PartitionType) (needsResize bool, err error)
type ExistingPartition ¶
type FileSystemType ¶
type FileSystemType string
const ( FileSystemSwap FileSystemType = "swap" FileSystemExt4 FileSystemType = "ext4" FileSystemXFS FileSystemType = "xfs" FileSystemDefault FileSystemType = "" FileSystemExtResizeUtility = "resize2fs" FileSystemXFSResizeUtility = "xfs_growfs" )
type Formatter ¶
type Formatter interface { Format(partitionPath string, fsType FileSystemType) (err error) GetPartitionFormatType(string) (FileSystemType, error) GrowFilesystem(partitionPath string) error }
func NewLinuxFormatter ¶
func NewLinuxFormatter(runner boshsys.CmdRunner, fs boshsys.FileSystem) Formatter
type LinuxDiskManagerOpts ¶
type Manager ¶
type Manager interface { GetEphemeralDevicePartitioner() Partitioner GetFormatter() Formatter GetMounter() Mounter GetMountsSearcher() MountsSearcher GetPersistentDevicePartitioner(partitionerType string) (Partitioner, error) GetRootDevicePartitioner() Partitioner GetUtil() Util }
func NewLinuxDiskManager ¶
func NewLinuxDiskManager( logger boshlog.Logger, runner boshsys.CmdRunner, fs boshsys.FileSystem, opts LinuxDiskManagerOpts, ) Manager
type Mounter ¶
type Mounter interface { Mount(partitionPath, mountPoint string, mountOptions ...string) (err error) MountTmpfs(mountPoint string, size string) (err error) MountFilesystem(partitionPath, mountPoint, fstype string, mountOptions ...string) (err error) Unmount(partitionOrMountPoint string) (didUnmount bool, err error) RemountAsReadonly(mountPoint string) (err error) Remount(fromMountPoint, toMountPoint string, mountOptions ...string) (err error) RemountInPlace(mountPoint string, mountOptions ...string) (err error) SwapOn(partitionPath string) (err error) IsMountPoint(path string) (parititionPath string, result bool, err error) IsMounted(devicePathOrMountPoint string) (result bool, err error) }
func NewLinuxBindMounter ¶
func NewLinuxMounter ¶
type MountsSearcher ¶
func NewCmdMountsSearcher ¶
func NewCmdMountsSearcher(runner boshsys.CmdRunner) MountsSearcher
func NewProcMountsSearcher ¶
func NewProcMountsSearcher(fs boshsys.FileSystem) MountsSearcher
type Partition ¶
type Partition struct { NamePrefix string SizeInBytes uint64 Type PartitionType }
type PartitionType ¶
type PartitionType string
const ( PartitionTypeSwap PartitionType = "swap" PartitionTypeEFI PartitionType = "efi" PartitionTypeLinux PartitionType = "linux" PartitionTypeEmpty PartitionType = "empty" PartitionTypeUnknown PartitionType = "unknown" PartitionTypeGPT PartitionType = "gpt" )
type Partitioner ¶
type Partitioner interface { Partition(devicePath string, partitions []Partition) (err error) GetDeviceSizeInBytes(devicePath string) (size uint64, err error) SinglePartitionNeedsResize(devicePath string, expectedPartitionType PartitionType) (needsResize bool, err error) ResizeSinglePartition(devicePath string) (err error) GetPartitions(devicePath string) (partitions []ExistingPartition, deviceFullSizeInBytes uint64, err error) RemovePartitions(partitions []ExistingPartition, devicePath string) error }
func NewPartedPartitioner ¶
func NewSfdiskPartitioner ¶
type PersistentDevicePartitioner ¶
type PersistentDevicePartitioner struct {
// contains filtered or unexported fields
}
func NewPersistentDevicePartitioner ¶
func NewPersistentDevicePartitioner( sfDiskPartitioner Partitioner, partedPartitioner Partitioner, deviceUtil Util, logger logger.Logger, ) *PersistentDevicePartitioner
func (*PersistentDevicePartitioner) GetDeviceSizeInBytes ¶
func (p *PersistentDevicePartitioner) GetDeviceSizeInBytes(devicePath string) (uint64, error)
func (*PersistentDevicePartitioner) GetPartitions ¶
func (p *PersistentDevicePartitioner) GetPartitions(devicePath string) (partitions []ExistingPartition, deviceFullSizeInBytes uint64, err error)
func (*PersistentDevicePartitioner) Partition ¶
func (p *PersistentDevicePartitioner) Partition(devicePath string, partitions []Partition) error
func (*PersistentDevicePartitioner) RemovePartitions ¶
func (p *PersistentDevicePartitioner) RemovePartitions(partitions []ExistingPartition, devicePath string) error
func (*PersistentDevicePartitioner) ResizeSinglePartition ¶
func (p *PersistentDevicePartitioner) ResizeSinglePartition(devicePath string) (err error)
func (*PersistentDevicePartitioner) SinglePartitionNeedsResize ¶
func (p *PersistentDevicePartitioner) SinglePartitionNeedsResize(devicePath string, expectedPartitionType PartitionType) (needsResize bool, err error)
Source Files ¶
- cmd_mounts_searcher.go
- convert.go
- delta.go
- diskutil.go
- ephemeral_device_partitioner.go
- existing_partition.go
- formatter_interface.go
- linux_bind_mounter.go
- linux_disk_manager.go
- linux_formatter.go
- linux_mounter.go
- manager_interface.go
- mounter_interface.go
- mounts_searcher_interface.go
- parted_partitioner.go
- partitioner_interface.go
- persistent_device_partitioner.go
- proc_mounts_searcher.go
- root_device_partitioner.go
- sfdisk_partition_strategy.go
- sfdisk_partitioner.go
Click to show internal directories.
Click to hide internal directories.