Ok, iostat, what's the mountpoint

Fixing^WDiagnosing^WLooking at a performance problem, we're pretty sure it is a disk issue. iostat is helpful (for showing what's generally going on) but I have to keep remembering that /dev/sdk is mounted as oradata3 (etc). So instead, here's a script that remembers it for me:

iostat -xk 5 | sed -e "$(mount | awk '/ext3/{print $1"/"$3}' | awk -F/ '/dev/{printf "s/%-10s/%-10s/\n",$3,$NF}')"
Look at the mounted filesystems. If they're EXT3, grab the first and third entry (dev and mountpoint) and write out "s/sdk /oradata3 /" (spacing is important to keep the iostat columns aligned). Pass that to sed to transform the iostat output. --Joe

No comments: