Score:0

How to automatically power down internal HDD which is mounted and shared with samba?

bz flag

I have recently bought an Intel NUC 12 pro to use as home-server, so now I am exploring the world of Linux a bit (so far I have only used Linux via WSL or for Docker).

I have managed to partition the additional internal 2.5" SATA Drive, set up a ext4 filesystem and automatically mount it to /mnt/mydrivename Additionally I set it up as samba share, so it is available on the Windows PCs at my home. All of this works fine so far, however I have noticed, that the drive does not seem to power down even when nobody is accessing the files and the home-server user is logged off.

On my Windows PC all internal Storage HDD will power down when not used for a while. So far I have read that hdparm is commonly used for this kind of setup. Is this the way to go, or do I need to unmount/stop sharing before the HDD can shut down?

Pilot6 avatar
cn flag
Are you using Ubuntu?
Roland Deschain avatar
bz flag
@Pilot6 yes, Ubuntu Desktop 22.04 LTS
Score:1
cn flag

You can use Disks application to setup automatic power down.

Select your disk and click a buuton at the top right.

hdparm is the backend of this application.

You don't need to do anything else. Your disk will be powered up when it is accessed.

Roland Deschain avatar
bz flag
Thanks, so far I have tried to stick to the terminal (mostly access via SSH from my Windows PC) :) I'll test this and mark the answer if it works!
Roland Deschain avatar
bz flag
Ok, so the problem seems to be, that while the disk is mounted it immediately restarts after putting it to stand-by. I tested this: 1) With disk mounted -> Disk Application -> Standby now => Disk will power down and immediately restart. 2) With disk NOT mounted -> Disk Application -> Standby now => Disk will power down and stay in standby. Is this behavior expected?
Pilot6 avatar
cn flag
You don't do standby now. You set up idle timeout in drive settings.
Roland Deschain avatar
bz flag
Not sure I understand. There are two tabs, Standby and APM. I have set Standby to 10Min and APM to 127. Is this the wrong config? I thought "Standby now" is for immediately spinning down the device .
Pilot6 avatar
cn flag
AAM is unrelated. You need the standby setting. You can set it to minimum and test how it works.
Roland Deschain avatar
bz flag
Set standby to 10s and disabled APM again. Drive still never is in standby. Only if I unmount it it goes into standby after the 10s.
Pilot6 avatar
cn flag
It is confusing. There is no 10s setting and there is no APM. There is 10m and AAM.
Roland Deschain avatar
bz flag
I have added some screenshots to my question to hopefully clear things up a bit.
Pilot6 avatar
cn flag
Try to use APM. But is is not a very good idea.
Roland Deschain avatar
bz flag
In that case I'll rather leave it running... Thank you for the help!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.