Now that you have set up your NAS, here are some tips to save power and switch it on/off remotely.
First, lets change the default wait time for boot that grub takes. From the console, run:
dp@zfs.local:~# bootadm list-menu
The location for the active GRUB menu is: /boot/grub/menu.lst
bootadm: no matching entry found
dp@zfs.local:~# cat /boot/grub/menu.lst
# For zfs root, menu.lst has moved to /rpool/boot/grub/menu.lst.
Interesting. We can use bootadm again to change the timeout or directly edit /rpool/boot/grub/menu.lst. I did the second. Change the timeout parameter (default 30 seconds) to whatever you prefer - I set it to 5 seconds, 0 will boot without querying. First three lines of my file are:
splashimage /boot/grub/splash.xpm.gz
timeout 5
default 0
We can auto shutdown the NAS box for the night and save some power. Use cron to do this.
dp@zfs.local:~# crontab -e
and add the following line to the end of the file.
30 23 * * * shutdown -y -i 5 -g 120 "System coming down for the night"
The 30 23 * * * is minutes, hours, day, week, month : so that statment means at 23:30 hours every day of the week, every week of the month, every month of the year (simply put, every day) shutdown the machine.
You can ofcourse execute the shutdown command from a Putty console on your Windows machine to shutdown the NAS box whenever you want. The crontab entry ensures that the machine is shutdown, if you forget to do it manually.
To wake up the machine automatically, you will need to download one of the many wake on lan freeware from the web. I use this. You can download it here.
Copy this to your windows system directory. C:\Windows\System32 is preferred. We get the mac address of your ZFS NAS box in the next step below.
dp@zfs.local:~# ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
rge0: flags=201000843
inet 192.168.1.10 netmask ffffff00 broadcast 192.168.1.255
ether 0:1e:8c:15:94:a3
lo0: flags=2002000849
inet6 ::1/128
The number after the ether 0:1e:8c:15:94:a3 -> that is my mac address for the ethernet card.
On the windows machine, create a wakeup.bat file in the Windows\System32 directory with the following (Make sure to change the mac address and ip address of the NAS box to what is appropriate for you.
echo off
echo Waking up ZFS server
c:\wol 001e8c1594d3
echo Sent Wake up Packet. Press Control-C to stop ping.
ping -t 192.168.1.10
Create a shortcut to this batch file on your windows Desktop, so you have it handy.
So now you have a NAS that you can fireup when you want and will automatically shutdown.
No comments:
Post a Comment