Linux Tutorials

Methods to examine laborious drive well being on FreeBSD

SEOClerks

How do I learn my laborious disk/SSD well being utilizing smartctl command on FreeBSD working system? How can I laborious drive well being on FreeBSD and discover out if my disk is dying?

The Self-Monitoring, Evaluation, and Reporting Know-how System (SMART) constructed into most fashionable laborious disks. The aim of SMART is to watch the reliability of the laborious drive and predict drive failures, and to hold out several types of drive self-tests below FreeBSD working programs. This web page reveals set up smartmontools on FreeBSD and use smartcl to examine laborious drive well being on FreeBSD.

Adblock detected 😱

My web site is made attainable by displaying on-line commercials to my guests. I get it! Advertisements are annoying however they assist hold this web site working. It’s laborious to maintain the positioning working and producing new content material when so many individuals block adverts. Please take into account donating cash to the nixCraft by way of PayPal/Bitcoin, or grow to be a supporter utilizing Patreon.

Set up smartmontools on FreeBSD

Use FreeBSD ports system as follows to put in the identical:
# cd /usr/ports/sysutils/smartmontools
# make set up clear
OR one can binary package deal system. Run the next pkg command:
# pkg set up smartmontools
How to install smartmontools on FreeBSD to check hard disksPutting in smartmontools on FreeBSD utilizing pkg
The smartmontools package deal accommodates two utility applications for FreeBSD:

smartctl command – A command line instrument to manage and monitor laborious disks well being.smartd – It’s a FreeBSD daemon that screens laborious disks well being and alert customers about issues utilizing log information, electronic mail and extra.

Methods to examine laborious drive well being on FreeBSD

The syntax is as follows to examine the standing of drives:
smartctl -a /dev/disk
One can get a listing all linked laborious drives in FreeBSD by working the next instructions:
# camcontrol devlist
OR use the grep command/egrep command as follows:
# egrep ‘advert[0-9]|cd[0-9]’ /var/run/dmesg.boot
egrep ‘da[0-9]|cd[0-9]’ /var/run/dmesg.boot
FreeBSD list all physical disk devices and logical units attachedFreeBSD itemizing all bodily gadgets and logical items connected

FreeeBSD laborious drive well being checkups

Now you already know laborious disk system named on FreeBSD. Due to this fact, it’s time to examine laborious disk data, run:
# smartctl -i /dev/ada0
Pattern outputs:

smartctl 7.zero 20181230 r4883 [FreeBSD 11.2-RELEASE-p10 amd64] (native construct)
Copyright (C) 200218, Bruce Allen, Christian Franke, www.smartmontools.org
 
=== START OF INFORMATION SECTION ===
Mannequin Household: Western Digital Crimson
Machine Mannequin: WDC WD60EFRX-68MYMN1
Serial Quantity: WD-XXXXXXXXXXXXXXX
LU WWN Machine Id: 5 0014ee 26195240d
Firmware Model: 82.00A82
Person Capability: 6,001,175,126,016 bytes [6.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes bodily
Rotation Charge: 5700 rpm
Machine is: In smartctl database [for particulars use: -P present]
ATA Model is: ACS-2, ACS-Three T13/2161-D revision 3b
SATA Model is: SATA Three.1, 6.zero Gb/s (present: 6.zero Gb/s)
Native Time is: Mon Might 20 22:53:06 2019 IST
SMART help is: Out there – system has SMART functionality.
SMART help is: Enabled

smartctl 7.zero 2018-12-30 r4883 [FreeBSD 11.2-RELEASE-p10 amd64] (native construct)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION ===
Mannequin Household: Western Digital Crimson
Machine Mannequin: WDC WD60EFRX-68MYMN1
Serial Quantity: WD-XXXXXXXXXXXXXXX
LU WWN Machine Id: 5 0014ee 26195240d
Firmware Model: 82.00A82
Person Capability: 6,001,175,126,016 bytes [6.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes bodily
Rotation Charge: 5700 rpm
Machine is: In smartctl database [for details use: -P show]
ATA Model is: ACS-2, ACS-Three T13/2161-D revision 3b
SATA Model is: SATA Three.1, 6.zero Gb/s (present: 6.zero Gb/s)
Native Time is: Mon Might 20 22:53:06 2019 IST
SMART help is: Out there – system has SMART functionality.
SMART help is: Enabled

Test disk well being, run:
# smartctl -a /dev/ada0
Pattern session:

smartctl 7.zero 20181230 r4883 [FreeBSD 11.2-RELEASE-p10 amd64] (native construct)
Copyright (C) 200218, Bruce Allen, Christian Franke, www.smartmontools.org
 
=== START OF INFORMATION SECTION ===
Mannequin Household: HGST Deskstar NAS
Machine Mannequin: HGST YYYYYYYYYZZZ
Serial Quantity: K1JVDUGD
LU WWN Machine Id: 5 000cca 255e830c9
Firmware Model: APGNW7JH
Person Capability: 6,001,175,126,016 bytes [6.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes bodily
Rotation Charge: 7200 rpm
Kind Issue: Three.5 inches
Machine is: In smartctl database [for particulars use: -P present]
ATA Model is: ACS-2, ATA8-ACS T13/1699-D revision four
SATA Model is: SATA Three.1, 6.zero Gb/s (present: 6.zero Gb/s)
Native Time is: Mon Might 20 23:00:59 2019 IST
SMART help is: Out there – system has SMART functionality.
SMART help is: Enabled
 
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment take a look at end result: PASSED
 
 
SMART Attributes Information Construction revision quantity: 16
Vendor Particular SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail At all times – zero
2 Throughput_Performance 0x0005 138 138 054 Pre-fail Offline – 100
Three Spin_Up_Time 0x0007 149 149 024 Pre-fail At all times – 436 (Common 449)
four Start_Stop_Count 0x0012 100 100 000 Old_age At all times – 43
5 Reallocated_Sector_Ct 0x0033 100 100 zero05 Pre-fail At all times – zero
7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail At all times – zero
eight Seek_Time_Performance 0x0005 128 128 zero20 Pre-fail Offline – 18
9 Power_On_Hours 0x0012 099 099 000 Old_age At all times – 8501
10 Spin_Retry_Count 0x0013 100 100 zero60 Pre-fail At all times – zero
12 Power_Cycle_Count 0x0032 100 100 000 Old_age At all times – 42
192 Energy-Off_Retract_Count 0x0032 095 095 000 Old_age At all times – 6673
193 Load_Cycle_Count 0x0012 095 095 000 Old_age At all times – 6673
194 Temperature_Celsius 0x0002 117 117 000 Old_age At all times – 51 (Min/Max 25/52)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age At all times – zero
197 Current_Pending_Sector 0x0022 100 100 000 Old_age At all times – zero
198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline – zero
199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age At all times – zero
 
SMART Error Log Model: 1
No Errors Logged
 
SMART Self-test log construction revision quantity 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
 
SMART Selective self-test log information construction revision quantity 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 zero zero Not_testing
2 zero zero Not_testing
Three zero zero Not_testing
four zero zero Not_testing
5 zero zero Not_testing
Selective self-test flags (0x0):
After scanning chosen spans, do NOT read-scan the rest of disk.
If Selective self-test is pending on power-up, resume after zero minute delay.

smartctl 7.zero 2018-12-30 r4883 [FreeBSD 11.2-RELEASE-p10 amd64] (native construct)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION ===
Mannequin Household: HGST Deskstar NAS
Machine Mannequin: HGST YYYYYYYYYZZZ
Serial Quantity: K1JVDUGD
LU WWN Machine Id: 5 000cca 255e830c9
Firmware Model: APGNW7JH
Person Capability: 6,001,175,126,016 bytes [6.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes bodily
Rotation Charge: 7200 rpm
Kind Issue: Three.5 inches
Machine is: In smartctl database [for details use: -P show]
ATA Model is: ACS-2, ATA8-ACS T13/1699-D revision four
SATA Model is: SATA Three.1, 6.zero Gb/s (present: 6.zero Gb/s)
Native Time is: Mon Might 20 23:00:59 2019 IST
SMART help is: Out there – system has SMART functionality.
SMART help is: Enabled === START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment take a look at end result: PASSED SMART Attributes Information Construction revision quantity: 16
Vendor Particular SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail At all times – zero
2 Throughput_Performance 0x0005 138 138 054 Pre-fail Offline – 100
Three Spin_Up_Time 0x0007 149 149 024 Pre-fail At all times – 436 (Common 449)
four Start_Stop_Count 0x0012 100 100 000 Old_age At all times – 43
5 Reallocated_Sector_Ct 0x0033 100 100 zero05 Pre-fail At all times – zero
7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail At all times – zero
eight Seek_Time_Performance 0x0005 128 128 zero20 Pre-fail Offline – 18
9 Power_On_Hours 0x0012 099 099 000 Old_age At all times – 8501
10 Spin_Retry_Count 0x0013 100 100 zero60 Pre-fail At all times – zero
12 Power_Cycle_Count 0x0032 100 100 000 Old_age At all times – 42
192 Energy-Off_Retract_Count 0x0032 095 095 000 Old_age At all times – 6673
193 Load_Cycle_Count 0x0012 095 095 000 Old_age At all times – 6673
194 Temperature_Celsius 0x0002 117 117 000 Old_age At all times – 51 (Min/Max 25/52)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age At all times – zero
197 Current_Pending_Sector 0x0022 100 100 000 Old_age At all times – zero
198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline – zero
199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age At all times – zero SMART Error Log Model: 1
No Errors Logged SMART Self-test log construction revision no 1
No self-tests have been logged. [To run self-tests, use: smartctl -t] SMART Selective self-test log information construction revision no 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 zero zero Not_testing
2 zero zero Not_testing
Three zero zero Not_testing
four zero zero Not_testing
5 zero zero Not_testing
Selective self-test flags (0x0):
After scanning chosen spans, do NOT read-scan the rest of disk.
If Selective self-test is pending on power-up, resume after zero minute delay.

For those who see Reallocated or Pending sectors, exchange that arduous drive ASAP.

Methods to configure smartd to get electronic mail alert

Edit the file as following utilizing the vim command:
# cd /usr/native/and many others
# cp smartd.conf.pattern smartd.conf
# vim smartd.conf
First, remark out or delete all DEVICESCAN strains:
# DEVICESCAN
Subsequent explicitly listing the gadgets that you just want to monitor. For instance:
/dev/ada0 -a -m disk.admin@your-tld
Add your whole disks too:
/dev/ada1 -a -m disk.admin@your-tld,root@localhost
See smartd.conf man web page for more information. Make sure that smartd begin at boot time, run:
echo ‘smartd_enable=”YES”‘ >> /and many others/rc.conf

Begin/cease/restart the service

# service smartd begin
# service smartd restart
# service smartd standing
# service smartd cease

Conclusion

This web page defined examine laborious drive disk well being in FreeBSD working system utilizing command line instrument and smartd service. It’s important that you just at all times hold backup of all essential information. For additional information see:

Posted by: Vivek Gite

The writer is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a coach for the Linux working system/Unix shell scripting. Get the newest tutorials on SysAdmin, Linux/Unix and open supply subjects by way of RSS/XML feed or weekly electronic mail publication.

Source link

Related Articles

Back to top button