New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Finding out what's using disk

Got problems with your B2 or B3? Share and get helped!
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Finding out what's using disk

Post by DanielM »

Hi all.
Last few days it sounds like the disk in my B3 is used much more than usual. Not that it's a big problem, but it kinda worries me. So I'm trying to find out what's using it. Googled for solutions and found some nice tools. None of them seem to work though, seems like there's kernel stuff missing.

Atop says:

Code: Select all

No disk-activity figures available; request ignored!
Iotop says:

Code: Select all

Could not run iotop as some of the requirements are not met:
- Linux >= 2.6.20 with
  - I/O accounting support (CONFIG_TASKSTATS, CONFIG_TASK_DELAY_ACCT, CONFIG_TASK_IO_ACCOUNTING)
So, question is, is there any other good way of finding out what's happening (without checking every single file with lsof)? Any chance of getting support for this in future kernel versions?

/Daniel
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: Finding out what's using disk

Post by johannes »

Iotop support will be included in the kernel releasing with 2.4 soon.
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: Finding out what's using disk

Post by DanielM »

johannes wrote:Iotop support will be included in the kernel releasing with 2.4 soon.
Thanks Excito!

(however I still don't know what's using my disk now. Guess there's nothing I can do about that for the moment?)

/Daniel
Puma
Posts: 230
Joined: 29 Sep 2008, 06:30

Re: Finding out what's using disk

Post by Puma »

Thanks Excito Team, I was looking for the same.

Puma
Linux is like a wigwam - no windows, no gates, apache inside!
su_root
Posts: 38
Joined: 29 Nov 2011, 06:27

Re: Finding out what's using disk

Post by su_root »

DanielM wrote:
johannes wrote:Iotop support will be included in the kernel releasing with 2.4 soon.
Thanks Excito!

(however I still don't know what's using my disk now. Guess there's nothing I can do about that for the moment?)

/Daniel
try from the B3 terminal:

Code: Select all

ps aux
Look for processes that is "suspicious". Also, what does top say, are you running high on CPU/RAM etc.?

EDIT: you could also try to disable swap if you're not tight on RAM

Code: Select all

sudo swapoff -a
Last edited by su_root on 30 Nov 2011, 07:08, edited 1 time in total.
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: Finding out what's using disk

Post by DanielM »

su_root wrote:Look for processes that is "suspicious". Also, what does top say, are you running high on CPU/RAM etc.?
Already checked all that. Nothing obviously strange. Just the sound of the hd...

/Daniel
su_root
Posts: 38
Joined: 29 Nov 2011, 06:27

Re: Finding out what's using disk

Post by su_root »

What are your logs saying, try to tail -f on them if they could provide more info.
su_root
Posts: 38
Joined: 29 Nov 2011, 06:27

Re: Finding out what's using disk

Post by su_root »

Is there collectl in the repos? If there is, try to install and run it.

edit: or try atop/htop or nmon
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: Finding out what's using disk

Post by DanielM »

su_root wrote:Is there collectl in the repos? If there is, try to install and run it.

edit: or try atop/htop or nmon
Collectl doesn't seem to live in the repos. Atop is already tried (see first post in thread). Tried nmon, can't really find any way of seeing what's using the disk there.

/Daniel
su_root
Posts: 38
Joined: 29 Nov 2011, 06:27

Re: Finding out what's using disk

Post by su_root »

Ok, sorry, missed that!

Btw, how do you know that the HDD is in use (read/write)? Have you tried to stop all services (not 100% needed by the OS) and start one by one?
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: Finding out what's using disk

Post by DanielM »

su_root wrote:Ok, sorry, missed that!

Btw, how do you know that the HDD is in use (read/write)? Have you tried to stop all services (not 100% needed by the OS) and start one by one?
I know that because I can hear it seeking. It normally only sounds like this when I'm watching movies or downloading stuff, now it's all the time. I've also been thinking about stopping services, guess that'll be what I'll end up doing...

/Daniel
su_root
Posts: 38
Joined: 29 Nov 2011, 06:27

Re: Finding out what's using disk

Post by su_root »

I know that because I can hear it seeking. It normally only sounds like this when I'm watching movies or downloading stuff, now it's all the time.
How frequently can you hear it seeking, all the time or every X minutes? I've noticed that sometimes before a HDD crashes, it can make sounds like it is seeking.

Backup your important data and try to do a performance test on the disk to see if it is working slower than it should.

Do you have smartmontools installed? If so, try disable it.
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: Finding out what's using disk

Post by johannes »

I am no expert here but we did a quite deep investigation when discussing a potential spin-down feature. Back then, we found that Linux needs to touch the disk very often, something like every 10 seconds, for various tasks. I don't remember in detail (the guy who knows has sadly left Excito), but there are so many various systems so it was quite difficult to change that behaviour. inotify, logging, swap, flushing etc etc. Googling for "linux hard disk spin down" gives some interesting reading about the issues involved, perhaps this clarifies?
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
su_root
Posts: 38
Joined: 29 Nov 2011, 06:27

Re: Finding out what's using disk

Post by su_root »

Yes, it is quite a pain. But hard problems take time to get solved and impossible takes a little longer.

It would be nice to see with what kernel parameters B3 is booted and also what filesystem/s are being used. ext4 accesses HDD more often than ext2, syslogs should not be a problem but the /tmp could possible be harder to get around. There are lot's of things that can be done but due to 512mb ram there are limits what is wise to do (disable swap is tempting or use minimal swap to USB memory stick perhaps better).

I have to start testing more tomorrow but on my work laptop (running Fedora), I have disabled swap, enabled laptop mode and I have the feeling that it doesn't touch the HDD that often when laptop is in idle.

I don't know yet howto check how often a disk has spun up the last 24h, I'll get back to this later.

edit: I guess I can check with this
sudo smartctl -a /dev/sda | grep Load_Cycle_Count
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: Finding out what's using disk

Post by johannes »

su_root wrote:But hard problems take time to get solved and impossible takes a little longer.
That's the spirit!
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
Post Reply