Small Mosaic


Categories:

/books
/career
/codinghorrors
/events
/geekstuff
/justdont
/languages
/languages/bash
/linkshot
/magazines
/meta
/misctech
/movies
/nottech
/operatingsystems
/operatingsystems/linux
/operatingsystems/linux/debian
/operatingsystems/solaris
/perl
/presentations
/programming
/python
/ruby
/security
/security/apache
/security/tools
/serversmells
/services
/services/dns
/sites
/specifications
/sysadmin
/testing
/tools
/tools/commandline
/tools/firefox
/tools/gui
/tools/network
/tools/online
/tools/online/greasemonkey
/tools/puppet
/unixdaemon

Archives:

July 20101
June 20104
May 20102
April 20101
March 20108
February 20101
January 20102
October 20092
September 200910
August 200910
July 20094
June 20091
April 20093
March 20097
February 20094
January 200917
Full Archives

Wed, 14 Mar 2007

Linux Laptop Mode and /proc block_dump
Over at the top-like command for disk io thread on GLLUG Kostas Georgiou mentioned a Linux /proc file entry I'd never heard of before, and after some digging it looks like it could be useful when debugging certain IO problems. Assuming you have 2.6.6 or above - or a vendor patched kernel.

When you activate the option with a echo 1 > /proc/sys/vm/block_dump as root (read the article and consider turning syslog off first) the kernel starts to log which processes are accessing which disk blocks and inodes. Below is a small chunk of its output on my test VMWare system:

Mar 14 19:16:44 localhost kernel: sshd(2659): dirtied inode 388836 (sshd) on sda1
Mar 14 19:16:44 localhost kernel: sshd(2659): dirtied inode 533395 (libwrap.so.0) on sda1
Mar 14 19:17:23 localhost kernel: cat(2672): dirtied inode 888805 (.bash_history) on sda1
Mar 14 19:17:46 localhost kernel: kjournald(913): WRITE block 14016 on sda1
Mar 14 19:17:48 localhost kernel: pdflush(104): WRITE block 12487672 on sda1

The short version is, 'dirtied' means changed but not written to disk, pdflush will write the rows out later, and READs are what you'd expect. A brute force way to trace an inode to a file path is with find: find / -inum num. The longer explanation can be found at LJs Extending Battery Life with Laptop Mode under the "Spinup Debugging" heading.

It's no DTrace (and no, SystemTap isn't as good as DTrace) but it is neat and a decent addition to the debugging toolbox.

Like this post? - Digg Me! | Add to del.icio.us! | reddit this!

Posted: 2007/03/14 18:18 | /operatingsystems/linux | Permanent link to this entry | This entry and same date


books career codinghorrors events geekstuff justdont magazines meta misctech movies nottech operatingsystems/linux operatingsystems/linux/debian operatingsystems/solaris perl presentations programming python ruby security security/apache security/tools serversmells services/dns sites sysadmin testing tools/commandline tools/firefox tools/gui tools/network tools/online tools/online/greasemonkey tools/puppet unixdaemon

Copyright © 2000-2010 Dean Wilson XML feed logo