Suspend idle harddisks and monitor the suspension

Goal

Suspend idle hard disks and monitor the suspension state

Intro

To save energy modern disks can spin down when not used. Depending on the disk, savings from 3 to 10 Watts can be achieved. Using the SMART capabilities hdparm can set a spin down timeout on each disk. To check the state of a disk hdparm can also output the state of a disk. As there is no automatic mechanism to be notified if a disk changes its state from idle to suspended state or vice versa another solution is presented in this blog post. The idea is to query the disks for their state periodically and save the value to a database. The problem is, that between to measurements the state can not be tracked. So using smartctl, a tool from the smartmontools is used to get the SMART value “Start Stop Count” from each disk and also save its output to the database. This is important as a spin down timeout that is set too low can result in frequent spin downs and ups, which may shorten the lifetime of a hard drive.
Continue reading

Connect with WinSCP and Putty via Jump-In SSH host

Goal

A SCP Connection needs to be established, but a connection to a host with WinSCP is not possible, because no direct access is available. But a jump in SSH server is reachable from your PC and the jump in SSH server has access to the desired server.

Intro

There is a firewall or another restriction between your local PC and the machine you want to scp to. No direct connection can be established. For example you’re on the road and the file server’s SSH port  in your home or office is not accessible from the internet. But another machine at your site, which can access the file server is running SSH accessible from the internet.
Continue reading