Results 1 to 6 of 6

Thread: Automatically put hard drive to sleep?

  1. #1
    Join Date
    Jul 2006
    Beans
    4,821

    Automatically put hard drive to sleep?

    In my server I have two drives. Drive A is the one I work from and drive B is a backup, which gets rsync'd from A at midnight every night. I'm curious if there's a way to put drive B to sleep, preferably based on however long it's idle. Since it's a backup drive it'd be nice to put it to sleep after say 10 minutes of inactivity, then leave it hibernating all day until midnight when the rsync script calls for it again.

    What would I need to accomplish this task?

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Automatically put hard drive to sleep?

    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Jul 2006
    Beans
    4,821

    Re: Automatically put hard drive to sleep?

    Good find. Thanks for that! Am I under the correct understanding that as long as my BIOS supports AHCI that I can do this to SATA drives? Some of the discussion about SATA vs IDE got me a little confused on exactly what's supported and what isn't.

  4. #4
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Automatically put hard drive to sleep?

    Not sure. As far as I know, AHCI, allows for some nice features, but I do not believe it does anything on the power management side of things.

    I did find some more info on hdparm here:
    http://sobell.com/mgsblog/archives/5

    Sounds handy, but I haven't used it much as I don't have my drives set to spin down when not in use.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #5
    Join Date
    Jul 2006
    Beans
    4,821

    Re: Automatically put hard drive to sleep?

    I hear ya. I don't have mine spinning down either on my other systems, but I also shut all of my computers off when I'm not using them with the exception of my server. If I can save a few bucks a year by inputting some sort of script that turns off my server's backup drive for 23.5 hours a day, I'm certainly game.

    Thanks for the input!

  6. #6
    Join Date
    Jul 2006
    Beans
    4,821

    Re: Automatically put hard drive to sleep?

    So I found out that I can put the HDDs to sleep by UUID with the -Y flag, i.e.:

    hdparm -Y /dev/disk/by-uuid/f289e8ra98d9f8a9sd8f9asd

    Only thing is, I added it to the very end of my rsync script. If I do this, the drive wakes itself back up about 15 seconds later. I'm a little unsure as to why...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •