Documentation ¶
Index ¶
- func ApplySnapshot(ctx context.Context, log *base.LogObject, diskfile, snapshotName string) error
- func CheckResizeDisk(log *base.LogObject, diskfile string, maxsizebytes uint64) (uint64, bool, error)
- func CreateImg(ctx context.Context, log *base.LogObject, diskfile string, format string, ...) error
- func CreateSnapshot(ctx context.Context, log *base.LogObject, diskfile, snapshotName string) error
- func DeleteSnapshot(ctx context.Context, log *base.LogObject, diskfile, snapshotName string) error
- func DirUsage(log *base.LogObject, dir string) (uint64, error)
- func Dom0DiskReservedSize(log *base.LogObject, globalConfig *types.ConfigItemValueMap, ...) uint64
- func FindDisksPartitions(log *base.LogObject) []string
- func FindLargestDisk(log *base.LogObject) string
- func GetDiskActualSize(log *base.LogObject, diskfile string) (uint64, error)
- func GetDiskVirtualSize(log *base.LogObject, diskfile string) (uint64, error)
- func GetImgInfo(log *base.LogObject, diskfile string) (*types.ImgInfo, error)
- func PartitionSize(log *base.LogObject, part string) (uint64, bool)
- func PersistUsageStat(log *base.LogObject) (*types.UsageStat, error)
- func ResizeImg(ctx context.Context, log *base.LogObject, diskfile string, newsize uint64) error
- func RolloutImgToBlock(ctx context.Context, log *base.LogObject, ...) error
- func SizeFromDir(log *base.LogObject, dirname string) (uint64, error)
- func StatAllocatedBytes(path string) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplySnapshot ¶
ApplySnapshot applies snapshot to diskfile
func CheckResizeDisk ¶
func CheckResizeDisk(log *base.LogObject, diskfile string, maxsizebytes uint64) (uint64, bool, error)
CheckResizeDisk returns size and indicates do we need to resize disk to be at least maxsizebytes
func CreateImg ¶
func CreateImg(ctx context.Context, log *base.LogObject, diskfile string, format string, size uint64) error
CreateImg creates empty diskfile with defined format and size
func CreateSnapshot ¶
CreateSnapshot creates snapshot of diskfile with defined format and size
func DeleteSnapshot ¶
DeleteSnapshot deletes snapshot with a given name created for a given diskfile
func DirUsage ¶
DirUsage calculates usage of directory it checks if provided directory is zfs mountpoint and take usage from zfs in that case
func Dom0DiskReservedSize ¶
func Dom0DiskReservedSize(log *base.LogObject, globalConfig *types.ConfigItemValueMap, deviceDiskSize uint64) uint64
Dom0DiskReservedSize returns reserved space for EVE-OS
func FindDisksPartitions ¶
FindDisksPartitions returns the names of all disks and all partitions Return an array of names like "sda", "sdb1"
func FindLargestDisk ¶
FindLargestDisk determines the name of the largest disk The assumption is that this is not a removalable disk like a USB disk with the installer image
func GetDiskActualSize ¶
GetDiskActualSize - returns ActualSize of the image
func GetDiskVirtualSize ¶
GetDiskVirtualSize - returns VirtualSize of the image
func PartitionSize ¶
PartitionSize - Given "sdb1" return the size of the partition; "sdb" to size of disk. Returns size and a bool to indicate that it is a partition.
func PersistUsageStat ¶
PersistUsageStat returns usage stat for persist We need to handle ZFS differently since the mounted /persist does not indicate usage of zvols and snapshots Note that we subtract usage of persist/reserved dataset (about 20% of persist capacity)
func RolloutImgToBlock ¶
func RolloutImgToBlock(ctx context.Context, log *base.LogObject, diskfile, outputFile, outputFormat string) error
RolloutImgToBlock do conversion of diskfile to outputFile with defined format
func SizeFromDir ¶
SizeFromDir performs a du -s equivalent operation. Didn't use os.ReadDir and filepath.Walk because they sort (quick_sort) all files per directory which is an unnecessary costly operation.
func StatAllocatedBytes ¶
StatAllocatedBytes returns the allocated size of a file in bytes This value will be less than fileInfo.Size() for thinly allocated files
Types ¶
This section is empty.