emperor: (Default)
posted by [personal profile] emperor at 04:19pm on 21/05/2009 under , ,
Back in December 2007, I installed linux on my Mac Pro (my work desktop machine), following the instructions on http://wiki.debian.org/DebianOnIntelMacPro (some of which I edited in the light of my experience). 18 months later, I'm spending an increasing proportion of my time at work running linux rather than OSX. Mainly this is because Debian has a sensible 64-bit toolchain, something that Apple still haven't managed to get right. Also, fink is a hacky mess, whereas Debian's amd64 distribution works Just Fine.

There are some flies in the ointment, though. The mactel-linux patches aren't in the mainstream kernel, so there's a certain amount of faff involved in building a kernel; I've not made audio work as yet, but I've not tried very hard (it is a work machine, after all ;-). The biggest down-side, by a country mile, however, is firefox. It's dreadful. Every so often (sometimes more than once a minute), it'll just start chewing 100% of one of my CPUs, even if I've not looked at a web-page for a while. Talking to people on #chiark, it seems I'm far from alone in having these random cpu-chewing incidents. I do wish there were a decent Free graphical web browser.
emperor: (Default)
posted by [personal profile] emperor at 11:35am on 21/12/2007 under , ,
At work, I have a 2x 2.66 GHz Dual-Core Xeon Mac Pro with 12 GB of RAM, that I use for some fairly intensive disease simulation work. I deal with reasonably large data-sets; whilst my own code will happily build 32- or 64-bit on OS X, I use other tools (python, R, gnuplot, etc.) that come as 32-bit by default on OSX (or through fink). Building them 64-bit on OS X has proved painful - even with Leopard, the 64-bit stuff is a bit half-arsed (presumably because Apple don't want to ship two versions, one for 64-bit platforms, one for 32-bit), and there's only so much fighting with build-systems I can do before I want to smash things.

So, I figured I might as well try installing a proper 64-bit OS; it would enable me to have a completely free-software system to use as well. Debian wiki has some instructions, which seemed like a good starting point. The 'net is, however, full of a lot of confused and confusing discussion of the issues. I won't duplicate those instructions here (although I will be editing that page in due course). Suffice it to say that up to the "reboot" point, everything went smoothly. I have a second hard-disk which I wasn't using, so I installed onto that, leaving about half of the disk free for future deployment.

The machine rebooted, rEFIt offered me a linux option, I selected that, and after a pause, was offered "Missing operating system" on a line by itself. That error message isn't found in the rEFIt source, which was confusing - I spent some time thinking it was an error from a bit of the Mac's firmware, so fiddling with different partition schemes, partitioning using Disk Utility, etc. These were all blind alleys. The key observation (which was [livejournal.com profile] pm215's) was that rEFIt contains syslinux_mbr.h, and, indeed, the following code snippet:

    if (!HaveBootCode) {
        // no boot code found in the MBR, add the syslinux MBR code
        SetMem(SectorBuffer, MBR_BOOTCODE_SIZE, 0);
        CopyMem(SectorBuffer, syslinux_mbr, SYSLINUX_MBR_SIZE);
    }

So I went looking at the beginnings of partitions (and indeed, in the MBR of the disks themselves) to see what was there. Sure enough, there was LILO on the second disk drive, but Syslinux's MBR on the first disk drive's MBR (i.e. the disk I boot OSX from)!

rEFIt does seem to rather assume you're only using one disk drive (see the gptsync utility, which only looks at the first disk), so it seems that when asked to boot linux, it observed the lack of MBR on the first disk, stuck a syslinux MBR there, and tried to boot it. syslinux then produced the "Missing operating system" error that had so frustrated me.

The work-around is to install your bootloader of choice into the MBR of the first disk (OS X doesn't use the MBR for booting, so this is safe), and then all is well. rEFIt now starts LILO on the first disk, which will happily boot Linux off /dev/sdb2.

That's all good. There are a few wrinkles remaining, though:
  • Filesystems - linux will read hfsplus filesystems, but can only write to them if the journal is disabled. Leopard doesn't let you un-journal a filesystem from the GUI, although you can do so using the command-line diskutil disableJournal [force] command. You don't want to do this on a volume that isn't carefully backed-up! Similarly, although ext2fsx exists, that only manages read-only access to ext3 unless journalling is disabled. It strikes me that these are things that ought to be fixible, without overly endless pain.

  • X - X.org doesn't fully support the NVIDIA GeForce 7300 GT card in the mac pro - you can't make any use of a second monitor currently. I've no idea if this is likely to get fixed any time soon

  • Hardware autodetect - Linux isn't quite a smooth as OSX for this - I had to work a bit at getting the trackball correctly configured, and I need to spend some time getting my other mouses' buttons working (they've been re-mapped as well as the track-balls). I had to hand-hold the X.org install rather more than I'd like, too. Nothing too taxing, though.


When creating users on linux, I made sure to match the uid and gids from OSX, meaning that users can access (albeit read-only) their Leopard homespace on Debian. I'm generally pretty impressed with the linux install, the fully 64-bit toolchain is a real boon, and it's all DFSG-free! :)
emperor: (Default)
posted by [personal profile] emperor at 09:28pm on 19/12/2007 under ,
I'm still at work, and it's nearly half-past nine. Why? I've been battling for a few days now with trying to install linux on my Mac Pro at work. I finally succeeded in doing this earlier this afternoon, and have since been trying to configure it to my satisfaction. More details about that later (or, more likely, tomorrow, given I've not eaten yet).

There are a few outstanding issues, which I'd be grateful for pointers on:

i) evolution - is it possible to get it to show a combined INBOX view from my two accounts? having to click back and forth between them is somewhat irksome. Also, it doesn't seem to scroll down to show new messages by default.

ia) is there a better email client? I suspect not, as they're all crap IME. It needs to do IMAP+SSL well, really.

ii) X - I have an Apple Cinema display, which X drives just fine. It's not, however, detecting the VGA monitor which is attached (the console just mirrors the two monitors, but obviously that doesn't work in X). How can I go about sorting that?

[more to follow later, I'm sure]

October

SunMonTueWedThuFriSat
      1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
26
 
27
 
28
 
29
 
30
 
31