LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 12-14-2008, 05:55 AM   #1
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Identifying process responsible for disk writes every 4 seconds


I've set up Slackware 12.1 on a fanless fit-pc (not advertising, just background ) and I've got NFS and SAMBA working on it beautifully. However, at the moment, it's not quite silent as I can hear the hard drive writing something every 4 seconds, confirmed by the output of this sar command:
Code:
root@peter:~# sar -c 1 16
Linux 2.6.24.5-smp (peter)      12/14/2008

10:52:10 AM    proc/s
10:52:11 AM      0.00
10:52:12 AM      0.00
10:52:13 AM      0.00
10:52:14 AM      3.00
10:52:15 AM      0.00
10:52:16 AM      0.00
10:52:17 AM      0.00

10:52:17 AM    proc/s
10:52:18 AM      3.00
10:52:19 AM      0.00
10:52:20 AM      0.00
10:52:21 AM      0.00
10:52:22 AM      3.00
10:52:23 AM      0.00
10:52:24 AM      0.00

10:52:24 AM    proc/s
10:52:25 AM      0.00
10:52:26 AM      3.00
Average:         0.75
There's nothing in /var/log/messages that's that frequent. The only other things running on the server are wicd (for the wireless) and a vncserver. Disabling the VNC server doesn't stop the disk writes.

How can identify what process is accessing the disk that periodically?
 
Old 12-14-2008, 07:34 AM   #2
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
You could use `atop' and order the display by disk activity
 
Old 12-14-2008, 08:24 AM   #3
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
You could use `atop' and order the display by disk activity
Not with Slackware you can't. Slackware doesn't come with atop. It has 'top' but there's no way to order by disk activity. This problem has been asked about before. One thread I've managed to find is here which may be useful. There have been others but I can't find them straight off but remember the overall opinion was that it was tricky to track down.
 
Old 12-14-2008, 09:00 AM   #4
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
Always possible to download and compile it yourself.

See http://www.atcomputing.nl/Tools/atop/download-atop.html
 
Old 12-14-2008, 10:04 AM   #5
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
I've had a look at atop, and there's a SlackBuild for it on SlackBuilds.org, but it requires patching the kernel sources before compiling in order to get disk and network I/O stats. I can use powertop with a custom kernel too to identify processes using the most power. Since this machine is idle during these disk accesses, whatever process is responsible for the disk writes will also be the one using the most power, and will therefore show up on powertop. However, I wanted to avoid compiling my own kernel, if I could

Although, I suppose this provides a good excuse to!
 
Old 12-14-2008, 10:15 AM   #6
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
Lots of caveats there. Be sure you keep your current or previous kernel installed and workable before proceeding.
 
Old 12-15-2008, 05:29 AM   #7
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,919

Rep: Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779
While I haven't got a perfect answer for you, I did once have a similar problem. For me, it was a networking problem (DHCP, if I recall and not getting back from the rest of the network what was expected) but whether that is of any help is doubtful.

I think the easiest attack is probably a bit 'brute force and dumb'. Check all of the log files. Is, for example, dmesg growing? You might be able to script something loking at mtime (or even atime, if that's still on) to look for files that are beinmg accessed frequently, but I found that as I had a super-adequate supply of dumb-ness, that wasn't totally necessary.

If you only have top, you can look for processes that spike up in activity (partic if IO wait spikes up).

I'm sure that once you get a clue as to what is going on, you'll slap your forehead and go 'why did it take me so long to realise that this is what would happen?'

(The good news is that, even leaving this on for several months, 24/7, before actually getting my act together to actually do something about the problem, the disk drive is still fine, thank you.)
 
Old 01-07-2009, 06:33 PM   #8
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
Well, I upgraded to 12.2 and thought that'd fixed it, but it's back again. I was also running a VNC server on this server, so I killed that, and I don't get the spikes in the sar command anymore. But, it's late, and I'm not sure if I can still hear the drive ticking away, but fingers crossed it's gone!
 
Old 01-08-2009, 05:02 AM   #9
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
I once had a similar issue so might be useful to post here:

Mine was because I was running the little KTrafficAnalyzer package which was regularly writing to a 'log' file so that historical network traffic could be viewed. In my case the only way I found to stop this was to make the appropriate data file 'read-only'.

It might be some application similar to this.

I can't remember now how I tracked it down.

Bill.
 
Old 01-08-2009, 05:21 AM   #10
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by Toods View Post
I once had a similar issue so might be useful to post here:

Mine was because I was running the little KTrafficAnalyzer package which was regularly writing to a 'log' file so that historical network traffic could be viewed. In my case the only way I found to stop this was to make the appropriate data file 'read-only'.

It might be some application similar to this.

I can't remember now how I tracked it down.

Bill.
The VNC server was running a full XFCE desktop, which for me includes GKrellM monitoring all my partitions and disks, as well as CPU usage and temperatures etc., so I'm almost certain it's that which was writing to disk. Either way, I've always got sshd running on the server, and I have to ssh in to forward the appropriate ports anyway, so I'll just launch the VNC server explicitly every time I want to use it. I'd rather do this than listen to that infernal hard drive ticking!
 
Old 01-08-2009, 05:22 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,491

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Try blktrace - haven't used it recently, but it will have the data you want.
 
Old 01-08-2009, 06:26 AM   #12
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
I just launched a new VNC server (complete with GKrellM), did the sar command and got the same results as before. After killing GKrellM, the 4 second interval spikes in the sar command disappeared, so it was definitely GKrellM that was writing to somewhere, although I've no idea where. I've replaced GKrellM with the relevant XFCE Goodies packages and the sar command is quiet once more.

I couldn't find blktrace on Slackware nor on SlackBuilds.org, but its man page suggests it's what I would have wanted. Thanks.
 
Old 01-08-2009, 11:16 AM   #13
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,227

Rep: Reputation: 86
Maybe you will find some useful info here :

http://www.linuxquestions.org/questi...-drive-603976/
 
Old 01-08-2009, 01:50 PM   #14
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by Linux.tar.gz View Post
Maybe you will find some useful info here :

http://www.linuxquestions.org/questi...-drive-603976/
What kernel are you running on your Slackware installtion? Is it the generic kernel or the huge kernel? I've just built and installed blktrace, but I get an error:
Code:
root@server:~# blktrace -d /dev/sda -o - | blkparse -i -
BLKTRACESETUP: Inappropriate ioctl for device
Failed to start trace on /dev/hda
This thread on the Ubuntu forums suggests I need to recompile my kernel to include CONFIG_BLK_DEV_IO_TRACE as a config option. Thus, I was wondering if the huge kernel already had this, otherwise I'll have to finally get around to rolling my own kernel, which it's high time I learnt how to do anyway. Or is it libaio that I need to install first?
 
Old 01-09-2009, 09:32 AM   #15
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,227

Rep: Reputation: 86
I use a custom kernel with CONFIG_BLK_DEV_IO_TRACE and so on.
 
  


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
Identifying the process that created a window in X JazzItSelf Slackware 2 08-13-2008 11:39 AM
Identifying process at the other end of named pipe natris Programming 2 07-25-2008 09:05 AM
Software to find process responsible for disk thrashing JoeDuncan Linux - Software 3 08-02-2007 04:15 PM
netstat question - identifying process divukman Linux - Security 4 08-23-2006 10:35 AM
Problem identifying process beegster Linux - Newbie 5 06-28-2004 10:57 PM


All times are GMT -5. The time now is 04:19 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration