Smartctl -A -v 9,minutes /dev/sda Shows the vendor Attributes, when the disk stores its power-on time internally in minutes rather than hours. Smartctl -q errorsonly -H -l selftest /dev/sda Produces output only if the device returns failing SMART status, or if some of the logged self-tests ended with errors. Mac users can easily check the SMART status of their hard drives and internal disk storage by using Disk Utility in Mac OS, offering a simple way to see if the disk hardware itself is in good health or is experiencing a hardware issue.
Home
smartmontools is a utility to read and monitor the S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) information of ATA/SATA and SCSI/SAS drives.
InstallationHardware
S.M.A.R.T. support needs to be enabled in the BIOS or EFI firmware for correct operation.
USE flagsUSE flags forsys-apps/smartmontoolsTools to monitor storage systems to provide advanced warning of disk degradation
Data provided by the Gentoo Package Database · Last update: 2020-10-06 15:40 More information about USE flags
Emerge
Install sys-apps/smartmontools:
UsageInvocationExamples
smartctl is a utility that is used to control and monitor S.M.A.R.T. enabled drives.
Print information of a drive, including S.M.A.R.T. support:
Enable S.M.A.R.T. on a drive:
Print the S.M.A.R.T. health status of a drive:
If the result is
PASSED , the drive is in good health. If the result is FAILED , drive failure is imminent and the data should be backed up.
Print the S.M.A.R.T. capabilities of a drive, including supported tests and the time required to run them:
Print the vendor specific S.M.A.R.T attributes of a drive:
Run a S.M.A.R.T. test on a drive:
The possible values for
TEST include:
Print a S.M.A.R.T. log of a drive:
The possible values for
LOG include:
To send out notifications using custom scripts, place those scripts at /etc/smartd_warning.d. To run all scripts - add '@ALL' to the -m directive in /etc/smartd.conf. If the -m directive also contains an email address in the form of
FILE
/etc/smartd.conf
the notification will be sent using both email address and custom scripts. For more information, see -m and -M sections of man smartd.conf
S.M.A.R.T. daemon
smartd is a daemon that continuously monitors the S.M.A.R.T. information of drives. It can be configured via /etc/smartd.conf. See man smartd.conf for more information. smartd will log any errors to /var/log/messages.
In this example smartd monitors 4 drives and sends a test e-mail on startup. It also runs a scheduled test every week on Friday at 3:00 a.m.
Smartmontools Mac
FILE
/etc/conf.d/smartd
To start smartd:
To start smartd at boot:
To debug smartd and check for possible configuration errors:
Note
To stop the debugging instance of smartd, use Ctrl+ External resources
Retrieved from 'https://wiki.gentoo.org/index.php?title=Smartmontools&oldid=891940'
S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology) is a supplementary component built into many modern storage devices through which devices monitor, store, and analyze the health of their operation. Statistics are collected (temperature, number of reallocated sectors, seek errors..) which software can use to measure the health of a device, predict possible device failure, and provide notifications on unsafe values.
Smartmontools
The smartmontools package contains two utility programs for analyzing and monitoring storage devices:
smartctl and smartd . Install the smartmontools package to use these tools.
SMART support must be available and enabled on each storage device to effectively use these tools. Apple mac iphone fax app. You can use #smartctl to check for and enable SMART support. That done, you can manually #Run a test and #View test results, or you can use #smartd to automatically run tests and email notifications.
smartctl
smartctl is a command-line tool that 'controls the Self-Monitoring, Analysis and Reporting Technology (SMART) system built into most ATA/SATA and SCSI/SAS hard drives and solid-state drives.'
The
-i /--info option prints a variety of information about a device, including whether SMART is available and enabled:
If SMART is available but not enabled, you can enable it:
You may need to specify a device type. For example, specifying
--device=ata tells smartctl that the device type is ATA, and this prevents smartctl from issuing SCSI commands to that device.
Smartmontools MacosRun a test
There are three types of self-tests that a device can execute (all are safe to user data):
The
-c /--capabilities flag prints which tests a device supports and the approximate execution time of each test. For example:
Use
-t /--test=<test_name> flag to run a test:
View test results
You can view a device's overall health with the
-H flag. 'If the device reports failing health status, this means either that the device has already failed, or that it is predicting its own failure within the next 24 hours. If this happens […] get your data off the disk and to someplace safe as soon as you can.'
You can also view a list of recent test results and detailed information about a device:
smartd
The smartd daemon monitors SMART statuses and emits notifications when something goes wrong. It can be managed with systemd and configured using the
/etc/smartd.conf configuration file. The configuration file syntax is esoteric, and this wiki page provides only a quick reference. For more complete information, read the examples and comments within the configuration file, or read smartd.conf(5).
daemon management
To start the daemon, check its status, make it auto-start on system boot and read recent log file entries, simply start/enable the
smartd.service systemd unit.
smartd respects all the usual systemctl and journalctl commands. For more information on using systemctl and journalctl, see systemd#Using units and systemd/Journal.
Define the devices to monitor
To monitor for all possible SMART errors on all disks, the following setting must be added in the configuration file.
Note this is the default smartd configuration and the
-a parameter, which is the default parameter, may be omitted.
To monitor for all possible SMART errors on
/dev/sda and /dev/sdb , and ignore all other devices:
To monitor for all possible SMART errors on externally connected disks (USB-backup disks spring to mind) it is prudent to tell smartd the UUID of the device since the /dev/sdX of the drive might change during a reboot.
First, you will have to get the UUID of the disk to monitor:
ls -lah /dev/disk/by-uuid/ now look for the disk you want to Monitor
I know that my USB disk attached to /dev/sde during boot. Now to tell smartd to monitor that disk simply use the
/dev/disk/by-uuid/ path.
Now your USB disk will be monitored even if the /dev/sdX path changes during reboot.
Notifying potential problems
To have an email sent when a failure or new error occurs, use the
-m option:
To be able to send the email externally (i.e. not to the root mail account) a MTA (Mail Transport Agent) or a MUA (Mail User Agent) will need to be installed and configured. Common MTAs are Msmtp and SSMTP, but perhaps the easiest dma will suffice. Common MTUs are sendmail and Postfix. It is enough to simply configure S-nail if you do not want anything else, but you will need to follow these instructions.
The
-M test option causes a test email to be sent each time the smartd daemon starts:
Emails can take quite a while to be delivered. To make sure you are warned immediately if your hard drive fails, you may also define a script to be executed in addition to the email sending:
To send an email and a system notification, put something like this into
/usr/local/bin/smartdnotify :
Smartctl On Mac Apps Download
If you are running a desktop environment, you might also prefer having a popup to appear on your desktop. In this case, you can use this script (replace
X_user and X_userid with the user and userid running X respectively) :
This requires libnotify and a compatible desktop environment. See Desktop notifications for more details.
You can also put your custom scripts into
/usr/share/smartmontools/smartd_warning.d/ :
This scripts notifies every logged in users on the system via libnotify.
This script requires libnotify and procps-ng and a compatible desktop environment.
You can execute your custom scripts with
Power management
If you use a computer under control of power management, you should instruct smartd how to handle disks in low power mode. Usually, in response to SMART commands issued by smartd, the disk platters are spun up. So if this option is not used, then a disk which is in a low-power mode may be spun up and put into a higher-power mode when it is periodically polled by smartd.
Smartctl On Mac Apps Windows 10
More info on smartmontools wiki.
On some devices the -n does not work. You get the following error message in syslog:
As an alternative you can user -i option of smartd. It controls how often smartd spins the disks up to check their status. Default is 30 minutes. To change it create and edit
/etc/default/smartmontools .
For more info see smartd(8).
Schedule self-tests
smartd can tell disks to perform self-tests on a schedule. The following
/etc/smartd.conf configuration will start a short self-test every day between 2-3am, and an extended self test weekly on Saturdays between 3-4am: Why does mac photos app keep opening.
Alert on temperature changes
smartd can track disk temperatures and alert if they rise too quickly or hit a high limit. The following will log changes of 4 degrees or more, log when temp reaches 35 degrees, and log/email a warning when temp reaches 40:
Tip:
Smartctl On Mac Apps Offline
Complete smartd.conf example
Putting together all of the above gives the following example configuration:
Console ApplicationsSmartctl Macos
GUI Applications
Smartctl On Mac Apps AppSee also
Retrieved from 'https://wiki.archlinux.org/index.php?title=S.M.A.R.T.&oldid=638722'
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |