Results 1 to 3 of 3

Thread: USB Hard drive to sleep on suspend

  1. #1
    Join Date
    Oct 2009
    Beans
    7

    USB Hard drive to sleep on suspend

    I have an external Buffalo usb drive connected to my laptop with Ubuntu 9.04. Usually I don't bother shutting down my laptop so I just suspend it. The problem is that my usb drive won't shut down when I do that. Can I somehow make my usb drive to shut down/sleep/something like that when I suspend my laptop and then automatically wake up when I turn it back on?

  2. #2
    Join Date
    Oct 2009
    Beans
    7

    Re: USB Hard drive to sleep on suspend

    Bump. Anyone?

  3. #3
    Join Date
    Oct 2009
    Beans
    7

    Re: USB Hard drive to sleep on suspend

    Solved this. Just needed to make a script that unmounts the hard drive, tells it to stop spinning and then suspends the usb-port the hard drive is plugged in (because for some reason the usb-drive starts again after about a second) on suspend. And of course the same in reverse order when the laptop resumes from suspend.

    In case someone else needs this, here's the script to spin down the hard drive:
    Code:
    umount -a /dev/your_hard_drive_here
    sg_start --stop /dev/your_hard_drive_here && echo suspend > /sys/bus/usb/devices/the_usb_where_hdd_is_plugged_in_here/power/level
    And here's the script to resume my hard drive when the laptop wakes up again:
    Code:
    echo on > /sys/bus/usb/devices/the_usb_where_hdd_is_plugged_in_here/power/level && sg_start --start /dev/your_hard_drive_here && mount /dev/your_hard_drive_here /mount_point_here
    Last edited by Mjoln; November 29th, 2009 at 12:25 PM.

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
  •