📄 smartctl.8.in
字号:
.I select,next[+SIZE]\- [ATA ONLY] [NEW EXPERIMENTAL SMARTCTL FEATURE] runs a SMART SelectiveSelf Test on the LBA range which follows the range of the last test. Thestarting LBA is set to (ending LBA +1) of the last test. A new span sizemay be specified by the optional +SIZE argument.For example the commands:.nf smartctl \-t select,0\-999 /dev/hda smartctl \-t select,next /dev/hda smartctl \-t select,next+2000 /dev/hda.fihave the same effect as:.nf smartctl \-t select,0\-999 /dev/hda smartctl \-t select,1000\-1999 /dev/hda smartctl \-t select,2000\-3999 /dev/hda.fiIf the last test ended at the last LBA of the disk, the new range startsat LBA 0. The span size of the last span of a disk is adjusted such thatthe total number of spans to check the full disk will not be changedby future uses of \'\-t select,next\'..I select,cont[+SIZE]\- [ATA ONLY] [NEW EXPERIMENTAL SMARTCTL FEATURE] performs a \'redo\'(above) if the self test status reports that the last test was abortedby the host. Otherwise it run the \'next\' (above) test..I afterselect,on\- [ATA ONLY] perform an offline read scan after a Selective Self\-testhas completed. This option must be used together with one or more ofthe \fIselect,N\-M\fP options above. If the LBAs that have beenspecified in the Selective self\-test pass the test with no errorsfound, then read scan the \fBremainder\fP of the disk. If the deviceis powered\-cycled while this read scan is in progress, the read scanwill be automatically resumed after a time specified by the pendingtimer (see below). The value of this option is preserved betweenselective self\-tests..I afterselect,off\- [ATA ONLY] do not read scan the remainder of the disk after aSelective self\-test has completed. This option must be use togetherwith one or more of the \fIselect,N\-M\fP options above. The value of thisoption is preserved between selective self\-tests..I pending,N \- [ATA ONLY] set the pending offline read scan timer to N minutes.Here N is an integer in the range from 0 to 65535 inclusive. If thedevice is powered off during a read scan after a Selective self\-test,then resume the test automatically N minutes after power\-up. Thisoption must be use together with one or more of the \fIselect,N\-M\fPoptions above. The value of this option is preserved between selectiveself\-tests..I scttempint,N[,p]\- [ATA ONLY] [NEW EXPERIMENTAL SMARTCTL FEATURE] set the time intervalfor SCT temperature logging to N minutes. If \',p\' is specified, thesetting is preserved across power cycles. Otherwise, the setting isvolatile and will be reverted to default (1 minute), or lastnon-volatile setting by the next hard reset. This command also clearsthe temperature history table. See \'\-l scttemp\' above for moreinformation about SCT temperature logging..TP.B \-C, \-\-captiveRuns self\-tests in captive mode. This has no effect with \'\-toffline\' or if the \'\-t\' option is not used. [Note: in the case ofSCSI devices, this command option runs the self\-test in "Foreground"mode.]\fBWARNING: Tests run in captive mode may busy out the drive for thelength of the test. Only run captive tests on drives without anymounted partitions!\fP.TP.B \-X, \-\-abortAborts non\-captive SMART Self Tests. Note that thiscommand will abort the Offline Immediate Test routine only if yourdisk has the "Abort Offline collection upon new command" capability..PP.SH EXAMPLES.nf.B smartctl \-a /dev/hda.fiPrint all SMART information for drive /dev/hda (Primary Master)..PP.nf.B smartctl \-s off /dev/hdd.fiDisable SMART on drive /dev/hdd (Secondary Slave)..PP.nf.B smartctl \-\-smart=on \-\-offlineauto=on \-\-saveauto=on /dev/hda.fiEnable SMART on drive /dev/hda, enable automatic offlinetesting every four hours, and enable autosaving ofSMART Attributes. This is a good start\-up line for your system\'sinit files. You can issue this command on a running system..PP.nf.B smartctl \-t long /dev/hdc.fiBegin an extended self\-test of drive /dev/hdc. You can issue thiscommand on a running system. The results can be seen in the self\-testlog visible with the \'\-l selftest\' option after it has completed..PP.nf.B smartctl \-s on \-t offline /dev/hda.fiEnable SMART on the disk, and begin an immediate offline test ofdrive /dev/hda. You can issue this command on a running system. Theresults are only used to update the SMART Attributes, visiblewith the \'\-A\' option. If any device errors occur, they are logged tothe SMART error log, which can be seen with the \'\-l error\' option..PP.nf.B smartctl \-A \-v 9,minutes /dev/hda.fiShows the vendor Attributes, when the disk stores its power\-on timeinternally in minutes rather than hours..PP.nf.B smartctl \-q errorsonly \-H \-l selftest /dev/hda.fiProduces output only if the device returns failing SMART status,or if some of the logged self\-tests ended with errors..PP.nf.B smartctl \-q silent \-a /dev/hda.fiExamine all SMART data for device /dev/hda, but produce noprinted output. You must use the exit status (the.B $?shell variable) to learn if any Attributes are out of bound, if theSMART status is failing, if there are errors recorded in theself\-test log, or if there are errors recorded in the disk error log..PP.nf.B smartctl \-a \-d 3ware,0 /dev/sda.fiExamine all SMART data for the first ATA disk connected to a 3wareRAID controller card..PP.nf.B smartctl \-a \-d 3ware,0 /dev/twe0.fiExamine all SMART data for the first ATA disk connected to a 3wareRAID 6000/7000/8000 controller card..PP.nf.B smartctl \-a \-d 3ware,0 /dev/twa0.fiExamine all SMART data for the first ATA disk connected to a 3wareRAID 9000 controller card..PP.nf.B smartctl \-t short \-d 3ware,3 /dev/sdb.fiStart a short self\-test on the fourth ATA disk connected to the 3ware RAIDcontroller card which is the second SCSI device /dev/sdb..PP.nf.B smartctl \-a \-d hpt,1/3 /dev/sda.fiExamine all SMART data for the (S)ATA disk directly connected to the third channel of thefirst HighPoint RocketRAID controller card..nf.PP.nf.B smartctl \-t short \-d hpt,1/1/2 /dev/sda.fiStart a short self\-test on the (S)ATA disk connected to second pmport on thefirst channel of the first HighPoint RocketRAID controller card..PP.nf.B smartctl \-t select,10\-100 \-t select,30\-300 \-t afterselect,on \-t pending,45 /dev/hda.fiRun a selective self\-test on LBAs 10 to 100 and 30 to 300. After thethese LBAs have been tested, read\-scan the remainder of the disk. If the disk ispower\-cycled during the read\-scan, resume the scan 45 minutes after power to thedevice is restored..PP.nf.B smartctl \-a \-d cciss,0 /dev/cciss/c0d0.fiExamine all SMART data for the first SCSI disk connected to a ccissRAID controller card..PP.SH RETURN VALUESThe return values of \fBsmartctl\fP are defined by a bitmask. If allis well with the disk, the return value (exit status) of\fBsmartctl\fP is 0 (all bits turned off). If a problem occurs, or anerror, potential error, or fault is detected, then a non\-zero statusis returned. In this case, the eight different bits in the returnvalue have the following meanings for ATA disks; some of these valuesmay also be returned for SCSI disks..TP.B Bit 0:Command line did not parse..TP.B Bit 1:Device open failed, or device did not return an IDENTIFY DEVICE structure. .TP.B Bit 2:Some SMART command to the disk failed, or there was a checksum errorin a SMART data structure (see \'\-b\' option above)..TP.B Bit 3:SMART status check returned "DISK FAILING"..TP.B Bit 4:We found prefail Attributes <= threshold..TP.B Bit 5:SMART status check returned "DISK OK" but we found that some (usageor prefail) Attributes have been <= threshold at some time in thepast. .TP.B Bit 6:The device error log contains records of errors..TP.B Bit 7:The device self\-test log contains records of errors.To test within the shell for whether or not the different bits areturned on or off, you can use the following type of construction (thisis bash syntax):.nf.B smartstat=$(($? & 8)).fiThis looks at only at bit 3 of the exit status.B $?(since 8=2^3). The shell variable$smartstat will be nonzero if SMART status check returned "diskfailing" and zero otherwise..PP.SH NOTESThe TapeAlert log page flags are cleared for the initiator when thepage is read. This means that each alert condition is reported onlyonce by \fBsmartctl\fP for each initiator for each activation of thecondition..PP.SH AUTHOR\fBBruce Allen\fP smartmontools\-support@lists.sourceforge.net.fiUniversity of Wisconsin \- Milwaukee Physics Department .PP.SH CONTRIBUTORSThe following have made large contributions to smartmontools:.nf\fBCasper Dik\fP (Solaris SCSI interface)\fBChristian Franke\fP (Windows interface and Cygwin package)\fBDouglas Gilbert\fP (SCSI subsystem)\fBGuido Guenther\fP (Autoconf/Automake packaging)\fBGeoffrey Keating\fP (Darwin ATA interface)\fBEduard Martinescu\fP (FreeBSD interface)\fBFr\*'ed\*'eric L. W. Meunier\fP (Web site and Mailing list)\fBKeiji Sawada\fP (Solaris ATA interface)\fBSergey Svishchev\fP (NetBSD interface)\fBDavid Snyder and Sergey Svishchev\fP (OpenBSD interface)\fBPhil Williams\fP (User interface and drive database)\fBYuri Dario\fP (OS/2, eComStation interface)\fBShengfeng Zhou\fP (Linux Highpoint RocketRaid interface).fiMany other individuals have made smaller contributions and corrections..PP.SH CREDITS.fiThis code was derived from the smartsuite package, written by MichaelCornwell, and from the previous UCSC smartsuite package. It extendsthese to cover ATA\-5 disks. This code was originally developed as aSenior Thesis by Michael Cornwell at the Concurrent Systems Laboratory(now part of the Storage Systems Research Center), Jack Baskin Schoolof Engineering, University of California, SantaCruz. \fBhttp://ssrc.soe.ucsc.edu/\fP ..SHHOME PAGE FOR SMARTMONTOOLS: .fiPlease see the following web site for updates, further documentation, bugreports and patches: \fBhttp://smartmontools.sourceforge.net/\fP.SHSEE ALSO:\fBsmartd\fP(8), \fBbadblocks\fP(8), \fBide\-smart\fP(8)..SHREFERENCES FOR SMART.fiAn introductory article about smartmontools
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -