LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-27-2007, 08:27 AM   #1
tferero
Member
 
Registered: Sep 2007
Location: Near the Canadian border
Distribution: kubuntu 8.04 Hardy Heron
Posts: 48

Rep: Reputation: 16
Smartctl does not work - checking for HD spins


Hi,

I have read several reports now about problems with feisty and gutsy excessively spinning down the harddrive, causing the possibility of severe wear and tear (http://ubuntudemon.wordpress.com/200...ve-killer-bug/). I installed smartmontools, and issued the $ sudo smartctl -a /dev/sda1 command to see how often the disk was spinning. I received the following output, saying my device doesn't support SMART.

I am not well versed with the command line or its messages. Does anyone have any comment on this as to whether I simply cannot use this utility, or if I have any other option to see how often my drive is spinning?

Laptop mode is disabled in /etc/default/acpi-support - I did check that. Also, since my battery is shot, I only use AC power when running my laptop, but I have heard that on some occasions, the bios controls this function (or the hd firmware).

I am not sure if this problem affects me, but it would be nice to know.

Many thanks.

****************
tferero@ubuntu:~$ sudo smartctl -a /dev/sda1
Password:
smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Device: ATA SAMSUNG MP0402H Version: YQ20
Serial number: S03WJ10L783528
Device type: disk
Local Time is: Sat Oct 27 07:39:49 2007 EDT
Device does not support SMART

Error Counter logging not supported

[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']
Device does not support Self Test logging
***************
 
Old 10-27-2007, 08:42 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
I am interested in this issue for my own notebook. Within the next couple of days I will probably posting on the System76 forum on ubuntuforums.org about this issue. I am certainly not an expert, but I can tell you what I have found so far on an edgy installation.

First, I already knew that from checking a data sheet that my drive was a (P)ATA aka IDE drive and I would expect it to be compatible with SMART. Yet running smartctl -i /dev/sda said it was not. What I found was I needed to tell smartctl that is was an ATA device and not SCSI:

Code:
smartctl -d ata -i /dev/sda
and similarly for other options on smartctl

I hope this if helpful.
 
Old 10-27-2007, 09:49 AM   #3
tferero
Member
 
Registered: Sep 2007
Location: Near the Canadian border
Distribution: kubuntu 8.04 Hardy Heron
Posts: 48

Original Poster
Rep: Reputation: 16
blackhole54, this was very helpful. Starting with your command, I arrived at:
$sudo smartctl -d ata -a /dev/sda1 | grep Load_Count_Cycle

I seem to be averaging about 5 spins per minute. Can you offer comment as to how this is? Too much or about right?

I am not sure what is normal for disk spins.

If this is too high, what do I do next? For something like this, I really need step-by-step instructions that offer some insight as to what is being done.

This seems like it could be a huge issue, especially for newbies who have very little experience with the types of fixes this might require (e.g., editing special files and command line entries). I am very comfortable with both, as long as I know what to do.

Thanks again for the help you gave.
 
Old 10-27-2007, 10:06 AM   #4
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
The questions you are asking relate to why I am going to try to get some answers from System76 who sold me the computer (with edgy eft preloaded). I am as new to this load count thing as you are. According to the article (which I only read a day or two ago) and the data sheet for my disk drive and my (lack of?) understanding, it sounds to me like my drive should have died about a week or two ago. (OK, I am playing fast and loose with statistics.) And my computer is less than a year old. My average is several a minute like yours.

If I had any sage advice concerning this, I'd give it.
 
Old 10-27-2007, 10:20 AM   #5
tferero
Member
 
Registered: Sep 2007
Location: Near the Canadian border
Distribution: kubuntu 8.04 Hardy Heron
Posts: 48

Original Poster
Rep: Reputation: 16
I've been looking around. This might help, but I have a question or two for anyone who has the answer (questions follow):

From this website: http://ubuntudemon.wordpress.com/200...ve-killer-bug/

These instructions:
*********
Laptop Hardrive Killer Bug is worse than I thought :
http://ubuntudemon.wordpress.com/200...han-i-thought/

The (ugly) fix :

Disable laptop-mode in /etc/default/acpi-support. And $sudo laptop_mode stop

If your Load_Cycle_Count is still increasing fast then :
$ sudo hdparm -B 255 /dev/sda

$ sudo hdparm -S 0 /dev/sda

To make these hdparm commands permanent follow both of these instructions :
https://bugs.launchpad.net/ubuntu/+s...95/comments/25
https://bugs.launchpad.net/ubuntu/+s...95/comments/14 and don’t forget to include “hdparm -S0 /dev/sda” in this last fix

Also don’t forget to :
$sudo chmod +x 99-hdd-spin-fix.sh
***********

My questions:
1. From the second instruction reference link in the above instructions, I am told to: "make a file named "99-hdd-spin-fix.sh". The important thing is starting with "99"."
--how do I make this type of file?

2. Regarding the last line in the above instructions: what is this line about? I know chmod sets access, but the '+x' is what I don't know about.

Thanks!
 
Old 10-28-2007, 02:38 AM   #6
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by tferero View Post
1. From the second instruction reference link in the above instructions, I am told to: "make a file named "99-hdd-spin-fix.sh". The important thing is starting with "99"."
--how do I make this type of file?
There is nothing special about this file. The instruction just refers to the name of the file. There is no problem having a file name start with a number. So just use your favorite text editor (gedit, kate, vi, emacs, etc) to create it. It might be easiest to create the file as a normal user and use the install command to copy it to the three specified locations:

Code:
sudo install 99-hdd-spin-fix.sh  /etc/acpi/suspend.d/
sudo install 99-hdd-spin-fix.sh  /etc/acpi/resume.d/
sudo install 99-hdd-spin-fix.sh  /etc/acpi/start.d/
Assuming you created the file in your current working directory, this will copy the file to the respective directories while changing the owner to root and setting reasonable permissions. After installing the file, you can delete the original if you wish.

I would think it would be a little bit cleaner to install only one copy of the file and then create symlinks to it. But that is a little more advanced, so unless you are already comfortable doing such things you might want to just stick with three files.

Quote:
2. Regarding the last line in the above instructions: what is this line about? I know chmod sets access, but the '+x' is what I don't know about.
"x" is the execute bit. The plus sign means to set it. Linux won't execute a file without the execute bit set. (There is what at first blush might appear to be an exception when you provide a script as an argument to the program interpreting it.) You might wish to take a look at the chmod man pageto see the various ways to use it to modify permissions. If you use the install command as a shown above, you won't need to change the permissions on the installed files.

======

As I understand the instructions from the two launchpad links, those are two ways for accomplishing the same thing. So you probably don't want to do both of them. But you should test that whatever you implement accomplishes what you wish.
 
Old 10-28-2007, 09:42 AM   #7
tferero
Member
 
Registered: Sep 2007
Location: Near the Canadian border
Distribution: kubuntu 8.04 Hardy Heron
Posts: 48

Original Poster
Rep: Reputation: 16
Backhole54, many thanks for those very clear instructions. I ended up posting another related entry in hardware exploring this problem in more detail. I don't normally cross-post in a forum, but this q&a was originally about smartctl more than the problem at the time I wrote it.

I have spent some time reading the man pages on smartctl, and in the Kubuntu IRC, and still no resolve on the load cycle issue. I followed the temporary hdparm commands as suggested in the help I pasted above, and I went into my bios and disabled the power management - still no change in the load cycle readings. I even tweaked the -B and -S settings after learning what they really did - nothing made a difference.

Another curious thing is that smartctl says I have 28,000 hrs on my harddrive, which is a physical impossibility since I have only had it about 8 months (unless it wasn't new like it was supposed to be when I got it).

Around midnight last night, after spending time scouring the man pages on smartctl, I began to wonder if the smartctl software displays the text load cycle in hours, but my hardrive firmware is actually reporting minutes. From there, I wonder if the load cycle readings are doubled: load/unload reading as an output of 2 loads, rather than a single instance. The man pages do indicate that some drive manufacturers program the smart drives to have differing outputs, compared to others.

Additionally, I don't hear my drive doing anything. I am beginning to wonder, with so many people experiencing this problem, if the smartctl program is misreporting the info somehow. I intend to email them a report to see about that.

I am especially perplexed that the temporary command lines to suspend power management and spin times had no affect, according to the smartctl output.

If you are interested in my output, you can see it in my other post. I notice that pasting the url doesn't seem to work, but I only have a few posts/threads, so you can get to it my clicking on my username pretty quickly in this thread post.
 
Old 10-28-2007, 10:59 AM   #8
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
tferero,

Your observations from the man apes are germane. But I would doubt counts get arbitrarily doubled, but I can't say for sure.

I have posted my results in the System76 forum over at UbuntuForums here if you are interested. (System76 sold me the systems with Ubuntu pre-installed. I am hoping to get their take on this situation.) The quick summary is

Code:
hdparm -B255 /dev/sda
stopped Load_Cycle_Count from increasing except for an increase of 2 to 3 at each boot. While reviewing other threads on http://ubuntuforums.org I noticed that some other people were reporting difficulties similar to yours. I had searched on the keyword smartctl if you want to see if you can find anything usefull over there.

=====

I don't know why you had trouble posting a URL for your post. You obviously posted other URLs w/o problem. To combat spam, LQ does restrict people with very low post counts, but I would think you would be well beyond that by now.

I've looked at your other post but at this time I don't have a response. (Maybe after some rest -- I am getting tired too.) But here is a hint on making your posts more readable: whenever you post computer output (such as the output of smartctl, wrap it in "code tags" which will cause everything to line up right. You can do this by highlighting the text and clicking the hash mark (#) above the box you are editing. You can also type them in manually. (Just observe the tags the hash mark icon adds.)
 
Old 10-28-2007, 01:37 PM   #9
tferero
Member
 
Registered: Sep 2007
Location: Near the Canadian border
Distribution: kubuntu 8.04 Hardy Heron
Posts: 48

Original Poster
Rep: Reputation: 16
Thanks for the '[code]' tip - that made the post much nicer!

I will be watching your post on Ubuntu to see what develops. Also, I emailed the people at smartmontools to see if this could be a software issue.

At this point, it feels to me like either Smartmon is not reporting the info correctly or it is a problem with the firmware itself. Power management is definitely off for me at all levels, and I am not hearing my drive click all the time, like I might expect to.

As far as the strange number of usage hours I am getting, I do believe that Samsung reports in minutes or even half-minutes, but I haven't been able to confirm that yet. The Smartmontools website indicates that this is the case with other drives.

All very strange, IMHO.

If I get a response from Smartmon that offers a clue to the problem, I will summarize it here.
 
Old 10-29-2007, 12:13 AM   #10
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by tferero View Post
If I get a response from Smartmon that offers a clue to the problem, I will summarize it here.
Thanks. Maybe we both ought to just post everything from here on out on that other thread, just to keep things sane.

EDIT: BTW, for anybody else following this, that other thread is here

EDIT2: A moderator has closed that other thread so we are back to this one. tferero, if you think this thread really should be in the hardware forum, you can use the "report" button to request a moderator to move it.

Last edited by blackhole54; 10-29-2007 at 03:22 AM.
 
Old 10-29-2007, 03:40 AM   #11
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
lazlow,

I can't speak for the OP, but I know on my machine typically very little is swapped out and I would be surprised that it swaps much. (As I haven't had that computer running right now, I can't give you vmstat output that would mean much.) Yet, on average that machine was incrimenting Load_Cycle_Count 3 times a minute. I would imagine most of this has to do with logging. I know for example that NetworkManager would typically be logging at least every other minute. I believe there are other services that frequently log as well. In edgy eft (and probably later incarnations) syslog by default is set up to log everything at all levels (including, as I understand it, debug) except for security info.

Last edited by blackhole54; 10-29-2007 at 03:46 AM. Reason: spelling
 
Old 10-29-2007, 12:47 PM   #12
tferero
Member
 
Registered: Sep 2007
Location: Near the Canadian border
Distribution: kubuntu 8.04 Hardy Heron
Posts: 48

Original Poster
Rep: Reputation: 16
Blackhole54: The thread can stay here, no problem by me. The title may seem a bit misleading for the direction of the conversation, but that's ok. The mods are there to keep the boards neat 'n clean - no sense going against the sensible advice

Lazlow: if you are still following this thread, I am running a Dell Latitude C610, with 128MBs of RAM. Definitely it has to work harder because of that. But honestly, I don't hear the drive clicking or making noise all that often, so this whole issue of the Smartctl output puzzles me.
 
Old 10-30-2007, 12:29 AM   #13
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by tferero View Post
I am running a Dell Latitude C610, with 128MBs of RAM.
From my experience with Ubuntu (not Kubuntu) that sounds pretty marginal to me. You might be swapping a lot. After you have been using the computer a while, you can use vmstat to list (among other things) how much you have been swapping on average (the si and so columns). See the man page to interpret these numbers. And you can usethe free command to see how much swap space you are using.

On the Ubuntu Forum thread, sombody who bought the same type (I think) computer at about the same time as I bought mine reports an average load count that is about 1/30 mine even though it has approximately the same number of hours. I don't understand that at all. While I did not upgrade from edgy, this person did upgrade edgy -> fiesty -> gutsy. Now with gutsy this person is reporting load counts incrimenting at about 200/hr which is about what mine was before I set disk power management to "255."
 
Old 11-01-2007, 12:55 PM   #14
ubuntu.michael
LQ Newbie
 
Registered: Nov 2007
Posts: 1

Rep: Reputation: 0
Talking Another Newbie

Quote:
Originally Posted by blackhole54 View Post
From my experience with Ubuntu (not Kubuntu) that sounds pretty marginal to me. You might be swapping a lot. After you have been using the computer a while, you can use vmstat to list (among other things) how much you have been swapping on average (the si and so columns). See the man page to interpret these numbers. And you can usethe free command to see how much swap space you are using.

On the Ubuntu Forum thread, sombody who bought the same type (I think) computer at about the same time as I bought mine reports an average load count that is about 1/30 mine even though it has approximately the same number of hours. I don't understand that at all. While I did not upgrade from edgy, this person did upgrade edgy -> fiesty -> gutsy. Now with gutsy this person is reporting load counts incrimenting at about 200/hr which is about what mine was before I set disk power management to "255."
Hi gang!
Just have started using Ubuntu. I'm an AutoCAD guy so I've never considered Linux until recently I loaded it (dual boot) on my Toshiba M65.

I love the look and feel, but I'm concerned what I'm reading about hard drives. I typed the "vmstat" as recommended and both si and so columns show 0! I just booted into Ubuntu. Is this a running total or just for the present boot?

Also, I'm clueless about many things at this point. I created the "99-hdd-spin-fix.sh" file and have it in my "Home Folder". I tried going to "Applications>Add/Remove" and can't seem to get to it to install from there. I also went into the Terminal and typed the "sudo install 99-hdd-spin-fix.sh" commands just as shown into the 3 locations.

I first am asked for my password, then after I enter it I get the following message: "install: cannot stat '99-hdd-spin-fix.sh': No such file or directory"

I'm rather literate in Windows XP but clueless here. Any help will be much appreciated!

ubuntu.michael
 
Old 11-01-2007, 11:08 PM   #15
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by ubuntu.michael View Post
I typed the "vmstat" as recommended and both si and so columns show 0! I just booted into Ubuntu. Is this a running total or just for the present boot?
If used without any parameters, vmstat will show the current value and averages since boot as appropriate for each item. It has no knowledge of what happened prior to your last boot. The si and so (swap in and swap out) values are averages. Look at the man page by typing

Code:
man vmstat
for info on how to interpret those figures as well as other options you can use with vmstat. This will allow you to see how much you are swapping. vmstat will also list the amount of swap space you are currently using. (Now that I review, the zero figures you see are good. If you have been using the system a while before running this command, it means your memory is adequate and you are doing very little if any swapping. But you could still have problems -- see the following paragraph about smartctl.)

Before you go altering the behavior of your computer, I would suggest you download the smartmontools package and use smartctl to see what figures are being reported for your drive. Using an analogous procedure to what I showed above, consult its man page for details. (BTW, in this usage man is short for manual -- as in a reference manual.)

Quote:
I tried going to "Applications>Add/Remove" and can't seem to get to it to install from there.
That is for downloading/installing and uninstalling packages. It is (as I understand it -- I haven't used it) a basic program to simplify doing some of the same things the synaptic package manager does, but with a much more limited selection.

Quote:
I also went into the Terminal and typed the "sudo install 99-hdd-spin-fix.sh" commands just as shown into the 3 locations.

I first am asked for my password, then after I enter it I get the following message: "install: cannot stat '99-hdd-spin-fix.sh': No such file or directory"
It can't find the file. Assuming you did not make a typo (in either the command or the file's name), the file was not in your current working directory when you typed the command. You can either use the cd command to change to the directory where the file is or you can specify the filename along with its path

EDIT: BTW, the Bash shell (which you are probably using in your terminal) has a feature called "tab completion." Assuming the file really does exist in your current directory (but perhaps you misnamed it), and if it is the only file that starts with "99" (a likely situation), then when you type the command and get to the filename, you can just type "99" and hit the tab key and Bash will fill in the rest of the filename for you. Very handy.

Last edited by blackhole54; 11-01-2007 at 11:16 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
smartctl and smart issues blu_alchemist Linux - Server 2 06-07-2007 04:38 PM
smartctl output Machiaveli Linux - Hardware 2 09-29-2006 01:06 PM
Checking how many users are connected on different solaris work stations sajidmumtaz Solaris / OpenSolaris 14 06-27-2006 06:31 AM
reiserfsck and smartctl samac Slackware 4 07-10-2005 05:05 PM
smartctl rch Linux - Hardware 0 04-14-2003 12:11 AM


All times are GMT -5. The time now is 02:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration