I/O Errors Reported for USB Disk Drives After Inactivity

I just purchased a new USB disk to use for backups on my Linux server.  The old one had died so I got one of the new Seagate terabyte units.  Everything seemed find until the disk had been inactive long enough for the firmware to put the disk into power saving mode and spin it down.  The first attempt to access the disk after that resulted in Linux reporting an I/O error.

I found a simple way to get around this problem.  Before accessing the disk simply issue the following command:

 sdparm –command start <device>

where <device> is the device name for your USB drive.  In my case, /dev/sdc.

Since I only use the disk for backups and all of my backups are run from shell scripts this works very well for me.  Someone who is using a USB disk in a more adhoc fashion will probably have to set the disk’s timeout value such that it never goes inactive and spins down.  You can use the sdparm command for that as well but the setting names and values probably vary from disk to disk so it isn’t really possible to give complete details here.

Leave a Reply