I am trying to create the following congiguration for my laptop:
- The hard drive is turned off.
- All writes are being cached in memory.
- If a write has been cached for over 2 hours:
- Turn the disk on and sync all the writes.
- OR if data is needed that is not already cached in memory:
- Turn the disk on and read the required data, caching it in memory.
- Sync all the writes.
- Keep the disk on for 20 seconds incase it is needed again, then turn it off.
- REPEAT
In this way, the disk remains turned off for a maximum of 2 hours unless data needs to be read from it.
Could someone tell me what values for the /proc/sys/vm/* and hdparm tunables would achieve this?
Thanks in advance.