LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-20-2013, 01:33 PM   #16
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158

Quote:
Originally Posted by stf92 View Post
Thanks. The thing is that my system is never idle. The hard disk LED is always blinking. Also, I quote myself:
No desktop OS is ever fully idle. There are background processes that do stuff and then log said stuff (or just log). Also there are methods to tweak the disk access. Default is 5 or 10 secs, after that the kernel writes stuff (log information etc) on the hdd to prevent data loss. You can prolong this time, but the problem is that in case of a crash you might lose data (that was cached in memory and not written down).
And you probably guessed that this might depend on the installed programs and DE (simpler DEs write/read less).

One method is to modify your system from ground up to prevent disk access (this is useful mostly if you have flash storage and you want to keep unneded writes down) - this means you have to disable logging or make it do its stuff on a ram drive etc. Not so simple and straightforward, but it can be done if really needed.

If you monitor your cpu, you'll see that mostly its in its lowest p-state anyway (newer cpus have "speed steps", for example mine has 3.20 GHz, 2.90 GHz, 2.60 GHz, 2.20 GHz, 1.80 GHz, 1.40 GHz). Right now i have 81.77% in the lowest p-state (reported since last reboot which was a few hours ago and i was using it since, usually i have 95% or so). This keeps power consumption down and the cpu cooler.
 
Old 06-20-2013, 01:56 PM   #17
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
I still do not understand. Suppose I turn on the machine, the OS is loaded, I loggin, I do not enter the GUI and leave the machine alone. What has it to access the hard disk for now? Give me a simple concrete example.
 
Old 06-20-2013, 02:15 PM   #18
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
cron, disk monitoring, network monitoring, thermal monitoring, fan monitoring, power supply monitoring (on some systems), display monitoring (auto blanking), keyboard monitoring (wake display), memory flushing,...

Do they all have/cause disk activity? depends - if the process needs pages from disk, then yes.

Just run any of the plotting monitors - most of the activity is reported, and things happen roughly on the 1 second, 1 minute, 5 minute boundaries. Watch top for a while.
 
Old 06-20-2013, 03:19 PM   #20
ajohn
Member
 
Registered: Jun 2011
Location: UK
Distribution: OpenSuse Leap
Posts: 122

Rep: Reputation: Disabled
There are couple of simple things that can cause this. If your running kde the built in indexer. It will index and extra ordinary amount of data even including web pages you access. It will also index text on thing you look at. Best disable it especially stringi. Both are under desktop search. I understand Gnome now has something similar built in. Also that it's more "built in" on more recent releases of kde than the one I am using eg indexing email. It will do it less often eventually but if you collect data at the rate I do indexing it isn't a good idea. I just kde's file finder when I need it.

Doubt if you are but if you are using some forms of raid with eg striping then disks will tinkle for ages after an install as data on the discs is re arranged. This is most likely on software and cheaper end raid. If this is the case it will stop eventually.

As to power management last time I did a full install I had to enter one of the options to prevent all sorts of things shutting down including discs. That one I hate as they takes so long to spin up again and start stopping isn't good for them anyway. I've been running opensuse 11.4 for about 3 years and the option was still needed then as it was when I started using Linux around 15 years ago. Last time I installed the option was ACPI=OFF. Not sure what level of control is available at an easy user level now but it hasn't been sufficient for me so far so I turn my machine or monitor off as needed. Nothings worse than reading something that may be a bit testing and find that when the next screen full is needed the disc have to spin up. Also screen blanking out as well. Maybe you went and made a cup of tea, answered the phone. Power management can't really take care of that sort of thing.

John
-

Last edited by ajohn; 06-20-2013 at 03:24 PM.
 
Old 07-19-2013, 07:58 PM   #21
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Rep: Reputation: 154Reputation: 154
After re-reading the replies, I do not think they exactly answered your question, so one last try.
Many of the posts concern activities that should eventually idle, and I understand that they would look entirely different in drive light activity than what you describe (which I know because of the machine I have that does the same thing, I have seen it).


I have one Linux machine that looks to me like it does spin down the drives. It does not have any accesses, it goes totally quiet with a dark screen.

Another Linux here is the same way, the drive is totally quiet when idle.

I have another machine, running the same distribution, that will blink the drive light every 1 or 2 seconds (I think it is the HP pavilion). I suspect it is something in the BIOS.
Interestingly, it does not blink the drive LED this often when running XP (which it is doing right now, which is why I cannot examine it right now).
I have not been able to remember the outcome of the search for the annoying extraneous drive activity.



The drive spin down exists because it is possible to have a Linux machine that does idle without accessing the drives. This does not promise that any standard setup will manage to do that, especially with the tendency of some distributions to automatically load up the machine with gewgaws and gizmos, some of which run in the background.
With all the options, it is possible to setup Linux to have active processes that have to check the drive often.

It is also possible to have a Linux that idles without the disk activity. This would be highly desirable for battery powered computers, where Linux is certainly a favorite choice.
This is not inherent disk activity, it could be stopped if the source can be found.
You may have to live without some facility though.


It is also possible that the activity is error logging, and /var/log should be examined.
Also dmesg.
This logging activity I have also seen and it causes a drive blink every few seconds.

One other thing that would cause such a drive blink is cache flush. That would flush to disk every few seconds any file that had been altered in the cache. It requires that some program be altering a disk file, and finding which is a pain.
There is a open file program, lsof, that gives massive information on which programs are keeping which files open. There is considerable information available on internet on how to use lsof to find files.

A solution would be to create a tmpfs in memory, and make the offending program(s) use that tmpfs. Then such activity would not involve the disk drive. How to do that, is beyond this reply.

Last edited by selfprogrammed; 07-22-2013 at 11:09 AM.
 
Old 07-19-2013, 10:20 PM   #22
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Thank you for your post, selfprogrammed. I don't have a /var/tmp/log (this is slackware 14.0)
Code:
semoi@server:~/work$ ls -l /var/tmp
total 16
-rw-r--r-- 1 root  root     0 2013-01-04 04:55 alsaconf.cards
drwx------ 2 root  root  4096 2013-02-12 13:33 kdecache-root/
drwx------ 6  1001  1001 4096 2013-06-07 16:43 kdecache-sem/
drwx------ 8 semoi semoi 4096 2013-07-19 23:04 kdecache-semoi/
semoi@server:~/work$
As the blinking LED behavior occurs with no GUI running, this directory cannot give me any cues. I'll study dmesg output. I ran lsof and got over a hundred lines (no GUI). I'll study that too.

Some information: after the LILO prompt, and while in this prompt, I see no LED activity. Then, from that prompt, I booted a small operating system, Freedos, and again no LED activity. So the BIOS can't be blamed, I think. If instead, I boot XP, the disk load is heavier, but I use XP once in a while and some commercial gathering information program could be at work. So, behavior under XP doesn't enlighten the situation.

What I will do now is trying to study and debug the system start-up scripts. Also, I could reduce them down to bare bones and see what happens. As I gather more information I'll be posting again.
 
Old 07-20-2013, 06:13 AM   #23
ajohn
Member
 
Registered: Jun 2011
Location: UK
Distribution: OpenSuse Leap
Posts: 122

Rep: Reputation: Disabled
IOSTAT might help tie this down. I have just noticed that my machine is doing it as well. I've just moved to opensuse 12.3 KDE 4.10

I was a little alarmed as I have a ssd system disc and have set it up so that it's never written too and IOSTAT showed writes. Then realised that this was when I installed IOSTAT. Opensuse now installs things like that with a command not found - cnf - utility.

I have a sata disc plugged into a usb hub. The hub shows activity very occasionally but iostat shows no writes.

IOSTAT shows writes to the swap+temp etc hard drive. 2 raided discs that I use for home and some to a device labled md0. The write counts increase each time I run it on all of these.

Currently I have Opera,Firefox,2xDolphin and KDE3 mail open, plus the console.

Closed kmail and writes are shown to the ssd but I'm told that some of the system directories are actually held in ram. Those were left pointing at the ssd. Other writes as before.

Closed both Dolphin windows. No writes to ssd but writes to all of the other discs again.

Closed Opera. Same as closing Dolphin.

There seems to be a grouped set of writes, swap etc about 120kb, home on the raid about 3,500kb. The usb sata hub shows activity occasionally too but no signs of any writes to the disk.

Can't close firefox and send this ---.

Should add that /tmp and /var point to partitions on the disk that holds swap. Home on the raid has nothing but home on it. Also that I understand that opensuse don't write the ext4 journal to disc as a directory has to be added to make it persistent across reboots.

John
-

Last edited by ajohn; 07-20-2013 at 06:19 AM.
 
Old 07-20-2013, 08:23 AM   #24
ajohn
Member
 
Registered: Jun 2011
Location: UK
Distribution: OpenSuse Leap
Posts: 122

Rep: Reputation: Disabled
The writes on my system write disc are to sdb2 and to a much lesser extent sdb3 so

swap no writes at all since boot.
/var most of the writes. 22908 to 25520 kB over about 1 1/2 hrs
/tmp some writes. 8188 to 8956 kB over the same period

Spare space partition on this disc 12 kB writes since booting and then no more

My ssd disc that has the rest of / seems to have had 7412 kB written since booting 5 hrs ago. That has increased at times but by very little. Most of this may be down to installing IOSTAT. YAST keeps update notes etc. No writes to the boot partition on this.

Disk in the usb doc 24 kB since booting and then no change.

MD0 139872 to 165124 kB
Disc 145157 to 171016 kB over the 1 1/2 hrs

MD0 is my raid array. Only has /home on it.

John
-

Last edited by ajohn; 07-20-2013 at 08:34 AM.
 
Old 07-22-2013, 10:59 AM   #25
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Rep: Reputation: 154Reputation: 154
My Win98 system does it (and it DOES do it while running Win98 too).
You are right, it is not /var/tmp/log, it is /var/log.


You could modify your /etc/rc.d startup scripts to see which one starts the activity.
Just copy the whole directory to save it, so it can be totally undone later.

At the top of each file or file section, put
SLEEP 20
ECHO "Startup file xyz"

Then you can see which file or file section starts the activity. This will narrow the possibilities.

Might be able to save two losf outputs to file, separated by a minute, and then diff them to see what activity there is. This should detect changes in file size.

To use inotify to watch files see this article.
http://www.ibm.com/developerworks/li...buntu-inotify/

It cannot be a side-effect of SMART drives because the LED is from the controller and it is indicating controller activity. SMART drives do their own checking, but I believe they do it internally without help from the controller.

Might try to set your drive spin-down time to 1 minute and listen if it will spin down.

Last edited by selfprogrammed; 07-22-2013 at 11:01 AM.
 
Old 07-25-2013, 08:44 AM   #26
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
I have spotted the place where the disk begins being continuously accessed. It is in /etc/rc.d/rc.S. The lines responsible for it are these:
Code:
# Initialize udev to manage /dev entries and hotplugging for 3.x kernels.
# You may turn off udev by making the /etc/rc.d/rc.udev file non-executable
# or giving the "nohotplug" option at boot, but realize that if you turn off
# udev that you will have to load all the kernel modules that you need
# yourself (possibly in /etc/rc.d/rc.modules, which does not promise to list
# all of them), and make any additional device nodes that you need in the
# /dev directory.  Even USB and IEEE1394 devices will need to have the
# modules loaded by hand if udev is not used.  So use it.  :-)
if grep -wq sysfs /proc/mounts && grep -q tmpfs /proc/filesystems ; then
  if ! grep -wq nohotplug /proc/cmdline ; then
    if [ -x /etc/rc.d/rc.udev ]; then
      /bin/sh /etc/rc.d/rc.udev start
    fi
  fi
fi
So the only solution would be to turn off udev? But is mine the only machine where udev causes this effect?

I booted with the 'nohotplug' option and, apart for being left with no keyboard, because it is USB and the modules were not loaded (I got the login prompt as usual), when I reset the machine, fsck forced a check of the root filesystem, saying it had not been cleanly unmounted. Why can this be?

Last edited by stf92; 07-25-2013 at 09:17 AM.
 
Old 07-25-2013, 09:04 AM   #27
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by stf92 View Post
I have spotted the place where the disk begins being continuously accessed. It is in /etc/rc.d/rc.S. The lines responsible for it are these:
Code:
# Initialize udev to manage /dev entries and hotplugging for 3.x kernels.
# You may turn off udev by making the /etc/rc.d/rc.udev file non-executable
# or giving the "nohotplug" option at boot, but realize that if you turn off
# udev that you will have to load all the kernel modules that you need
# yourself (possibly in /etc/rc.d/rc.modules, which does not promise to list
# all of them), and make any additional device nodes that you need in the
# /dev directory.  Even USB and IEEE1394 devices will need to have the
# modules loaded by hand if udev is not used.  So use it.  :-)
if grep -wq sysfs /proc/mounts && grep -q tmpfs /proc/filesystems ; then
  if ! grep -wq nohotplug /proc/cmdline ; then
    if [ -x /etc/rc.d/rc.udev ]; then
      /bin/sh /etc/rc.d/rc.udev start
    fi
  fi
fi
So the only solution would be to turn off udev?
Hardly a solution - udev is a base system component.
 
Old 07-25-2013, 09:05 AM   #28
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Sleep 30?
 
Old 07-25-2013, 09:19 AM   #29
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by gradinaruvasile View Post
Hardly a solution - udev is a base system component.
No it isn't.

It is a "nice to have" thing for desktop workstations. You can always manually load the modules.

And polling a disk is not a necessary thing either, even for udev. It is only doing this to look for new rules. It could just as easily load the rules on startup, then just use those out of memory.

The only need to go back to the disk is to load an unloaded module.
 
Old 07-25-2013, 09:37 AM   #30
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
So I could make /etc/rc.d/rc.udev non-executable (or boot with the 'nohotplug' option) and rely on /etc/rc.d/rc.modules or else make udev load the rules on startup? How could I do the latter?
 
  


Reply



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
disk space continuously decreasing please help punk123456 Linux - Newbie 10 09-06-2010 05:49 PM
Hard Disk Access William Reading Linux - General 8 10-31-2006 03:23 PM
how to access to second hard disk ? medya General 6 10-27-2005 12:45 AM
Hard disk continuously even i have logouted??? hkl8324 Fedora 5 08-09-2004 11:59 AM
hard disk access staudman Linux - Hardware 2 07-25-2004 07:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:15 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
Open Source Consulting | Domain Registration