How do I configure Ubuntu Server to power down drives when not used? [closed]

I just got home file server, and it contains 7 hard drives. I installed on it Ubuntu Server (Jaunty). What should I do to make it power down drives when they are not in use (most of the time they will not be used).

All of them are sata drives, bundled together with software RAID.


Solution 1:

type man hdparm

Solution 2:

I've answered a similar question elsewhere.

Constant cycling of the power on regular drives actually leads to premature drive failure. The drives are rated for only so many spinups/spindowns, and if you cycle them too frequently, the drive will start to exceed its rated capacity for this. Note that this assumes you're using desktop or server-style 3.5" drives, and not actual laptop drives, which are rated for a much-higher number of spin-downs.

If you plan on spinning up no more than a few times a week, you'll probably be fine. Constant spinup/spindown activity is what will kill them.

You could always go with laptop drives, which are more expensive and a bit slower, but the drives are designed with constant power cycles in mind, and can tolerate this much better than a desktop/server drive which was designed to be left on for extended periods.

Jure1873 is correct, hdparm will provide you with a tool to spin a drive down. You may also want to look at installing the smartmontools package as well, which allows the server to monitor the health of each drive (and notify you of an impending failure). Also look at the noflushd package.

Solution 3:

Maybe I am paranoid, but I don't like the idea of powering down a RAID more than you have to. What type of RAID is it? How often will it need to power on and off?