Documentation ¶
Index ¶
- Constants
- func FetchBlockIDProperties(partitionDevice string) (map[string]string, error)
- func MountSpecialFilesystems(prefix string) error
- func UnMountAll(prefix string)
- func WipeDisk(disk *ghw.Disk) error
- func WipeDisks() error
- type Disk
- type FSType
- type GPTGuid
- type GPTType
- type MountOption
- type Partition
- type PrimaryDevice
Constants ¶
View Source
const ( // FAT32 is used for the UEFI boot partition FAT32 = FSType("fat32") // VFAT is used for the UEFI boot partition VFAT = FSType("vfat") // EXT3 is usually only used for /boot EXT3 = FSType("ext3") // EXT4 is the default fs EXT4 = FSType("ext4") // SWAP is for the swap partition SWAP = FSType("swap") // GPTBoot EFI Boot Partition GPTBoot = GPTType("ef00") // GPTLinux Linux Partition GPTLinux = GPTType("8300") // EFISystemPartition see https://en.wikipedia.org/wiki/EFI_system_partition EFISystemPartition = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" // GIB bytes of a Gigabyte GIB = int64(1024 * 1024 * 1024) // TIB bytes of a Terabyte TIB = int64(1024 * GIB) // DiskPrefixToIgnore disks with this prefix will not be reported and wiped. DiskPrefixToIgnore = "ram" )
Variables ¶
This section is empty.
Functions ¶
func FetchBlockIDProperties ¶ added in v0.5.0
FetchBlockIDProperties use blkid to return more properties of the given partition device
func MountSpecialFilesystems ¶
MountSpecialFilesystems mounts all special filesystems needed by a chroot
Types ¶
type Disk ¶
type Disk struct { // Device the name of the disk device visible from kernel side, e.g. sda Device string // Partitions to create on this disk, order is preserved Partitions []*Partition }
Disk is a physical Disk
func GetDisk ¶
func GetDisk(imageID string, size *models.ModelsV1SizeResponse, disks []*models.ModelsV1MachineBlockDevice) Disk
GetDisk returns a partitioning scheme for the given image, if image.ID is unknown default is used.
func (Disk) MountPartitions ¶
MountPartitions mounts all partitions under prefix
func (*Disk) SortByMountPoint ¶
SortByMountPoint ensures that "/" is the first, which is required for mounting
type Partition ¶
type Partition struct { Label string Device string Number uint MountPoint string MountOptions []*MountOption // Size in mebiBytes. If negative all available space is used. Size int64 Filesystem FSType GPTType GPTType GPTGuid GPTGuid // Properties from blkid Properties map[string]string }
Partition defines a disk partition
type PrimaryDevice ¶
PrimaryDevice is the device where the installation happens.
Click to show internal directories.
Click to hide internal directories.