ATACTL(8) BSD System Manager's Manual ATACTL(8)
atactl - a program to manipulate ATA (IDE) devices
atactl device command [arg [...]]
atactl allows a user or system administrator to issue commands to and otherwise control devices which reside on standard IDE and ATA controll- ers. It is used by specifying a device to manipulate, the command to per- form, and any arguments the command may require. If the device is specified without a command, the identify command is im- plied. The following commands may be used: identify Identify the specified device, displaying the device's vendor, product, revision strings, supported capabilities and enabled capabilities. idle Place the specified device into Idle mode. This mode may consume less power than Active mode. standby Place the specified device into Standby mode. This mode will consume less power than Idle mode. sleep Place the specified device into Sleep mode. This mode will con- sume less power than Standby mode, but requires a device reset to resume operation. Typically the wd(4) driver performs this reset automatically, but this should still be used with caution. setidle idle-timer Places the specified device into Idle mode, and sets the Idle timer to idle-timer seconds. A value of 0 will disable the Idle timer. setstandby standby-timer Places the specified device into Standby mode, and sets the Standby timer to standby-timer seconds. A value of 0 will dis- able the Standby timer. checkpower Will print out if the device is in Active, Idle, or Standby power management mode. apmset power-management-level Enables and sets the advanced power management level to the re- quested level on the specified device (if supported). Device performance may increase with increasing power management levels at the cost of potentially requiring more power. Values up to and including 126 allow the device to go into standby mode and spin-down the disk. This may cause disk time-outs and is there- fore not recommended. These values are more suitable optimiza- tion for low power usage on infrequently used devices. Values 127 up to and including 253 do not allow the device to go to standby mode and are more suitable for optimization for perfor- mance. Support for advanced power management is indicated by the device with 'Advanced Power Management feature set' in the out- put of the identify command. apmdisable Disables support for advanced power management on the specified device. Note that devices supporting advanced power management may refuse to disable it, resulting in an 'ATA device returned Aborted Command' warning. acousticset acoustic-management-level Enables and sets the automatic acoustic management level to the requested level on the specified device (if supported). Device performance may increase with increasing automatic acoustic management levels at the cost of potentially generating more noise and requiring more power. Valid values are 0 up to and in- cluding 126. Support for automatic acoustic management is indi- cated by the device with 'Automatic Acoustic Management feature set' in the output of the identify command. acousticdisable Disables support for automatic acoustic management on the speci- fied device. Note that devices supporting automatic acoustic management may refuse to disable it, resulting in an 'ATA device returned Aborted Command' warning. podenable Allows the specified device to revert to power-on default (pod) settings after a software reset. poddisable Disallows the specified device to revert to power-on default (pod) settings after a software reset. In other words this per- mits the settings that have been modified since power-on to remain after a software reset. puisenable Enables power-up in standby (puis) on the specified device, causing the device to wait while spinning up the disks after power-up. This may cause problems at boot if the device is too slow in spin-up. This option is therefore not recommended unless the implications are understood. Note that the power-up in standby mode stays enabled over power-downs, hardware and software resets. Support for power-up in standby is indicated by the device with 'Power-up in standby feature set' in the output of the identify command. puisdisable Disables power-up in standby (puis) on the specified device, causing the device to spin up the disks after power-up. This should be the factory default setting of the device and it is recommended to leave this setting disabled. puisspinup Explicitly spins up the device if power-up in standby (puis) mode is enabled. readaheadenable Enables read look-ahead on the specified device. This may in- crease performance. Support for and status of read look-ahead is indicated by the device with 'read look-ahead' in the output of the identify command. readaheaddisable Disables read look-ahead on the specified device. This may de- crease performance. Note that the device may use 'vendor specific' behaviour in implementing this, so it is not recom- mended to issue this command on a disk containing any currently mounted filesystems. secsetpass user high|maximum secsetpass master Sets password and security level for the specified device. There are two passwords, user and master, and two security levels, high and maximum. The maximum password length is 32 symbols. The security system is enabled by sending a user password to the device with this command. When the security system is enabled, access to user data on the device is denied after a power cycle until the user password is sent to the device with the secunlock command. A master password may be set in addition to the user password. The purpose of the master password is to allow an ad- ministrator to establish a password that is kept secret from the user, and which may be used to unlock the device if the user password is lost. Setting the master password does not enable security system. Each master password change decrements the mas- ter password revision code value which is displayed in the identify command output if supported. After value 0x0001 is reached the next value will be 0xfffe. The security level deter- mines device behavior when the master password is used to unlock the device. When the security level is set to high the device requires the secunlock command if the master password is used to unlock. When the security level is set to maximum the device re- quires a secerase command if the master password is used to un- lock it. Execution of the secerase command erases all user data on the device. secunlock user|master Unlocks the specified device with user or master password. The device will always unlock if a valid user password is received. If the security level was set to high during the last secsetpass command, the device will unlock if the master password is re- ceived. If the security level was set to maximum during the last secsetpass command, the device won't unlock even if the master password is received. secerase user|master [enhanced] Erases all user data and unlocks the specified device. Execution of this command with the master password is the only way to un- lock a device locked at maximum security level with the secsetpass command if the user's password is lost or unknown. There are two erase modes: normal and enhanced. Default erase mode is normal. In the normal erase mode this command will write binary zeroes to all user data areas. The enhanced erase mode is optional and may not be supported by the device. When enhanced erase mode is specified, the device will write predetermined data patterns to all user data areas. In enhanced erase mode, all previously written user data will be overwritten, including sectors that are no longer in use due to reallocation. This com- mand will disable the device lock mode, however, the master password will still be stored internally within the device and may be reactivated later when a new user password is set. secfreeze Prevents changes to passwords until a following power cycle. The purpose of this command is to prevent password setting attacks on the security system. After command completion any other com- mands that update the device lock mode will be aborted. secdisablepass user|master Disables the lock mode for the specified device with user or master password. This command won't change the master password. The master password will be reactivated when a user password is set. Support for the security commands is indicated by the device with 'Security Mode feature set' in the output of the identify command. WARNING Be very careful while playing with these commands. Loss of the user and master passwords for the device will result in an inac- cessible device. smartenable Enables SMART (Self-Monitoring, Analysis, and Reporting Technol- ogy) on the specified device (if supported). This causes the device to record information for prediction of device degrada- tion and/or faults. Support for SMART is indicated by the device with 'SMART feature set' in the output of the identify command. smartdisable Disables support for SMART on the specified device. Note that this means that the device will no longer record any SMART in- formation. Note that SMART must be enabled while executing the following commands or the device will return an error. smartstatus Reads the reliability status of the specified device. If the device reports that one of its thresholds is exceeded (a strong indication of imminent failure), the warning 'SMART threshold exceeded!' is printed to stderr and a status of 2 is returned. smartautosave enable|disable Enables/disables attribute autosave feature on the specified device. smartoffline subcommand Causes the specified device to immediately initiate the optional set of activities that collect SMART data in off-line mode and then save this data to the device's non-volatile memory, or exe- cute self-diagnostic test routines in either captive or off-line mode. The subcommand may be one of the following: collect Start SMART off-line data collection immediately. shortoffline Execute SMART short self-test routine immediately in off-line mode. extenoffline Execute SMART extended self-test routine immediately in off-line mode. abort Abort off-line mode self-test routine. shortcaptive Execute SMART short self-test routine immediately in captive mode. extencaptive Execute SMART extended self-test routine immediately in captive mode. Note that executing self-test routines in captive mode causes the device to be not accessible until the routine completes. This option is therefore not recommended unless the implications are understood. smartread Reads various SMART information from the specified device and prints it to stdout. smartreadlog log Reads specified log and prints it to stdout. The log may be one of the following: directory The error log directory. summary The summary error log. comp The comprehensive error log. selftest The self-test log. readattr Displays attribute thresholds and values for the specified dev- ice. Besides attribute values, device vendors may provide addi- tional information shown in the last column, ``Raw''. Attributes names can be completely wrong since they vary between vendors and even models, so don't rely on it. SMART must be enabled while executing this command or the device will return an error. SMART commands and readattr command are for experts only. writecachedisable Disable the write cache on the specified device (if supported). This may decrease performance. Support for and status of write caching is indicated by the device with 'write cache' in the output of the identify command. writecacheenable Enables the write cache on the specified device (if supported). This may increase performance, however data still in the device's cache at powerdown may be lost. The wd(4) driver per- forms a cache flush automatically before shutdown. dump Extracts the records about issued ATA commands from the log buffer. The log buffer is cleared after extraction.
# atactl /dev/wd0c identify Displays the vendor, product, revision strings and capabilities (such as support for SMART) as reported by /dev/wd0. # atactl /dev/wd0c smartenable Enables the SMART support on /dev/wd0 for detection of early warning signs of device failure. 0 * * * * /sbin/atactl /dev/wd0c smartstatus >/dev/null In a crontab(5) entry queries /dev/wd0 each hour for early warning signs of failure. If the device exceeded one of the SMART thresholds, atactl will output 'SMART threshold exceeded!' to stderr and cron(8) will mail it.
Not all devices are created equally. Some may not support the feature sets and/or commands needed to perform the requested action, even when the identify command indicates support for the requested action. The dev- ice will typically respond with an 'ATA device returned Aborted Command' if the requested action is not supported. Similarly a device might not implement all commands in a feature set, so even though disabling a feature works, enabling might not.
The atactl command first appeared in OpenBSD 2.6. Support for acoustic management, advanced power management, power-up in standby, read look- ahead and SMART was added in OpenBSD 2.9.
The atactl command was written by Ken Hornstein. It was based heavily on the scsictl command written by Jason R. Thorpe. Support for acoustic management, advanced power management, power-up in standby, read look- ahead and SMART was added by Wouter Slegers.
The output from the identify command is rather ugly. Disabling read look-ahead with the readaheaddisable might cause problems with mounted filesystems on that device. MirOS BSD #10-current November 18, 1998 5
Generated on 2015-10-25 00:47:46 by $MirOS: src/scripts/roff2htm,v 1.81 2015/10/16 13:19:09 tg Exp $
These manual pages and other documentation are copyrighted by their respective writers;
their source is available at our CVSweb,
AnonCVS, and other mirrors. The rest is Copyright © 2002–2015 The MirOS Project, Germany.
This product includes material provided by mirabilos.
This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.