Tuesday, January 29, 2013

Macbook 2 NAS project

My girlfriend's old macbook is sitting around the apartment, so I thought it would make a great NAS (well a better NAS than paperweight anyway). It has a 500 GB HDD, 2 GB RAM and a 2.16 Core 2 Duo processor. My initial scheme was as follows:

1 - Get NAS4Free
2 - Make a bootable flash drive, and boot NAS4Free. Test and then use the Live USB to install NAS4Free to a second flash drive.
3 - Erase primary HDD on macbook, connect to router and use as a NAS
4 - (optional) Install an iTunes server on the flash and get that working too

After the break I'll outline the fun times that I went through on my quest for a MacBook NAS.




Step 1 was fairly easy. I downloaded the x86 .img. Using my own macbook pro and OSX Lion I put it on a flash using the instructions here.

Step 2 was surprisingly challenging. It seems Apple does not like the idea of you using their USB ports to boot non-OSX disks. But in my experience, any time Apple makes something hard, the rest of the online community does their very best to correct this injustice. Behold: rEFIt... an EFI Boot manager. Macbooks use something called an EFI instead of a BIOS (wiki probably has a better explanation than I can attempt to give), and rEFIt allows you to boot using a non-OSX USB. I envisioned an eventual boot system that had rEFIt on one flash, allowing me to boot the other flash containing my NAS4Free install.

As a first step, I loaded rEFIt to the macbook and restarted twice. Now the rEFIt screen appeared at startup (a bit like a boot manager) and recognized my USB drive as a Free BSD.

rEFIt startup screen
However attempting to boot from the USB gave me an error message (as far as I can tell, screen shots are not feasible from rEFIt, so I was using the camera on my phone):

My unfortunate error message
The computer hanged and required power switch to reboot. After reading some forums on installing Ubuntu on a MacBook, I had a couple ideas, one of which involved partitioning the flash as a GUID (I think it was FAT32) before. I followed the instructions here. I had also read that not all USB flash drives are supported, so I found another 2 GB flash to try. No dice, same error on both USB ports.

One more suggestion I found when installing Ubuntu from flash media on a MacBook was to sync the partition table with rEFIt (partition manager menu). I did this (completed sucessfully) and attempted again to boot from the flash. Again, no luck. It made another icon appear in the rEFIt screen which pointed to a non-existing OS, and still the Free BSD partitions did not boot. Oh well, I'll read some more about EFI and try again in the future.

Update Feb 6 2013: I also tried the instructions here for using an experimental program (ISO_2_USB). I used the 32 bit version, and I was able to boot to grub 1.99 from the flash, but then got stuck because I couldn't figure out how to load the kernel, and wasn't able to find instructions for loading a freeBSD from grub. I'm sure there is a way, but for now I'll put this project on the backburner, and maybe build a NAS from more traditional parts :).

No comments:

Post a Comment