Two handy alternatives to the top command: htop and atop

Posted by Tom Moertel Thu, 10 Jun 2010 15:20:00 GMT

I recently started using two handy variants of top, the standard Unix tool for monitoring what’s going on with processes on a system.

The first, htop, uses ncurses to provide a more interactive process-viewing experience. You can surf through running processes, scrolling horizontally and vertically to reveal information that would otherwise have been clipped, information such as full command lines. Further, you can drive a cursor to select processes for commands like kill and lsof to act upon. Yes, you can see what files a process has open; you can even trace processes using strace. There’s also a handy tree view for understanding process ancestry.

The second top alternative, atop, offers more accurate accounting of processes and resource usage. It tracks all processes, even those that have lived out their brief lives between atop’s screen updates. This comprehensive accounting is helpful for understanding problems caused by herds of individually short-lived processes. With the old top, you might catch only a few of the processes in the act, but with atop, you can see the herd for what it is.

Two handy tools – check them out.

Posted in
Tags , , ,
1 comment
no trackbacks
Reddit Delicious

How to fix a broken bootloader configuration after a Fedora Linux upgrade

Posted by Tom Moertel Sun, 05 Jul 2009 16:42:00 GMT

It seems that every time I upgrade Fedora on one of my workstations, anaconda somehow manages to screw up the bootloader configuration, and when the upgrade is “complete” and the system reboots, I’m left starting at a GRUB prompt. So this is a little note to myself for how to fix the broken configuration. (If you find my note helpful, great, but if you try anything in it, you do so at your own risk.)

First, find out where GRUB thinks the /boot partition is:

grub> find /grub/grub.conf
find /grub/grub.conf
 (hd0,0)
 (hd1,0)

Here, GRUB found two potential /boot partitions, which is actually correct because I keep /boot on a RAID-1 md device and GRUB is finding the device’s underlying partitions.

Next, tell GRUB to use the desired /boot partition as its root device:

grub> root (hd0,0)
root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd

Finally, tell GRUB to set itself up on the hard drive that contains the partition (which, for my workstations, is the correct place):

grub> setup (hd0)

That’s it, all done.

At this point, you can tell GRUB to “boot” using the configuration or “reboot” from scratch to test the configuration from a system restart.

Posted in
Tags , , , , , ,
1 comment
no trackbacks
Reddit Delicious