3

I have 7 hard drives that are in a virtual pool (mhddfs) so they appear as one directory. I put them to sleep after 5 minutes of inactivity to save a significant chunk of power.

The problem with this is that it takes quite a while to spin 7 drives one by one down, not to mention the wear and power usage that occurs. I would like to cache the file and directory list so that only when a file is actually requested for access, does the drive spin up.

Is this possible?

0

I am not aware of a possibility to lock the file system meta data in the cache but (if there are not too many files) you can read the meta data regularly in order to keep it in the cache:

find /path/to/dir -printf ""
  • I think that would somewhat defeat the purpose as it would wake the drives or prevent them sleeping. Also there are a lot of files as you would expect from 31TB :) – DominicM Nov 26 '14 at 17:48
  • @DominicM That would wake the drives only if the meta data does not fit into the cache. Otherwise the data would be read from the cache and be marked as recently-read so that it is not thrown out of the cache. – Hauke Laging Nov 26 '14 at 17:51
  • Maybe I should try it out, how would I run this exactly? Also would it cache to ram or swap? I have only 4gb ram now and 60gb ssd now, much space would it require approx? There must be at least 70k files. – DominicM Nov 26 '14 at 18:12
  • @DominicM To tell the truth: I have no idea how much space it requires. top and free show you the amount of RAM used for the cache. You could reboot the system (at best with minimal activity i.e. runlevel 1 or 2), note the amount of cache RAM, run the find command line and check the values of cache RAM and unused RAM afterwards. If the unused RAM has dropped to zero then the caching would require more than available. If it turns out to be acceptable with respect to the RAM requirement then you may run find from cron every few minutes. – Hauke Laging Nov 26 '14 at 18:28
  • How does running a cron that attempts to find files not wake the disks? – DominicM Nov 26 '14 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.