Ronnie N
Posts: 3
Joined: Tue Mar 24, 2015 8:18 am

Let fstab mount go to sleep

Tue Mar 24, 2015 11:41 am

Hello,

At start-up my Pi (with Rasbian) mounts a few network shares. Problem is, when these shares are mounted, the network drives will almost never enter sleep modus (stop HDD from spinning) even if there is no writing or reading going on.

My question is, can I add an command to fstab that will allow the drives to go to sleep after a certain amount of time?

thanks in advance,

Ronald

User avatar
DougieLawson
Posts: 40176
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Let fstab mount go to sleep

Tue Mar 24, 2015 11:43 am

What machine hosts the shares?
What sharing system is it? NFS or Samba/CIFS?
What filesystem is on the shares? ext4 or NTFS?

Install hdparm on the system that hosts the drives and try
hdparm -S 241 /dev/sdb

http://linux.die.net/man/8/hdparm
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Ronnie N
Posts: 3
Joined: Tue Mar 24, 2015 8:18 am

Re: Let fstab mount go to sleep

Tue Mar 24, 2015 12:04 pm

Thanks for the reply!

I should indeed have given that information.
The shares are NFS shares hosted on a Debian Weezy based machine. The machine is an WD MyBook live. The web interface that is provided with the machine gives me an option to enable the HDD's to go to sleep. When the Raspberry is off, the drive goes to sleep relatively fast. But when it on (in my case 24/7) it doesn't.

Which makes everything a little more complicated....

User avatar
DougieLawson
Posts: 40176
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Let fstab mount go to sleep

Tue Mar 24, 2015 12:18 pm

What files are open when the Raspberry Pi is idle? Is there something doing a heartbeat function?
Are you able to umount the share without it coming back "device busy"?
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Return to “Advanced users”