PDA

View Full Version : Regular Disk Activity (Ubuntu)



Zoltan
2007-10-31, 16:52
With some suggestions from these forums, I got my Mini-ITX box up and running a few months ago, running Ubuntu Edgy headless. I run SlimServer (of course!), got AlienBBC working, and set up some basic Samba shares so it can also act as a backup server. All this involved fairly intense activity over a short period of time and since then I have pretty much left it running. (Which is how it should be as far as I'm concerned!)

Having said that ... something has been niggling me. The HD activity light blinks every few seconds. It does this consistently, and since the box is running 24/7 I am getting a bit worried that the drive is being stressed more than it needs to be.

I am not sure what is causing the activity but given that the box is not set up to do many things, SlimServer is an obvious suspect, as is the OS itself.

Does anyone have any ideas about this? In general, I believe it is not possible for the main OS HD to actually power down but are there any techniques or tweaks to keep disk activity to a minimum both with SlimServer and Ubuntu?

Thanks in advance for any tips.

--Zoltan

dem
2007-10-31, 18:12
There's a process that polls for CD/DVD insertions. I don't think this would cause the LED on your disk to blink, but it would probably cause the motherboard's HDD LED (from the F_PANEL connector) to blink, if that's the one you're talking about.

If I kill the following process the CD/DVD polling stops:

hald-addon-storage: polling /dev/scd0 (every 2 sec)

This is on Feisty, but I imagine Edgy is the same. I'm running it under VMware Workstation which lets me observe CD/DVD and HDD activity separately.

Zoltan
2007-11-01, 16:08
Thanks for the suggestion but I don't see that process.

The light I am referring to is on the front of case and I assumed it indicated HD activity, but you may be right that other activities could cause it.

--Zoltan

JimC
2007-11-01, 19:37
Thanks for the suggestion but I don't see that process.

The light I am referring to is on the front of case and I assumed it indicated HD activity, but you may be right that other activities could cause it.

--Zoltan

What type of drive are you using? If you're using a 2.5" drive (as I suspect you might be doing), you could try:


$ hdparm -B 255 /dev/sda

Substitute your drive info for /dev/sda. The explanation I was given when I learned about this feature was: hdparm is the command that fetches/sets specific attributes on ATA/IDE drives. The -B flag controls advanced power management, and 255 is the value that disables it.

Don't know if this will fix it for you, but it worked on the laptop I have Feisty installed on. If it does work for you, there's a way to add it to /etc/hdparm.conf and create a startup link to load it, but I can't remember it off the top of my head. I'll try to locate my notes and post it if found.


-=> Jim

Kirk Ferguson
2007-11-01, 20:38
On 11/1/07, JimC <JimC.2zeggo1193971202 (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
>
> Zoltan;239552 Wrote:
> > Thanks for the suggestion but I don't see that process.
> >
> > The light I am referring to is on the front of case and I assumed it
> > indicated HD activity, but you may be right that other activities could
> > cause it.
> >
> > --Zoltan


You might start by verifying the level of disk activity and its effect on
your system. At your command prompt, run top and look at the %wa value in
the cpu line. If you watch it for a bit does it vary? What is the range of
values you see?

While you're in top, look at the 3 load average values as well.

You can use iostat to get more detailed information about disk activity as
well. If you don't have it in your standard install, try

apt-get install sysstat

Hope this gives you a start...

Kirk

Zoltan
2007-11-02, 01:35
What type of drive are you using? If you're using a 2.5" drive (as I suspect you might be doing), you could try:


$ hdparm -B 255 /dev/sda


Yes it's a 2.5 drive. I'll try that later. Thanks.

Zoltan
2007-11-02, 01:38
On 11/1/07, JimC
You might start by verifying the level of disk activity and its effect on
your system. At your command prompt, run top ...


You can use iostat to get more detailed information about disk activity ...

Kirk

Thanks. I tried top but I didn't manage to spot anything. I'll try iostat later. Thanks.

mick_w
2007-11-02, 01:41
This is probably due to the EXT3 file system used in linux, you will always get some drive activity even when the server is idle.

This can be minimised by adjusting a couple of files (/etc/fstab & /etc/syslog.conf), I've got instructions on my site:

http://www.ulverston.myzen.co.uk/mini-itx/pages/tuning.htm#Reduce_hard_drive_activity_when_server_ is_idle

Jims tip with hdparm -B is also on there; as he indicated it is usefull if you are using a 2.5" drive (where the heads are constantly being parked by the advanced power management after every disk access)

http://www.ulverston.myzen.co.uk/mini-itx/pages/tuning.htm#Stop Hard Drive Clicking


These instructions were for ClarkConnect but should work fine with Ubuntu

Mick

sdonham
2007-11-02, 02:26
This is probably due to the EXT3 file system used in linux, you will always get some drive activity even when the server is idle.

This can be minimised by adjusting a couple of files (/etc/fstab & /etc/syslog.conf), I've got instructions on my site:

http://www.ulverston.myzen.co.uk/mini-itx/pages/tuning.htm#Reduce_hard_drive_activity_when_server_ is_idle

Jims tip with hdparm -B is also on there; as he indicated it is usefull if you are using a 2.5" drive (where the heads are constantly being parked by the advanced power management after every disk access)

http://www.ulverston.myzen.co.uk/mini-itx/pages/tuning.htm#Stop Hard Drive Clicking


These instructions were for ClarkConnect but should work fine with Ubuntu

Mick

My thoughts exactly, you may also want to raise your "swappiness" to lower the number of read/writes to the disk. I've had huge gains by tweaking this file, reducing disk i/o. Change to something like 60 (not sure what your default is, but that's what I changed mine to) in /proc/sys/vm/swappiness.

Mark Lanctot
2007-11-02, 08:18
This is probably due to the EXT3 file system used in linux, you will always get some drive activity even when the server is idle.

Hmm? I definitely have never had this issue.

Zoltan
2007-11-05, 15:49
On 11/1/07, JimC <JimC.2zeggo1193971202 (AT) no-mx (DOT) forums.slimdevices.com> wrote:[color=blue]

At your command prompt, run top and look at the %wa value in
the cpu line. If you watch it for a bit does it vary? What is the range of
values you see?

While you're in top, look at the 3 load average values as well.


Kirk

I must apologise - when I responded to your 'top' suggestion before I missed the details of what you had suggested. Tonight has been my first chance to look at this again and I do see the %wa figure varying between 0% and 2.3%.

Over the time I actually looked at it, the load average values started at 0.04, 0.01, 0.00 and fell to 0.00, 0.00, 0.00.

I tried iostat and got this sort of pattern from iostat -b 1, i.e. activity every 5 seconds or so which seems to tie in with the HD light blinking:



Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
...
hdb 2.97 0.00 55.45 0 56
hdb 0.00 0.00 0.00 0 0
hdb 0.00 0.00 0.00 0 0
hdb 0.00 0.00 0.00 0 0
hdb 0.00 0.00 0.00 0 0
hdb 3.03 0.00 40.40 0 40
hdb 0.00 0.00 0.00 0 0
hdb 0.00 0.00 0.00 0 0
hdb 0.00 0.00 0.00 0 0
hdb 0.00 0.00 0.00 0 0
hdb 3.00 0.00 40.00 0 40
...

--Zoltan

Zoltan
2007-11-05, 15:53
If you're using a 2.5" drive (as I suspect you might be doing), you could try:


$ hdparm -B 255 /dev/sda

-=> Jim

Just tried it but unfortunately to no avail.

But thanks for the suggestion anyway - it sounded plausible from what others were saying too.

--Zoltan

Zoltan
2007-11-05, 16:24
This is probably due to the EXT3 file system used in linux, you will always get some drive activity even when the server is idle.

This can be minimised by adjusting a couple of files (/etc/fstab & /etc/syslog.conf), I've got instructions on my site
Mick

Thanks.

The fstab tweak has made a big difference. There is still some activity but is much less regular and occurs at 20 - 35 second intervals now rather than the regular 5 second intervals as before. I've done the hdparm command even though it didn't seem to have any effect.

I haven't tried editing syslog.conf yet as I wanted to see what the effect of the fstab tweak was first. BTW I rebooted my system to get that to take effect. For future reference is there a more convenient way to do it?

--Zoltan

bhaagensen
2007-11-05, 16:31
Hi,

I've only read parts of this thread, so apologies if I repeat stuff. By default regular disc activity is to be expected. I think that there are 4 main causes of disc-activity.

1. User actions writing to disc such as saving/reading files.

2. Kernel logging. The kernel writes logs regularly in /var/log/messages

3. If you are using a journaling file-system (ext3, reiserfs, ...) the journal is written regularly.

4. The kernel flushes cached block device data, i.e. disc data corresponding to open files regularly.

To see which processes writes to disc do 'echo 0 > /proc/sys/vm/block_dump' and look at the output of 'dmesg'. Remember to stop syslogd before doing this. This could help you identify if any "unatural" disc activity is happening. Sorry about not being more detailed. I think it is slightly complicated (I don't know the topic well myself) and you need to know the downsides of various countermeasures also. You can find lots of further information on google. Try with keywords such as: laptop mode, spin down, hard drive, dirty pages, syslogd, disable.

Also I think you said that Ubuntu is running in a virtual machine. Do you have lots of RAM, otherwise disc-activity could be caused by increased swapping.

Regards

Bjørn

bhaagensen
2007-11-05, 16:35
BTW I rebooted my system to get that to take effect. For future reference is there a more convenient way to do it?



Ahh, I see indications that I was repeating stuff in my post. Sorry about that. If you made changes to the mount options of a partition, say /dev/hda1 you can just issue a 'sudo -o remount /dev/hda1' instead of rebooting.