Disk Utils

Information on Hard Drive

# smartctl --all /dev/sda

# hdparm -I /dev/sda

# udisksctl info -b /dev/sdb

# fdisk -l

# parted -l

Temperature

psensor is a GTK+ application for monitoring hardware sensors (including temperatures of hard drives) and fan speeds. Or

# smartctl -a /dev/sda | grep Temp

Terabytes Written

# smartctl -A /dev/sda | awk '$0~/LBAs/{ printf "Total Bytes Written: %.1f TB\n", $10 * 512 / 1024^4 }'

How can I monitor the TBW on my Samsung SSD? - Ask Ubuntu

Spindown HDD

Put drive in standby mode:

# hdparm -y /dev/sdb

Any read wakes the drive up. To wake the drive up by bash script "wakeup-drive"

#!/bin/bash
sudo dd if=/dev/$1 bs=1k count=1 of=/dev/null

To wake sdb

$ wakeup-drive sdb

To shut drive down completely (sleep mode):

# hdparm -Y /dev/sdb

Note: after entering the sleep mode, a hard or soft reset is required before the drive can be accessed again.

Controlling power settings for external USB disk drives using sdparm - Debian User Mailing List

To power off the drive:

# udisksctl power-off -b /dev/sdb

Display a Progress Bar during File System Check

To display a progress bar while e2fsck is doing the file system check:

# e2fsck -C 0 /dev/sdb1

Check Filesystem on Next Reboot

# touch /forcefsck
create a file called "forcefsck" and reboot system.