How to switch disks to standby after certain idle-time?

Hi all,

This is my first post in this forum and I’m unsure where to aks my question.

I’ve built a file server which consists of a standard midi-tower housing, a VIA PC2500 board, a Dawicontrol SATA controller, 1 ATA disk and 4 SATA disks. The server runs Opensuse 11.1 and everything works fine. I have installed the OS on the ATA drive. The 4 SATA disks built a RAID-5 raidgroup and are available by the OS as /dev/md0. This is mounted and the shares which are made available through samba are located on that filesystem. The raidgroup runs an ext3 file system.

As the server runs 24/7 it would be nice if I could configure the system in a way that during phases of user’s inactivity, the SATA disks are switched to standby after a configurable timeframe with no access request to the disks.

I’ve already tried to configure disk standby in the systems BIOS but this doesn’t work. I assume that the BIOS only affects disks which are attached to the onboard controllers and not to the additional PCI controller.

How is this possible in the easiest way? I’m looking forward for any hint and idea.

If I have chosen the wrong sub forum please feel free to relocate my entry appropriately.

Best regards

Bernhard

bf68 wrote:
…]
> As the server runs 24/7 it would be nice if I could configure the
> system in a way that during phases of user’s inactivity, the SATA disks
> are switched to standby after a configurable timeframe with no access
> request to the disks.
>
…]
> How is this possible in the easiest way? I’m looking forward for any
> hint and idea.

have a look at hdparm.
See the -S, -y and -Y options.

Hi,

Thanks for the quick reply. I’ve checked the man page for hdparm. It sounds easy and straight forward. Is it possible to have some logging in /etc/messages when the disks are spun up and down?

Best regards

Bernhard

bf68 wrote:
> Hi,
>
> Thanks for the quick reply. I’ve checked the man page for hdparm. It
> sounds easy and straight forward. Is it possible to have some logging in
> /etc/messages when the disks are spun up and down?

Not to my knowledge. The spindown hdparm commands are send to the disks, and they
execute these requests autonomously afaik (but I could be wrong).

Hi all,

Meanwhile I’ve had activated hdparm -S for some time to suspend 4 disks which built a Raid 4 drive (/dev/md0).

The filesystem is mounted and it only holds data which are only accessed through samba.

The issue I faced a couple of times is that the server froze after some hours of work (approx 1-2 days). I wasn’t able then to access the system. Not over the network using ssh, not through samba and not on the console.

Since I’ve deactivated disk suspension with hdparm I had no frozen system any more for a couple of weeks.

Any ideas how I could make still use of hdparm -S or any other proposals for how to put my drives into suspend mode?

I’m looking forward to any response.

Best regards

Bernhard

Not the best idea, but, since you asked…

If your system take some time to freeze - say, two days - when the disks are is standby mode, maybe you could set a cron job to reactivate the disk after, say, every 12 hours, and deactivate a couple minutes (or seconds) after that? Your manual deactivation script could set a flag that the cron job would check prior to setting the disks, to avoid unnecessary activation/deactivation.