Documentation ¶
Overview ¶
Package scuzz supports direct access to SCSI or SATA devices. SCSI and ATA used to be different, but for SATA, it's all the same look.
In the long term we can use it to implement hdparm(1) and other Linux commands.
This package only supports post-2003 48-bit lba addressing. Further, we only concern ourselves with ATA_16. For now it only works on Linux.
Other info:
http://www.t13.org/ Technical Committee T13 AT Attachment (ATA/ATAPI) Interface. http://www.serialata.org/ Serial ATA International Organization.
Index ¶
Constants ¶
const DefaultTimeout time.Duration = 15 * time.Second
DefaultTimeout is the default timeout for disk operations.
Variables ¶
var Debug = func(string, ...interface{}) {}
Debug is an empty function you can replace with, e.g., log.Printf
Functions ¶
This section is empty.
Types ¶
type Disk ¶
type Disk interface { // Unlock unlocks the drive, given a password and an indication of // whether it is the admin (true) or user (false) password. Unlock(password string, admin bool) error // Identify returns drive identity information Identify() (*Info, error) }
Disk is the interface to a disk, with operations to create packets and operate on them.
type Info ¶
type Info struct { NumberSectors uint64 ECCBytes uint MasterPasswordRev uint16 SecurityStatus uint16 TrustedComputingSupport uint16 Serial string Model string FirmwareRevision string // These are the pair-byte-swapped space-padded versions of serial, // model, and firmware revision as originally returned by the SCSI // device. OrigSerial string OrigModel string OrigFirmwareRevision string }
Info is information about a SCSI disk device.
type SGDisk ¶
type SGDisk struct { // Timeuut is the timeout on a disk operation. Timeout time.Duration // contains filtered or unexported fields }
SGDisk implements a Disk using the Linux SG device
func NewSGDisk ¶
NewSGDisk returns a Disk that uses the Linux SCSI Generic Device. It also does an Identify to verify that the target name is a true lba48 device.