disksig

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package disksig recognises what a disk already holds, so that nothing in GoNIX formats a disk that is not blank.

Init formats the persist device, the datadisk service formats the data disk and a Library image's init formats /data, each when the disk will not mount. A mount fails for many reasons besides blankness — another filesystem, a partition table, the wrong device named on the command line, an I/O error — and formatting in any of those cases destroys whatever was there. So each of them asks Probe first and formats only when it finds nothing.

The checks follow blkid's: a magic number at a fixed offset. A filesystem this package does not know (ZFS, say) reads as blank.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Identify

func Identify(b []byte) string

Identify is Probe on the first bytes of a disk.

func Probe

func Probe(dev string) (string, error)

Probe reports what dev holds: a description such as "an XFS filesystem", or "" when it recognises nothing and the disk may be formatted. An error means the disk could not be read, and it must not be formatted either.

Types

This section is empty.

Jump to

Keyboard shortcuts

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