Help us shape the future of Go! Take the 2026 Go Developer Survey

loopfs

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package loopfs makes, grows, mounts and removes an ext4 filesystem kept in a preallocated file, mounted through a loop device: the volume image (ADR-0262) and the Lake engine's scratch (ADR-0294).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, image string, sizeBytes int64, features string) error

Create makes image: sizeBytes preallocated, then formatted as ext4 with no reserved blocks and the given features ("" for none). A failure removes the file.

func Grow

func Grow(ctx context.Context, image string, sizeBytes int64) error

Grow preallocates image to sizeBytes and resizes its filesystem to fill it; image must not be mounted.

func Mount

func Mount(image, dir string, options ...string) error

Mount mounts image at dir through a loop device, with nosuid, nodev and the extra options. The loop device reads and writes image with direct I/O: buffered, every write is cached a second time, for image, and a 1 GiB worker spilling 0.7 GiB through it took 126 s instead of 5 s.

func MountedAt

func MountedAt(dir string) (string, bool)

MountedAt returns the device mounted exactly at dir.

func Remove

func Remove(image, dir string) error

Remove detaches the filesystem mounted at dir, when one is, and removes dir and image. A process that still holds the filesystem, in another mount namespace, keeps its blocks until it ends.

func Unmount

func Unmount(dir string) error

Unmount unmounts every mount at dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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