0

I just installed Ubuntu 16.04 LTS Server. And I want to disable hard drive when it is not used for a long time using SMART capabilities.

So, is it possible to prevent any Ubuntu writes on a hard drive in idle? And from what things should I start?

GLaz
  • 313
  • 1
  • 2
  • 9
  • Check out `man hdparm` – Stormvirux Dec 02 '16 at 11:44
  • It is not a problem to set hdparm to disable hard drives. The problem is the system always writes something there, so timout never reached. My question is how to **prevent any disk writes**, but not to set up hdparm. – GLaz Dec 02 '16 at 13:19
  • What is writing to disk? Have a look at [this question](http://unix.stackexchange.com/questions/30286/can-i-configure-my-linux-system-for-more-aggressive-file-system-caching) in terms of more aggressive disk caching. Can the program writing to disk use a RAM disk? – Nick Sillito Dec 02 '16 at 18:55
  • This is also a [useful answer](http://unix.stackexchange.com/questions/275678/defer-all-disk-writes-keep-them-in-memory/275846) – Nick Sillito Dec 03 '16 at 09:28

1 Answers1

0

You can set a disk to spin down when it is not accessed for a certain period of time

You need to edit /etc/hdparm.conf

try an entry along the lines of

/dev/disk/by-id/disk_id { spindown_time = 36 }

The spindown time is in blocks of 5 seconds, so 36 means spindown after 3 minutes on inactivity. disk_id is the id of the disk you want to spin down (ls -l /dev/disk/by-id to find the right one)

Nick Sillito
  • 1,576
  • 8
  • 13