Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckOptions ¶ added in v0.2.0
type CheckOptions struct {
Device string `arg:"0"` // Device containing the filesystem to check.
Preen bool `arg:"p"` // Automatically repair the filesystem.
NoFix bool `arg:"n"` // Perform a read-only check.
CheckForBadBlocks bool `arg:"c"` // Check for bad blocks.
AppendBadBlocks bool `arg:"k"` // Append to existing bad blocks list.
AppendBadBlocksFile string `arg:"l"` // Append bad blocks from file to existing bad blocks list.
BadBlocksFile string `arg:"L"` // Use bad blocks list from file.
Force bool `arg:"f"` // Force checking even if the filesystem seems clean.
OptimizeDirectories bool `arg:"D"` // Optimize directories.
Flush bool `arg:"F"` // Flush the device's buffer cache.
Superblock *int `arg:"b"` // Use alternative superblock.
Blocksize *int `arg:"B"` // Block size in bytes (supported: 1024, 2048 and 4096 bytes).
ExternalJournal string `arg:"j"` // External journal for the filesystem.
ExtendedOptions string `arg:"E"` // Extended options, comma separated list.
UndoFile string `arg:"z"` // Before overwriting blocks, backup the contents.
}
CheckOptions provides options for checking an ext4 filesystem.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CheckFilesystem ¶ added in v0.1.1
func (c *Client) CheckFilesystem(ctx context.Context, opts CheckOptions) error
Check an ext4 filesystem.
func (*Client) CreateFilesystem ¶
func (c *Client) CreateFilesystem(ctx context.Context, opts CreateOptions) error
Create an ext4 filesystem.
func (*Client) ResizeFilesystem ¶
func (c *Client) ResizeFilesystem(ctx context.Context, opts ResizeOptions) error
Resize an ext4 filesystem.
type ClientOption ¶
type ClientOption func(*Client)
func WithPath ¶
func WithPath(path string) ClientOption
WithPath sets the path of the directory containing the e2fsprogs binaries.
type CreateOptions ¶ added in v0.2.0
type CreateOptions struct {
Device string `arg:"0"` // Device where the filesystem will be created.
Size string `arg:"1"` // Optional size of the filesystem.
CheckForBadBlocks bool `arg:"c"` // Check for bad blocks before creating the filesystem.
BlockSize *int `arg:"b"` // Block size in bytes (supported: 1024, 2048 and 4096 bytes).
ClusterSize *int `arg:"C"` // Cluster size in bytes for filesystems using the bigalloc feature (supported: [2048, 256M]).
BytesPerInode *int `arg:"i"` // Bytes/inode ratio, generally shouldn't be smaller than the block size.
InodeSize *int `arg:"I"` // The size of each inode in bytes.
JournalOptions string `arg:"J"` // Journal options, comma separated list.
NumberOfGroups *int `arg:"G"` // The number of block groups packed into a flex_bg group.
NumberOfInodes *int `arg:"N"` // Override the default number of reserved inodes.
RootDirectory string `arg:"d"` // Copy directory contents into the filesystem.
ReservedBlocksPercentage *int `arg:"m"` // Percentage of blocks reserved for the super-user.
CreatorOS string `arg:"o"` // Override creator os.
BlocksPerGroup *int `arg:"g"` // The number of blocks in each block group.
Label string `arg:"L"` // Volume label (max length 16 bytes).
LastMountedDirectory string `arg:"M"` // Directory where the filesystem was last mounted.
Features string `arg:"O"` // Filesystem features/options, comma separated list.
FilesystemRevision *int `arg:"r"` // Revision level for the filesystem.
ExtendedOptions string `arg:"E"` // Extended options, comma separated list.
UsageType string `arg:"T"` // Filesystem usage type (supported: floppy, small, default).
UUID string `arg:"U"` // UUID for the filesystem.
ErrorBehavior string `arg:"e"` // Kernel behavior when errors are detected (supported: continue, remount-ro, panic).
UndoFile string `arg:"z"` // Before overwriting blocks, backup the contents.
Journal bool `arg:"j"` // Create an ext3 journal.
DryRun bool `arg:"n"` // Dry run (don't actually create the filesystem).
DirectIO bool `arg:"D"` // Use direct I/O when writing to the disk.
Force bool `arg:"F"` // Force filesystem creation on any device.
WriteSuperblocks bool `arg:"S"` // Write superblock and group descriptors only.
}
CreateOptions provides options for creating an ext4 filesystem.
type ResizeOptions ¶ added in v0.2.0
type ResizeOptions struct {
Device string `arg:"0"` // Device containing the filesystem to resize.
Size string `arg:"1"` // Optional size of the filesystem.
Force bool `arg:"f"` // Skip safety checks.
Flush bool `arg:"F"` // Flush the device's buffer cache.
Shrink bool `arg:"M"` // Shrink the filesystem to the minimum size.
Enable64Bit bool `arg:"b"` // Enable 64-bit feature.
Disable64Bit bool `arg:"s"` // Disable 64-bit feature.
RAIDStride *int `arg:"S"` // RAID stride size in filesystem blocks.
UndoFile string `arg:"z"` // Before overwriting blocks, backup the contents.
}
ResizeOptions provides options for resizing an ext4 filesystem.
Click to show internal directories.
Click to hide internal directories.