# How to handle auto power off disk enclosure

## nac

Hi folks.

I have a disk enclosure which has auto power off function if no access for 5min.

Yes, this is "ecological" or "green" production, it's suitable for home use.

Actually, I connect the enclosure including a disk to gentoo linux box(kernel 2.4.19) for home server as NAS(Samba 3.0.32) storage via USB.

It works well within 5min after last disk access.

However, once it is powered off, sometimes I can't access the data on the disk in the enclosure.(sometimes I can access.)

dmesg reports I/O error like this;

 *Quote:*   

> sd 2:0:0:0: Device not ready: <6>: Current: sense key=0x2
> 
> ASC=0x4 ASCQ=0x2
> 
> end_request: I/O error, dev sda, sector 63
> ...

 

(I formatted the disk with EXT3 at first, but it did not work well. Because journal files could be broken.)

So, anyone has some ideas to handle this power saving disk enclosure?

I really appreciate your help.

Thank you.

----------

## honp

I am not sure if this helps you, but hdparm is your friend.

----------

## richard.scott

You could setup a cron job to run this command every couple of min:

```
ls /drive 2>&1 > /dev/null
```

That may help as the enclosure may not be configurable via hdparm if it has a special raid1 setup or something odd?

----------

## nac

homp,

Thanks. I guess, hdparm or sdparm helps me. 

richard.scott,

Thansk. I think the code and cron job make the enclosure on line, but I would like to handle the enclosure with  power managment function effectlively.

----------

