# Hard-drive spin down to conserve battery



## kpedersen (Jun 24, 2010)

Hello,

I have done some testing as to why my laptop and mac mini are so warm when running FreeBSD as opposed to Linux (Knoppix) and Windows. I have come to the conclusion that it is the fact that the hard disk drives are always running 100% which seems to heat up the base of the laptop and generates a lot of noise. Plus it cannot be good for these 2.5inch hard disk drives to be running under this temperature and friction.

Is there any way to make the hard drive spin down when not in use and then spin up when needed again? Both Linux and Windows currently seem to do this.

It would be great if this was the case, then my FreeBSD laptop server will be back in action


----------



## mav@ (Jun 24, 2010)

While HDD consumption important, it may be quite difficult to make it idle enough to allow spin down. Instead make sure you have optimized power consumption of other parts: http://wiki.freebsd.org/TuningPowerConsumption


----------



## fronclynne (Jun 24, 2010)

Check out ataidle(8).  Also camcontrol(8) has [red]idle[/red], [red]standby[/red], & [red]sleep[/red] commands.

But do try to keep an eye on [red]193 Load_Cycle_Count[/red], if you use ATA & you can poke around with sysutils/smartmontools.  The 8 second sleep timer that is enabled by default on a lot of laptop hard drives can age your drive pretty quickly.


Addendum:  you might look at pushing filesystems that are (a)unimportant and (b) written to and read from a lot onto tmpfs(5) or mdmfs(8).


----------



## kpedersen (Jun 24, 2010)

Hi, Thanks both of you for the info, getting my laptop (and server) to use power efficiently when idle is very important to me.

When I ran Mac OS X on my old intel mac mini, I found it to stay very cool. Now that I have freeBSD installed, it runs pretty hot with the fans and hard drive going full blast. Does this mean that Mac OS X has better power management than FreeBSD? Hopefully it is a configuration problem.

I will try out your suggestions


----------



## fronclynne (Jun 24, 2010)

kpedersen said:
			
		

> Does this mean that Mac OS X has better power management than FreeBSD? Hopefully it is a configuration problem.



AFIK, there are two sides to this:  the OS and the BIOS.  The OS makers and the BIOS makers work together to create the most non-standard implementation that they can get by a standards committee.  Apple isn't a bad as MS about doing this sort of nonsense, but they still do it.  So in many cases OSX & Windows will definitely run "better" WRT power & temp & wireless & such.


----------



## aragon (Jun 25, 2010)

There's also the GPU to worry about.  If your Mac Mini has an nVidia GPU it might help to run X with nvidia's drivers so that PowerMizer gets enabled on the GPU.


----------



## aragon (Jun 25, 2010)

kpedersen said:
			
		

> Does this mean that Mac OS X has better power management than FreeBSD?


Yes, out the box it does.  No power management is enabled by default on FreeBSD, so follow Mav's guide and you'll notice a huge improvement.  After tuning it might even be better than Windows or OSX...


----------



## kpedersen (Jun 25, 2010)

Right, I followed mav's guide but I generally had configured everything already.

I believe 
	
	



```
powerd -a adaptive -b adaptive -n adaptive
```
 did help the Mac Mini however.

I am trying to work out what component is getting hot in the T23, I don't think it is the CPU and after taking out the hard drive, there is an area just between the processor and HD that gets very warm, perhaps it is GFX card? It isn't an nvidia though, it is an s3 savage.
Plus linux ran it at a lower temperature and didn't use the manufacturers binary blob driver (Mainly because S3 doesn't have one ).

Shame I cannot just take everything out of the laptop and just run the natd with the grounding wire


----------



## aragon (Jun 26, 2010)

kpedersen said:
			
		

> Shame I cannot just take everything out of the laptop and just run the natd with the grounding wire


Chuck it on ebay and get yourself a Soekris.


----------



## kpedersen (Jun 28, 2010)

The spindown barely makes any difference to the power,

Would you recommend keeping the hard drive spinning, or would spinning down / up every so often be better for the drive?

A Soekris does look quit interesting, but I am not much of a hardware person. I just want the stuff to not break anytime soon 

EDIT:

After closer examination, I found a large problem.

As soon as the drive spins down, I get...


```
request while spun down, starting.
```

Which means it is being woken up... But I have no idea what by. I only have the natd daemon running.


----------



## aragon (Jun 28, 2010)

Yup, that's the tricky thing with hard drive spin down... keeping it spun down.

Suggestions:

1. Change /tmp and /var to tmpfs(5).
2. Remove disk intensive crontabs.  atrun, save-entropy, etc. - experiment with what you don't need.


----------

