#!/bin/bash now=$(date '+%s') fdisk -l 2>/dev/null | grep Disk | awk '{print $2}' | sed 's/://' | while read line do dt=$(dumpe2fs -h ${line} 2> /dev/null | grep 'Last checked' | sed 's/Last checked: //') days=$(date -d "${dt}" '+%s') ((dif = (now - days) / (24 * 60 * 60) )) lbl=$(e2label ${line}) echo "${line} ${lbl} ${dt} (${dif})" done