Is there a way to instruct the (Linux) kernel not to wake up a secondary hdd after a system sleep/wake-up cycle? I'm asking because in my laptop I have an SSD as a primary drive containing the system root and a secondary HDD where I keep a backup system and files I access sporadically. Since the laptop usually goes through many daily sleep/wake-up cycles (I mean Suspend to RAM, not hibernation) for many days, I would like to put the secondary HDD to sleep manually and instruct the kernel to keep it asleep across system sleep/wake-up cycles.

  • 1
    If you want to send your harddisk manually to sleep you can use hdparm -Y /dev/sdb. If you system accesses your disk it will automatically spin up again. You can also define this in /etc/hdparm.conf with /dev/disk/by-label/DATA4 { spindown_time = 180 } I recommend using labels for your disks as you can never rely on which disk is detected first by your system. be aware that you need a newer version of hdparm (mine is 9.43) to send disks with label to sleep. – syss Mar 4 '15 at 12:47

since you only use the secondary hdd for backup, I would suggest telling fstab not to mount the drive automatically and to make a backup script that mounts the drive, makes the backup and unmounts the drive again.

example of the fstab line with the noauto option:

/dev/sdb1 /media/backup ext4 user,noauto 0 0

bash script for the backup would than begin with mount /media/backup and end with umount /media/backup

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.