Categorygithub.com/nabowler/capacitycheck
modulepackage
0.1.0
Repository: https://github.com/nabowler/capacitycheck.git
Documentation: pkg.go.dev

# README

Capacity Check

A simple library and CLI to help verify the advertised capacity of storage media.

This program will write a single file of pseudo-random data to the requested directory. A checksum of the data is calculated while creating the file. Once the file has been fully written and synched to disk, the file is read, and the checksum of the read file is compared to the expected checksum. The file is then deleted.

If the checksums do not agree, the media may be lying about its advertised capacity.

To build

go build cmd/capacitycheck/capacitycheck.go

Usage

# write a 63GB file to /media/foo/bar with a read/write buffer of 1MB
./capacitycheck -d /media/foo/bar -s 63GB -b 1MB

# Packages

No description provided by the author

# Functions

Check will write at least `bytes` bytes to a file within `dir`, read the file, and verify that the written checksum matches the read checksum.
CheckWithOptions does the same as Check, but provides options that can be set to get hooks into the in-progress check.

# Constants

No description provided by the author

# Structs

No description provided by the author