Disk Commands

List directories by size

du -sh * | sort -hr

or ?

du -h --max-depth=1


To show largest directories?:

du -ah ./ | sort -n -r | head -n 10


Another option is gdu. gdu is interactive. Use gdu -h to list startup params. gdu -d to shall mounted partitions.

Also, godu. godu -l 100 ./ will scan the given directory and only consider files larger than 100 MB.

duf gives a great overview of mounted filesystems. duf --sort size will sort by size.


Check SmartDisk Status

smartctl --info /dev/sda

smartctl -A /dev/sda

smartctl --health /dev/sda (this info only useful after tests have been run)

smartctl --test=short /dev/sda

smartctl --test=long /dev/sda

smartctl --log=selftest /dev/sda


Check Disk LifeTime


List disk drives, temperature (in Celsius), health %, power on hours, disk model, disk serial, size:

hdsentinel -solid. Sample results:

/dev/sda 42 3 4830 WDC_WD800JD-8LSA0 WD-WMAM9F937837 76324

/dev/sdb 30 100 6128 ST3250624A 5ND3J94R 238472

/dev/sdc 46 100 10982 WDC_WD2500JS-00MHB0 WD-WCANK8705209 238475

/dev/sdd ? ? ? GENERIC_CF_READER 9999 0

/dev/sde ? ? ? GENERIC_SD_READER 9999 1963

List only temperature, drive, size:

hdsentinel -solid | awk '{print $2, $1, $7}'

42 /dev/sda 76324

30 /dev/sdb 238472

46 /dev/sdc 238475

? /dev/sdd 0

? /dev/sde 1963


List only temperature, drive, model ID, highest temperature on top, drives without temperature information (for example card readers) removed:

hdsentinel -solid | awk '{print $2, $1, $5}' | grep -v "^?" | sort -nr

46 /dev/sdc WDC_WD2500JS-00MHB0

42 /dev/sda WDC_WD800JD-8LSA0

30 /dev/sdb ST3250624A


List only health, temperature, drive, lowest health on top, drives without temperature information (for example card readers) removed:

hdsentinel -solid | awk '{print $3, $2, $1}' | grep -v "^?" | sort -n

3 42 /dev/sda

100 30 /dev/sdb

100 46 /dev/sdc


Note that the spaces in hard disk model ID and serial number are replaced with underscore (_).