Ubuntu 12.04 LTS on an Apple Mac Mini (Late 2012)

November 4th, 2012 24 comments

I’m switching my web hosting to a Mac Mini running Ubuntu Linux. These are my notes for getting it set up.

Here’s the hardware specs:

  • Apple Mac Mini 6,2 (Late 2012)
  • Intel Core i7-3615QM 2.3 GHz quad-core processor
  • 16 GB DDR3-1600 memory
  • 128 GB solid state drive
  • 1 TB 5400 RPM hard drive

The Mac Mini is built to run OS X 10.8, but Ubuntu 12.04.1 runs nicely with a couple of tweaks.

  • Installing required the “noapic” flag (F6 when at the boot menu)
  • Set “Boot after power failure” by running the following, and adding it to /etc/rc.local:
    setpci -s 0:1f.0 0xa4.b=0
  • Fan control doesn’t work without applesmc and macfanctld installed from Ubuntu’s Mactel PPA
  • the network card doesn’t work out of the box, you need to download/compile a new version of the tg3 module from Broadcom

For networking, I didn’t want to have to remember to recompile the module after reinstalling each kernel. I setup DKMS to take care of it automatically.

  • Download the Linux “tg3″ driver from Broadcom (version 3.124c (10/18/12) at the time of this writing)
  • Extract it
  • Navigate to Server/Linux/Driver/tg3-3.124c.tar.gz
  • Extract that file to /usr/src/tg3-3.124c/src/
  • Create a file called /usr/src/tg3-3.124c/dkms.conf with the following contents:
PACKAGE_NAME=tg3
PACKAGE_VERSION=3.124c
CLEAN="make -C src/ clean"
MAKE="cd src/ && make BUILD_KERNEL=${kernelver} KVER=${kernelver}"
BUILT_MODULE_NAME[0]="tg3"
BUILT_MODULE_LOCATION[0]="src/"
DEST_MODULE_LOCATION[0]=/updates
AUTOINSTALL=yes
  •  Add the module to DKMS so that it’s automatically built for new kernels:
sudo dkms add -m tg3 -v 3.124c
sudo dkms build -m tg3 -v 3.124c
sudo dkms install -m tg3 -v 3.124c
  • The module is now ready, either load it with “modprobe tg3″ or reboot
  • If you need to remove it at a later time, do:
sudo dkms remove -m tg3 -v 3.124c --all

After these changes the Mac Mini is working great. I didn’t test Wi-Fi, Thunderbolt, or Sound, since I won’t be using them. USB works as far as being able to connect a keyboard and mouse, and Ubuntu’s 12.04.1 LiveCD boots into the full desktop.

Update:

Ubuntu has released 12.04.2 install/live CDs based on kernel version 3.5. I have not tested the above instructions with kernel 3.5, so if you’re following them you probably want to stick with the 12.04.1 install ISOs with kernel 3.2. If you install from 12.04.1, you will automatically stay on 3.2 even when updating to 12.04.2.

 

 

Categories: server

Web Hosting on a Mac Mini

November 4th, 2012 No comments

The new Mac mini is out (Late-2012 model), and I’m going to give Macminicolo a try. I’m moving from the dedicated server I’ve been on for the last two years:

  • quad-core 2.83 GHz (Intel Q9550)
  • 8 GB DDR2-800
  • dual 500 GB 7200RPM SATA drives with a hardware mirror (RAID 1)
  • Ubuntu 10.04 LTS

to the faster Mac mini:

  • quad-core 2.3 GHz (Intel Core i7-3615QM)
  • 16 GB DDR3-1600
  • 128 GB SSD
  • 1 TB SATA
  • Ubuntu 12.04 LTS

I’m moving because it’s less expensive and faster. Due to having to buy the Mini, my break-even point is in 12 months, but after that I’m saving money.

Compared to Amazon EC2, after two years I will have paid roughly the same as a Medium instance (2 CPU, 4GB RAM) with the 1/year reservation discount. The Mac Mini is much faster, but then, Amazon offers a lot more (paid) services and options.

The downside is that there’s no redundancy built into the Mac mini, and I become responsible for hardware failures. There’s a year of warranty built into the Mini, but after that there’s a chance I’ll be buying a new one, and my predicted savings will be pushed back a year. In case of a hardware failure, I’ll temporarily move to Amazon EC2. Being instantly available is worth the extra cost in that case.

 

 

 

Categories: server, websites

Too Many Computers

July 15th, 2012 No comments

I’ve recently been able to retire three general computers (my netbook, HTPC, and work desktop). I’m now down to 4 general use computers, here they are, in order of usage:

  1. MacBook Pro (15″, Late 2008, work supplied)
  2. iPhone 4
  3. iPad (Third Gen)
  4. Desktop (icebox)

On the weekend, the order changes to:

  1. iPad (Third Gen)
  2. iPhone 4
  3. MacBook Pro (15″, Late 2008, work supplied)
  4. Desktop (icebox)

 

 

Categories: desktop, ramblings

failed hard drives

April 26th, 2011 No comments

Keeping track of my drive failures, since April 2011.

Age
(Months)
Purchased Died Model
42 2008-11 2012-05 1.5 TB Seagate Barracuda 7200.11 7200RPM
66 2006-08 2012-02 400 GB Western Digital Caviar SE16 7200RPM
18 2010-04 2011-10 1.5 TB Western Digital Green 64MB Cache 5400RPM
15 2010-04 2011-07 1.5 TB Western Digital Green 64MB Cache 5400RPM
26 2009-02 2011-04 1 TB Hitachi Deskstar 7K1000.B 16MB Cache 7200RPM
Categories: hardware

parted

April 25th, 2011 No comments

Create a single, aligned partition on a drive larger than 2TB.

% sudo parted /dev/sdx
(parted)% mklabel gpt
(parted)% mkpart primary 1 -1
Categories: file systems, howto

New HTPC

January 31st, 2011 No comments

Just replaced my heavily used Ubuntu HTPC with a 6 watt AppleTV 2. Both run XBMC.

Specs of the old, silent HTPC:

  • Intel Core 2 Duo E4300 1.8GHz w/2MB Cache
  • Intel DQ965GF motherboard with passive chipset heatsinks
  • Scythe Ninja passive CPU heatsink
  • 4GB (2x 2GB DIMMS) ADATA DDRII 800 MHz memory
  • 512 MB MSI N210-MD512H GeForce 210 PCIe 2.0 passive video card
  • 40 GB Kingston SSDNOW V-series (Intel rebranded) SATA SSD
  • 18x DL DVD+-RW Optiarc Ad-7170S 2MB Cache SATA optical drive
  • Antec Sonata case
  • Dual 120mm Yate Loon case fans
  • Seasonic 330W power supply
  • Ubuntu 10.04 AMD64 with XBMC

Video is just as smooth on the AppleTV as on the HTPC.

Categories: htpc

15,471,232 Pixels

November 13th, 2010 No comments

Screens I look at on a normal weekday:

  • iPhone 4 (3.5″) (960 x 640)
  • iPad (9.7″) (1024 x 768)
  • Netbook (10.1″) (1024 x 600)
  • Work MacBook (15.4″) (1440 x 900)
  • Work Desktop (27″ + 24″) (2560 x 1440 + 1920 x 1200)
  • Home Desktop (30″) (2560 x 1600)
  • HTPC (42″) (1920 x 1080)
Categories: ramblings

Linux Software RAID10 Benchmarks

January 31st, 2010 1 comment

Tests are done across four 7200RPM SATAII drives on a PCI-X card sitting on a PCI (32-bit, 133MB/sec theoretical max) bus, probably the slowest bus configuration possible, and then again after being moved to a motherboard with dual PCI-X slots. Server is running Ubuntu 9.10 AMD64 Server.

Benchmark is a simple ‘dd’ sequential read and write.

write: dd if=/dev/zero of=/dev/md2 bs=1M
read: dd if=/dev/md2 of=/dev/null bs=1M

mdadm –create /dev/md2 –verbose –level=10 –layout=n2 –raid-devices=4 /dev/sd[ftlm]1

PCI PCI-X
write: 13.2 MB/s 144 MB/s
read: 4.0 MB/s 89.3 MB/s

mdadm –create /dev/md2 –verbose –level=10 –layout=f2 –raid-devices=4 /dev/sd[ftlm]1

PCI PCI-X
write: 48.3 MB/s 131 MB/s
read: 92.7 MB/s 138 MB/s

mdadm –create /dev/md2 –verbose –level=10 –layout=o2 –raid-devices=4 /dev/sd[ftlm]1

PCI PCI-X
write: 47.4 MB/s 135 MB/s
read: 98.7 MB/s 142 MB/s

And more comparisons:

RAID1 (PCI)

write: 38.9 MB/s
read: 64.8 MB/s

Single Disk (PCI)

write: 59.4 MB/s
read: 71.9 MB/s

Categories: file systems, server

Remove Stale LVM Devices

January 23rd, 2010 No comments

Have an LVM device left on your system from a drive that was removed before pvremove was run?

1
$ sudo dmsetup remove /dev/mapper/removed-device
Categories: file systems

My Tivo Twitters

September 22nd, 2009 No comments

I wrote a short script that sends a Tweet whenver my Tivo HD starts recording a show. You can download it below. It runs best on a Linux computer that can constantly poll the Tivo.

Download: tivo_twitter.sh script

Results: http://twitter.com/30west

Categories: devices