Artificial intelligent assistant

Prevent USB hard drive enclosure from powering off after inactivity I have successfully used 'hdparm' to disable APM (Advanced Power Management) on external USB hard drives. Now I've come across a USB hard drive enclosure that itself turns the installed hard drive off after 10 minutes of inactivity. Disabling APM on the drive doesn't help because it's the enclosure doing the deed. The enclosure is a Transcend StoreJet 25S3, with USB 3.0 and UASP support, and 10 minute auto power save feature. The SATA-USB bridge controller used is an ASmedia ASM1153E. Is there any setting or command in Linux (Ubuntu/Mint) that can disable this annoying enclosure behavior?

Because the auto-poweroff function is built into the enclosure, the simplest (and perhaps only) way of preventing it from kicking in is by creating a Cron Job that periodically touches a file on the drive.

Start by giving the drive (partition) a label name, if it doesn't already have one. This allows Ubuntu/Mint to automatically mount it to the `/media/` directory.

Then, in Terminal, edit your crontab by entering this command:


crontab -e


And add this line:


*/5 * * * * /bin/touch /media///.stayawake &> /dev/null


The Cron Job will touch a hidden file named `.stayawake` on the drive every 5 minutes, and redirect any resulting output (including errors) to `null` which is what you want considering the drive might not always be connected.

Note: The above Cron Job will only work while the user under which it was created is logged in.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f3b8866d5386bfd9c4bf3d3ffc69224f