2009-07-30

iftop, vmstat, iostat, dstat, iotop, lsof, fuser

Some utilities I find helpful:

iftop -- shows current open connections and their transfer rates
vmstat -- shows virtual memory status (found in procps package)
iostat -- shows current IO transfer rate by devices (found in sysstat package)
dstat -- combines vmstat, iostat and iostat-like info for network IO
iotop -- like top, but the focus is on IO transfer rate
lsof -- get info from currently open files
fuser -- does a subset of lsof: identify processes and users using certain files

2009-07-20

Adding an md device to a LVM VG containing the root filesystem

Debian:

When adding an md device to a LVM VG containing the root filesystem, like so:
vgextend vg_with_root /dev/md99

Don't forget to run the following:

/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf
dpkg-reconfigure mdadm

The first one is to update the mdadm.conf, and the second one is to reconfigure the initrd image the new md device will also be assembled prior to activating the VG. Otherwise, activating the VG will fail because it cannot find a required PV (the new md device).