This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

SMART Tools - CLI... need some basic help

Hard disks, HDD, RAID Hardware, disk controllers, SATA, PATA, SCSI, IDE, On Board, USB, Firewire, CF (Compact Flash)
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
roach9
Starter
Starter
Posts: 25
Joined: 02 Jul 2012 20:45
Status: Offline

SMART Tools - CLI... need some basic help

Post by roach9 »

Instead of using the preconfigured SMART scheduler, I'd prefer to use cron to run tests on my drives.

Just wondering, what's the command for running offline test & long test?

smartctl -t /ada1/ ?

I'm trying that and it's not working.
any help?

I looked at the SMART guide, but honestly, it's a bit above me.

User avatar
alexey123
Moderator
Moderator
Posts: 1469
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by alexey123 »

Code: Select all

smartctl --help > /root/smatctl_help.txt
In folder /root you can find help about smartctl.
I'd prefer to use cron to run tests on my drives
Disks|Management|S.M.A.R.T.
Image
It work for me

If you want use smartctl output on your script, you need compose. Example - Temperature check for /dev/ada1.

Code: Select all

smartctl -a /dev/ada1 | grep Temperature | awk '{print $10}' 
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

fsbruva
Advanced User
Advanced User
Posts: 378
Joined: 21 Sep 2012 14:50
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by fsbruva »

Nosy nelly over here.... Can you articulate why you don't want to use the smartctl scheduler? If your cron jobs discover an error - so what? How will you find out about it?

I have had my bacon saved twice now by receiving a SMART email that alerted me to a problem with a headless system in a closet 3,000 miles away.

roach9
Starter
Starter
Posts: 25
Joined: 02 Jul 2012 20:45
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by roach9 »

On my FreeNAS box, when I put in SMART management scheduled tests, they don't run.

Simple as that.

So I'd like to run it from the cron.

What's the command for running a long-test?

davidb
Starter
Starter
Posts: 55
Joined: 05 Jul 2012 17:51
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by davidb »

with cron, try specifying the full path to smartctl
i've seen this come up a bunch of times where cron won't execute a script because its $PATH is too narrow.

Code: Select all

/usr/local/sbin/smartctl -t /dev/ada1
sorry, not sure what the flag for long offline test is

User avatar
alexey123
Moderator
Moderator
Posts: 1469
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by alexey123 »

Why smart not work?
1. Check in gui Diagnostics|Information|S.M.A.R.T. tab? may be your drive not compatible? This is not possible. Only I have so old healthy disk
2. If your drive compatible do

Code: Select all

 smartctl --test=long /dev/ada1
And read answer
smartctl 6.0 2012-10-10 r3643 [FreeBSD 9.1-RC2 i386] (local build)
Copyright (C) 2002-12, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 336 minutes for test to complete.
Test will complete after Wed Nov 7 04:03:48 2012


Use smartctl -X to abort test.
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

roach9
Starter
Starter
Posts: 25
Joined: 02 Jul 2012 20:45
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by roach9 »

I have no idea why it won't work via webGUI.
It works when I run it in Putty...

Thanks alexey123...

fsbruva
Advanced User
Advanced User
Posts: 378
Joined: 21 Sep 2012 14:50
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by fsbruva »

That's odd that the web gui doesn't work. What version are you using? When you save the changes at the webgui, does smartd show that it restarted in the system log? ( I know I'm trying to solve a problem you might not want solved, but...)

roach9
Starter
Starter
Posts: 25
Joined: 02 Jul 2012 20:45
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by roach9 »

Running 0.7.2 Sabanda (revision 8191) on this particular build.

And yes, SMART has restarted once I save and restart the settings...
I'd be very pleased if you figured out what was wrong. ;)

fsbruva
Advanced User
Advanced User
Posts: 378
Joined: 21 Sep 2012 14:50
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by fsbruva »

Hehehe... Or course you would!

I manage a system that is using that same exact release of freenas, and it works famously.

Can you (from SSH or command page on webgui) execute this command:

Code: Select all

smartctl -i /dev/ad4
Except replace ad4 with whatever your drive identifier is, and post the result?

roach9
Starter
Starter
Posts: 25
Joined: 02 Jul 2012 20:45
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by roach9 »

Here's the result:

=== START OF INFORMATION SECTION ===
Model Family: SAMSUNG SpinPoint F4 EG (AFT)
Device Model: SAMSUNG HD204UI
Serial Number: *************** [redacted]
LU WWN Device Id: 5 0024e9 004836126
Firmware Version: 1AQ10001
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 6
Local Time is: Thu Nov 8 10:02:04 2012 PST

==> WARNING: Using smartmontools or hdparm with this
drive may result in data loss due to a firmware bug.
****** THIS DRIVE MAY OR MAY NOT BE AFFECTED! ******
Buggy and fixed firmware report same version number!
See the following web pages for details:
http://www.samsung.com/global/business/ ... msg_id=386
http://sourceforge.net/apps/trac/smartm ... GBadBlocks

SMART support is: Available - device has SMART capability.
SMART support is: Enabled

User avatar
alexey123
Moderator
Moderator
Posts: 1469
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by alexey123 »

==> WARNING: Using smartmontools or hdparm with this
drive may result in data loss due to a firmware bug.
****** THIS DRIVE MAY OR MAY NOT BE AFFECTED! ******
Buggy and fixed firmware report same version number!
See the following web pages for details:


Smartctl gui prevent stop test, for keep your bugged firmware, and you have questions? You need replace firmware before use smartctl.
Also it write message to system log, to smart log..
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

roach9
Starter
Starter
Posts: 25
Joined: 02 Jul 2012 20:45
Status: Offline

Re: SMART Tools - CLI... need some basic help

Post by roach9 »

The firmware has been updated.

These drives are known for displaying the same firmware version number no matter the update.

I've had them for 2 years and used SMART tools on them since... with no issues.

Post Reply

Return to “Hard disk & controller”