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
- Variables
- type Cmd
- type Disk
- type DiskSecurityStatus
- func (d DiskSecurityStatus) SecurityCountExpired() bool
- func (d DiskSecurityStatus) SecurityEnabled() bool
- func (d DiskSecurityStatus) SecurityFrozen() bool
- func (d DiskSecurityStatus) SecurityLocked() bool
- func (d DiskSecurityStatus) SecuritySupported() bool
- func (d DiskSecurityStatus) String() string
- type Info
- type SGDisk
- type SGDiskOpt
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 DiskSecurityStatus ¶
type DiskSecurityStatus uint16
DiskSecurityStatus is information about how the disk is secured.
func (DiskSecurityStatus) SecurityCountExpired ¶
func (d DiskSecurityStatus) SecurityCountExpired() bool
SecurityCountExpired returns true if all attempts to unlock the disk have been used up.
func (DiskSecurityStatus) SecurityEnabled ¶
func (d DiskSecurityStatus) SecurityEnabled() bool
SecurityEnabled returns true if security is enabled on the disk.
func (DiskSecurityStatus) SecurityFrozen ¶
func (d DiskSecurityStatus) SecurityFrozen() bool
SecurityFrozen returns true if the disk is frozen and its security state cannot be changed.
func (DiskSecurityStatus) SecurityLocked ¶
func (d DiskSecurityStatus) SecurityLocked() bool
SecurityLocked returns true if the disk is locked.
func (DiskSecurityStatus) SecuritySupported ¶
func (d DiskSecurityStatus) SecuritySupported() bool
SecuritySupported returns true if the disk has security.
func (DiskSecurityStatus) String ¶
func (d DiskSecurityStatus) String() string
type Info ¶
type Info struct { NumberSectors uint64 ECCBytes uint MasterRevision uint16 `json:"MasterPasswordRevision"` SecurityStatus DiskSecurityStatus 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.