"smartctl" for diagnosing drive issues

Posted by: mlord

"smartctl" for diagnosing drive issues - 17/04/2005 12:33

EDIT: Note, this stuff requires Hijack v426 or higher

I'm nowhere near an empeg today, but here you will find a compiled static binary for "smartctl", which can be downloaded and run (hopefully) on an Empeg/Rio Car unit.

It has a ton of confusing options, but basically you need to do the following to see if your hard drive is good or not:

#STEP-1:
./smartctl -s on /dev/hda
./smartctl -l error /dev/hda

#If the output looks good, next try this:

#STEP-2:
./smartctl -t short /dev/hda
# wait a few minutes
./smartctl -l selftest /dev/hda
./smartctl -l error /dev/hda

#Again, if the output looks good, then do the lloonngg test,
which will perform a full media scan for bad sectors.

#STEP-3:
./smartctl -t long /dev/hda
# wait a few hours
./smartctl -l selftest /dev/hda
./smartctl -l error /dev/hda

Cheers
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 17/04/2005 12:39

Updated original post above with a link to the downloadable binary.
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 17/04/2005 13:44

Dude. Thank you so much.
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 17/04/2005 14:02

empeg:/drive0/var/smartctl# ./smartctl -l error /dev/hda
smartctl version 5.33 [arm-empeg-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Error SMART Status command failed: Input/output error
A mandatory SMART command failed: exiting. To continue, add one or more '-T perm
issive' options.


I don't think it means the drive is bad because it's actually working fine right now and able to play music and such. After a FSCK it even finished the 2-gig download I'd started earlier without complaint, and did a proper database rebuild.
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 17/04/2005 14:58

Probably due to our ancient kernel missing a feature or two.

But just do like it suggests, and insert a -T permissive option immediately after smartctl and before all of the original command line flags, on each invocation of smartctl.

Or for that matter, use -T verypermissive instead.

Cheers
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 17/04/2005 15:02

Oh, and I suppose it may be necessary to do smartctl -s on /dev/hda once before all of the other commands are issued.
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 17/04/2005 15:08

Mmm.. okay, yes, our empeg/hijack kernels are missing the HDIO_DRIVE_TASK ioctl(), needed by smartctl. I'll add it into Hijack, and then all of this stuff should work.

Cheers
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 17/04/2005 15:35

Tony: try installing this (deleted) copy of Hijack, and then try smartctl on that, please.

Thanks
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 17/04/2005 15:57

Working now. Doing the 2-minute wait...
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 17/04/2005 16:04

Looks good so far. Keeps saying "No errors logged".

Going to do the long test in just a little while after I run an errand.

Thanks again for your help!
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 17/04/2005 16:15

Okay, good. I've just released that same Hijack as v426 now. No need for you to upgrade from the special v425+ copy.

Cheers
Posted by: SE_Sport_Driver

Re: "smartctl" for diagnosing drive issues - 17/04/2005 16:33

Mark, any chance of getting all these cool little tools you've released onto you HiJack page? This, fidsift and the one that lets us have large root playlists (and bookmarks) all in one page would be awesome.
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 17/04/2005 16:34

I think I need somebody to manage this kind of stuff for me/us on riocar.org, really.

Cheers
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 17/04/2005 17:56

Okay, I've added this to the FAQ. I've used your instruction text with a few small edits. Thanks for all your help. The long test is running now....
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 17/04/2005 18:07

Long test complete. No errors:

q
Restored terminal settings
Remounting first music partition read-only
Remounting second music partition read-only
No secondary hard disk
Player exited normally: 0
Switching to shell-player loop
Starting bash.
empeg:/empeg/bin# cd /drive0/var/smartctl
empeg:/drive0/var/smartctl# ./smartctl -s on /dev/hda
smartctl version 5.33 [arm-empeg-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.

empeg:/drive0/var/smartctl# ./smartctl -l error /dev/hda
smartctl version 5.33 [arm-empeg-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
SMART Error Log Version: 1
No Errors Logged

empeg:/drive0/var/smartctl# ./smartctl -t long /dev/hda
smartctl version 5.33 [arm-empeg-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== 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 55 minutes for test to complete.
Test will complete after Sun Apr 17 20:04:32 2005

Use smartctl -X to abort test.
empeg:/drive0/var/smartctl# ./smartctl -l selftest /dev/hda
smartctl version 5.33 [arm-empeg-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 4635 -
# 2 Short offline Completed without error 00% 4634 -

empeg:/drive0/var/smartctl# ./smartctl -l error /dev/hda
smartctl version 5.33 [arm-empeg-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
SMART Error Log Version: 1
No Errors Logged

empeg:/drive0/var/smartctl# exit
logout
Shell exit
Starting player
Timezone: US/Pacific
Hijack: intercepting config.ini

player.cpp : 385:empeg-car 2.00 2003/04/01.
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 18/04/2005 01:22

Well, that's pretty definitive. The drive is A-okay.

Cheers
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 22/01/2006 04:46

I've been trying to use smartctl to see if the original 12g disk or the disk added later are on their way out as I suspect & can't get it to work. The disks still work but did recently make some strange clicks today. One of two drives is suspect, the ethernet about this time didn't want to connect but after a cool down session (unplugged for awhile) it works fine now.
Any way using the instructions here, I have the smartctl file in it's directory, I have the file chmod 755, I think as it says -rwxr-xr-x. I get to the shell prompt & try to execute the smartctl file by typing in ./smartctl -s on /dev/hda at the prompt. I continue to get "no such file or directory' error even though I'm in that directory.
Any ideas on what's missing?
Mk2 running Developer 2.0 final/Hijack v.444
emphatic

Edited-Odd behaviour now, upon exiting shell in Hyperterminal the player rebooted w/o Hijack installed and my startup logo reverted back to the stock animation logo. I've re uploaded Hijack to the player now.
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 22/01/2006 13:43

Foolproof instructions:

ftp your.empeg.ip.address
userid: root
password: whatever
cd /
site rw
put smartctl
chmod 0755 smartctl
site ro
quit


Now hook up the serial connection, get a command prompt, and do:

/smartctl -s on /dev/hda
/smartctl -a /dev/hda
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 22/01/2006 15:39

Thanks Mark I'll try that. I actually tried to use FTP first using WS_FTP but smartctl wouldn't run from there either, my knowledge is limited on both methods but Hyperterminal has usually been pretty successful for me. So I chalked it up to the drive being bad. I'm trying the new approach now.
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 22/01/2006 23:06

Foolproof instructions unfortunately don't work for me I guess . I've had a helluva time here getting things to work. First ethernet stopped working (connecting to player) again even though it's worked flawlessly before. Hyperterminal was giving just as many quirks until I reinstall developer image again.
For some reason even though smartctl is in it's own directory and the file is there & it's been made executable, the darn file won't run. What's the filesize suppose to be? I have d/l the file several times to make sure it wasn't corrupt. For some reason when I exited Hyperterminal Hijack menu was missing & the LED flash has returned to default speed. I can reinstall Hijack but the fact it keeps disappearing is strange, it's never happened before. I'm stumped any suggestions, the player is still playing music & w/the exception of Hijack missing seems normal although all personalized settings defaulted.
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 22/01/2006 23:40

Quote:
Now hook up the serial connection, get a command prompt, and do:

Now by this using Hyperterminal right?
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 23/01/2006 00:15

OK I've figured out what I doing wrong, instead of ./smartctl -s on /dev/hda I didn't know that the .bin extension was required but I think I tried that route before. I discovered that the changes I made v.439 of Hijack instead of v.444 & used the Hijack feature of 'Force DC power mode'. I'll get back as to if these did indeed make it work.
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 23/01/2006 00:32

Linux doesn't have the concept of "file extensions" -- that's really only something for MS-DOS (and its brethern). If you named the file "/fred.george", then the command to invoke is "/fred.george". Or "smartctl.bin". Or whatever.

-ml
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 23/01/2006 00:46

so when I renamed it .bin myself I didn't need to OK got it. Thanks. I've tried it w/o the player in 'DC Car mode' & it still works. I installed v444 (using LogoEdit 1.7) back again & am having trouble again w/Hyperterminal saying 'unable to open com port'. If Hyperterminal does connect it won't go into 'shell prompt'.
Update-I still have v.444 on the player & am having trouble getting Logo Edit 1.7 or Hyperterminal to connect, I get 'com port error' on Logo Edit or 'unable to open com port' error in Hyperterminal.
Update-OK I have Hijack v.439 back on my player after using Emplode to reinstall devoloper v.2.00 on player then Logo Edit to install Hijack. Hyperterminal connects w/no problem to shell. Somewhere I'm missing a switch or something along the changes in Hijack versions or something. Any help w/that?
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 23/01/2006 07:43

Mark, I believe what might be happening is that your recent changes to the way Hijack deals with the serial port are now causing people (well, one person so far) to have problems with existing tools and existing FAQs and sets of instructions. I could be wrong about this, though. I just seem to remember about a month or two ago reading one of your hijack changes, and thinking to myself, "suddenly a bunch of serial port stuff will stop working for a lot of people." Dunno if this is due to that or not. Anyway, if that's what it is, is there anything you can offer him by way of what to do to solve the problem?
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 23/01/2006 10:27

I hate to make all the trouble, I thought maybe there was some switch or config.ini menu change I missed. A person could revert back to a previous Hijack version in order to perform the disk check since they most likely be checking the disk all that often. I did find errors though as I suspected, don't know what they mean yet but a new drive is on it's way. I want to transfer all the data before it goes tits-up.
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 23/01/2006 13:18

Quote:
I hate to make all the trouble, I thought maybe there was some switch or config.ini menu change I missed.


Yes. Hijack Menu, "Serial Port Assignment", "Player Uses Serial Port". Then change it back to "Apps use Serial Port" once you're done with hyperterm. Reboot required immediately after each change.

-ml
Posted by: JBjorgen

Re: "smartctl" for diagnosing drive issues - 23/01/2006 15:12

That begs to be added to the Hyperterminal entry in the FAQ. Updating wiki now...
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 23/01/2006 19:27

I'm just wondering, if this new behavior breaks hyperterminal, what other stuff does it break? How many other FAQ entries do I have to update? Oh, and what version of Hijack implemented this feature?
Posted by: JBjorgen

Re: "smartctl" for diagnosing drive issues - 23/01/2006 20:07

Fortunately, having just copied most of the FAQ over to the wiki, it appears that you link to that one FAQ article just about every time a serial connection is required. According to the Hijack website, this appeared in v440. You can see the addition I made in the wiki here.
Posted by: schofiel

Re: "smartctl" for diagnosing drive issues - 23/01/2006 20:33

Caught me too. Press knob to get to HiJack, go to the settings for the COM port, change it to "player uses port", connect with Hyperterm.
Posted by: JBjorgen

Re: "smartctl" for diagnosing drive issues - 23/01/2006 20:42

Here's the v441 thread where it was announced.
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 23/01/2006 20:59

Okay, I updated the FAQ. I put it up at the top of the entry. Thanks!
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 23/01/2006 21:12

Boy do I feel foolish. I D/L'd w/o checking BBS on what the new version was for, which is what I usually don't do. Most of the time the changes don't affect my use, but I like to keep it updated. Sorry for the trouble, move along nothing to see here.
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 23/01/2006 21:31

I'll be damned, I never noticed that extra menu entry in Hijack. Sorry Mark for the trouble.
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 23/01/2006 22:34

Oh, heck.. it still gets me from time to time as well.

I might change it again someday when I have time -- it should really use the "old" behaviour up until some app actually accesses the serial point, at which time it should disconnect the player from it. I think that (or an option for that) would be ideal.

Cheers
Posted by: JBjorgen

Re: "smartctl" for diagnosing drive issues - 24/01/2006 00:51

Or how 'bout giving the player control when it detects a ctrl-c? Maybe not...I guess your idea is better.
Posted by: tman

Re: "smartctl" for diagnosing drive issues - 24/01/2006 07:07

Quote:
Or how 'bout giving the player control when it detects a ctrl-c? Maybe not...I guess your idea is better.

That'd be really confusing if it did that.
Posted by: mcomb

Re: "smartctl" for diagnosing drive issues - 28/01/2006 22:16

Quote:
Quote:
Or how 'bout giving the player control when it detects a ctrl-c? Maybe not...I guess your idea is better.

That'd be really confusing if it did that.

Agreed. Personally I find it a bit confusing that hijack is making any change to the default behavior without the user selecting it. I'm sure Mark had a reason, but I must have missed it. So why isn't the default to let the player use the serial port unless the user specifically changes it? I think I'm still running the hijack version from just before this change so this is going to get me when I next update hijack.

-Mike
Posted by: mlord

Re: "smartctl" for diagnosing drive issues - 28/01/2006 22:55

Quote:
why isn't the default to let the player use the serial port unless the user specifically changes it?


That *is* the default. Unless you install Hijack. Then, the default becomes "enable Hijack's features", which requires that the player's output not go to the serial port, but rather, be intercepted by Hijack.

Duh.

But as I said already, that's not the best way. The best would probably be to have the player's stuff go to the serial port, and *still* be intercepted/used by Hijack. As before The Change.

Cheers!
Posted by: mcomb

Re: "smartctl" for diagnosing drive issues - 28/01/2006 23:41

Quote:
Duh.

I just reread your original thread describing the change and I understand the reasoning for the change now. I'd still argue that it is counterintuitive, but you provided fair warning so whatever floats your twinkie.

-Mike
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 29/01/2006 17:50

I'm about to do a drive change & of course it involves Hyperterminal. If a person was to forget to change the serial port assignment beforehand would that be hazardous or could it be resolved after the fact?
Posted by: tfabris

Re: "smartctl" for diagnosing drive issues - 29/01/2006 23:48

If you're doing the drive change according to the Drive Upgrade Guide, Hijack isn't part of the procedure. Without hijack installed, the serial port assignment thing isn't an issue.
Posted by: Snowshoe

Re: "smartctl" for diagnosing drive issues - 30/01/2006 02:50

OK thanks Tony I think I have a bad new laptop drive. I've done a lot of swapping & reading of posts for answers. The 'builder upgrade' file can't find a pump. Another drive works in it's place so I've ruled out bad cables & header solders. Any problems associated w/Fujitsu Travelstar 40G drives in a Mk2a that anyone recalls?
Posted by: Shonky

Re: "smartctl" for diagnosing drive issues - 31/01/2006 19:26

Do you have the jumpers set correctly?

Are you using it in tandem with another drive? There are quite rare cases where some drives "don't play well with others". They will certainly play up if there are two jumpers and both are set to slave or both to master.