Sections of this Guide
- To Shutdown or Not To Shutdown
- Shuting Down and Restarting
- pmacpow - Auto Power On/Off
-
Putting Your Screen and Drives to Sleep
To Shutdown or Not To Shutdown?
That is a question on many people's minds. If you are running a server, you most certainly can't shutdown at night. However if you are using Linux full time for a desktop OS, you can choose.
Shuting down at night can save some electricty, but if you are not careful, it can cause Linux to miss essential events that are set to take place in the early morning hours in cron. The time these occur can be changed, however it is beyond the scope of this guide. Also, shutting down means you will have to login everytime you use your computer, and wait for the window manager (or bash) to load.
I don't shutdown my machine, but I do use some of the Power Saving ideas below. It's you choice.
Shutdown and Restart Linux
This section explains what is involved with shutting down and restarting PowerPC Linux. Note: On PowerMacs, shutdown works right, it actually turns the Power off after it is shutdown (just like the Mac OS).
Shuting Down Using GNOME
Click the GNOME foot, go to log out, click OK. When you are returned to the login screen, use the shutdown menu in gdm to choose either restart or shutdown.
Shuting Down Using KDE
Click the K Menu. Go to log out, click logout. When you are returned to the logout screen, click on the Shutdown button. This will bring up a small dialog that lets you choose shutdown or reboot or restart the X Server. Click OK.
Shutdown from The Console
You need to have root to shutdown Linux from the console for security reasons.
A sample shutdown command:
shutdown -h -t 60 now System is Going to Be Shutdown in 1 minute to so I can move the computer.The first flag tells the computer if you want to shutdown (halt) (-h) or restart (reboot) (-r). The next one tells you how long between the warning and shutting down. If you don't have other users logged in, you can skip this. Next you tell it how long before actually shutting down. now is most common, however you can also use seconds. Finally, everything else is the warning that gets sent to other users logged into your system. Again, Not needed if it's not a server with shell accounts.
A more realistic shutdown command (for a Mac with one user) would be shutdown -h now. Reboot using shutdown -r now.
Need to reboot really fast? Try using the -fn flag. This will skip fsck and proper shutdown for speed reasons (like for a mission critical server to upgrade it's kernel). This is dangerous with ext2fs disks, but in some cases worth the risk. An example would be shutdown -rfn now.
pmac-pow: Turn Your Mac on at Prescribed Times
After installing Linux, do you miss being able to turn on your machine a prescribed times (ala the Energy Saving Panel)? PPC Linux developer Takashi Oe has written a little program that just does this.
You can download it here. After you have downloaded it, untar it using tar -zxvf pmacpow-tool-991021.tar.gz. Next cd pmacpow-tool-991021.
This program is only in the source form, you have to compile it. Type in gcc -o /sbin/pmacpow pmacpow.c to build it. This will create a binary called pmacpow in /sbin. Next change it's permissions so that only the root user can use it (because it needs root access). This command is: chmod 0500 /sbin/pmacpow;chown root /sbin/pmacpow.
You can now configure your pmacpow settings. Typical settings are:
- pmacpow -w 08:00 # Turns the Machine on Weekdays at 8:00 AM
- pmacpow -e 15:00 #Turns the Machine on Weekends at 3:00 PM
- pmacpow 2:00 #Turns the Machine on Everyday at 2:00
-
pmacpow +3h2m32s #Startup 3 hours, 2 minutes, 32 seconds after the previous shutdown
More scripts are found in the tarball with pmacpow.
Saving Power
Linux can also help you save power if you have an IDE drive (all new Macs do) or are running a recent version of an XFree86 server like FB_DEV and not novideo/offb.
Turning Off Your Monitor
You can turn on Monitor Powersaving features using xset. To turn them on type into a xterm: xset +dpms. Use a negative sign to turn them off.
To turn save monitor power right now type into a xterm:
- xset dpms force standby # Low Power, Fast Monitor Turn On
- xset dpms force suspend # Lower Power, Slower Monitor Turn On
- xset dpms force off # Turns Monitor Off, Takes about 45 seconds to turn back on.
Known Issues: Using No Video Driver, offb, etc. will cause X to die when issuing these commands. If your X Server doesn't support them, it will give you a X I/O error.
Suspending Your Hard Drive
The root user can put a IDE drive in standby or sleep mode. Sleep mode may cause unkown interrupt messages on slower machines. Standby mode is faster, and should not. If you plan to leave your machine for an extended period of time use sleep, otherwise don't.
DANGER: hdparm is a very powerful tool. Used wrong it could greatly slow down hard disk performance or possibly even wreck your hard drive. Never let this tool get in the wrong hands. If you follow the below advice you will be safe, and not have to worry.
To use hdparm (the program the controls Hard Disks in Linux) you must be root. hdparm has the following energy saving abilities:
- hdparm -S 2 /dev/hda # Set the delay before spindown of the drive. " Values from 1 to 240 specify multiples of 5 seconds, for timeouts from 5 seconds to 20 minutes. Values from 241 to 251 specify from 1 to 11 units of 30 minutes, for timeouts from 30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21 minutes, 253 sets a vendor-defined timeout, and 255 is interpreted as 21 minutes plus 15 seconds." (from the man page).
- hdparm -y /dev/hda #Go into standby mode now. This will cause the disk to spin down, be quite and save power.
-
hdparm -Y /dev/hda #Shut the drive completely down. If it's a slow drive, Linux may appear to lock up for about 45 seconds, and give you lost interrupt messages, as it starts up the drive.
Send you suggestions off to .


