Recently I was trying to find a way to run Ubuntu off an SD card, so that I could use Linux on my Macbook Air (I’d have dual booted, but my Air has the 128GB SSD, which doesn’t leave much space after partitioning). Scouring the web, there’s not that many resources indicating how, or if this is even possible. Fortunately for you, dear reader, it is!
Like I said, I’m using a Macbook Air, so there’s two steps to this process: creating a bootable flash drive with the Ubuntu image, and the actual installation.
Creating a bootable install image
This is pretty standard stuff, if you’re reading this, it’s likely you already know it. Heck, if you have an external DVD drive, you can skip this all together.
- Download the image from Ubuntu
- Hit up your terminal and use the following command to convert that image
hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso
- More terminal goodness:
diskutil listto find which disk is your flash drive
diskutil unmountDisk /dev/diskNwhere N is the disk number you found in step 3.
sudo dd if=/path/to/converted.iso of=/dev/diskN bs=1mto copy that image over to the flash drive.
diskutil eject /dev/diskNto EJECT!
Setup the SD Card
Now we’re ready to install Ubuntu on the SD card (SD card must be at least 8 Gigs). I used a Class 10 card, and performance was…not terrible. I can’t speak for any of the slower cards.
- Download rEFIt from the rEFIt website. You should grab the .dmg version)
- Open up Disk Utility (in /Applications/Utilities) and create a partition of 50 MB formatted “Mac OS Extended Journaled”
- Fill up the rest of the card with a partition of MSDOS-FAT.
- Before writing the Partition Table, hit the options button and select “GUID Partition Table”
- Copy the ‘efi’ directory onto the root of the 50MB partition created in step 2.
- Get back to that trusty terminal
cd /Volumes/partition1/efi/refit(where ‘partition1’ is the name of that same parition) followed by
- Reboot your machine, and press and hold the option key to select a boot device. You should see ones for your main HD, the SD card, and the Live CD image. Select the Live CD image, and let’s get installing.
- During installation, you’ll want to select the advanced partitionint setup. Select the /dev/sdb3 device (Should match the size of the SD card) for formatting and give them the mount point “/”. Device for boot loader installation must be also /dev/sdb3 (not /dev/sdb!). Ubuntu is going to give you a warning about no swap partition. That’s alright, you don’t need it.
- This is going to take a while. Seriously, it’s not gonna be fast. Go get a coffee.
- Reboot when the install is complete, and hold option again to select that SD card. Ta-da!
After you remove the SD card and try to boot normally, you’ll likely hit this error “grub error: no such device”
You can fix this by booting into OS X and selecting your hard drive as the Startup Disk, which can be found in the System Preferences.
Did you find this useful? Feel free to comment below, or follow me on Twitter and let me know if you have any questions, or would like to suggest things for me to talk in the future.