Spinning down hard drive partially works with hdparm

  • Hi all,

    I'm trying to spin down my western digital hard drive as it always spins and with it being in my tv cupboard it's quite noisy when not in use.

    I've searched the forum and found a thread which tells me to put the following code into the autostart.sh

    #!/bin/sh

    (sleep 60;

    hdparm -S 60 /dev/sda1

    )&

    Now obviously I've changed it to /dev/sdb as that's the drive I want to spin down.

    I reboot the computer and after 5 minutes it spins down as it should do.

    Perfect I thought it was working.

    I've since noticed it only spins down once at first boot.

    Example of behaviour is I reboot my system, 5 mins later it spins down. I then play a video file it takes a few seconds to spin back up (which I can hear it doing as it should).

    After stopping the video playing the drive will now no longer spin down again unless I reboot again and then it will spin down again after 5 mins.

    It also doesn't work after a suspend.

    I have my remote set to suspend the computer when I press the power button, this allows me to press the power button again to wake. But after a cycle of suspend and wake the hdd will no longer spin down.

    Am I doing something wrong here.

    Thanks in advance

  • This is a different drive, the one I'm trying to get to spin down is a western digital green internal 3.5 hard drive.

    That post refers to my western digital my passport external drives which spin down with that utility

    Thanks

  • I understand that but surely I want to spin down a hard drive not a partition.

    The example was from another thread on this forum that is suppose to spin down a drive after 5 minutes.

    I've added that example to the autostart.sh but changed it from sda1 to sdb because my sda drive is a ssd and my sdb drive is a hdd which is the one I want to spin down.

    It does spin down 5 minutes after a reboot so it clearly works but after playing a video it will not spin down after 5 minutes of inactivity it just spins forever (well the 1 hour I left it to see if it would spin down)

    Thanks

  • I have 2 partition on the specific drive in question though so how would I go about that being as though I don't want just 1 partition to spin down as this is not possible.

    It's the whole drive that needs to spin down.

    Thanks

  • Background: It's possible that your /dev/sdb partition will stay mounted after first use, so it's unable to spin-down from that time on.

    Check this theory by using the mount command before and after first partition usage. It shows all mounted partitions.