Yesterday I played around a bit with what hardware sensors can do and how to access them in linux.
hddtemp
The first, and quite trivial tool I tried was
hddtemp. You don't need to do anything further, just install it and run
hddtemp /dev/hda
(Assuming your harddisk is hda, which is usually the case)
It supports a bunch of harddisks by default and if it doesn't know your HD, it tries to access it with some default-values. Extending the hd-database seems to be trivial, I already sent a patch for my HD. Output looks like this:
/dev/hda: SAMSUNG MP0804H: 46°C
lm_sensors
lm_sensors is a bunch of drivers and tools to use hardware-sensors on motherboards. As you probably have no idea what chips your motherboard has, lm_sensors brings a tool called sensors-detect to help you. The way to go is just enabling everything (except debugging, which you usually don't need) in the kernel-sections i2c and hardware monitoring as module and let sensors-detect to the work.
Basically, pressing return all the time should be okay. At the end, it'll tell you which kernel-modules are useful for your system.
After that, running sensors shows something like this:
max6657-i2c-0-4c
Adapter: SMBus I801 adapter at 1100
M/B Temp: +40°C (low = -65°C, high = +127°C)
CPU Temp: +36.6°C (low = +35.1°C, high = +72.2°C)
M/B Crit: +110°C (hyst = +100°C)
CPU Crit: +110°C (hyst = +100°C)
Well, not that useful, but interesting to know that I have at least 3 temperature-sensors in my laptop.
Update: As noted by Joshua Jackson in the comments, with
smartctl /dev/hda (from
smartmontools) you get the temperature and much more information about your HD.