posted by
damerell at 08:01am on 09/10/2012
So; the lovely
krakatau has a Mac laptop running MacOS 10.4... with a DVD drive that doesn't work. She also has a DVD that purports to be Snow Leopard.
First things first, her Russian housemate has lent her an external DVD drive that also doesn't seem to work. I eyeball this object dubiously; it's a flat metal square object, slightly bigger than a DVD, with a slot in the front and a USB connection out the back, and plugging it in produces nothing more than a log message saying it's the "wrong product family", or some such.
A bit of Googling tells me this came with a Macbook Air (which Russian housemate confirms), and doesn't work with anything else. Curse you, Apple. But apparently it's not totally gratuitous; it draws too much power for a USB device... although frankly you'd think they could put a second USB plug on it, or a wall wart, or something. No, I still haven't forgiven them for crippling their MP3 players.
If I had an external USB / Firewire DVD drive, this would be easy. Do I? No. A little more Googling turns up two suggestions; one that you can NetBoot Macs from real computers, and one that you can install off a USB drive or similar.
The NetBooting angle is pretty futile. Of course, Apple can't possibly do a network install using the same protocols as everyone else. Nooo. They have their own special hack on DHCP; and it can be made to work, but the last Web page on it is from about 2008. I decide to put that one to the bottom of the stack as Plan Z.
Around now, I'm at my house; stick the DVD in, and "mount /cdrom". What I get is a 790MB ISO 9660 filesystem with Boot Camp on it. Hmmm. A vague thought tickles my head that Apple install discs tend to have multiple filesystems smooshed onto them willy-nilly. If someone wants to tell me this is actually a perfectly standard way of smooshing filesystems onto a DVD, I sit corrected.
This chap is trying to do something a bit different, but he does tell us how to find the start of the HFS+ partition on the DVD. I boot rei into Linux (because she's got the disc space), use "readom" to make an image of the entire DVD, and kick off his hexdump invocation.
We find one! A little arithmetic later, "losetup -o 827510784 /dev/loop0 macos.img", "mount -t hfsplus /dev/loop0 /mnt/backup", and yes, we have got a MacOS install DVD image. Hooray! So we NFS export it to the Mac, and...
... oh. We can't NFS export a loopback mounted filesystem. Well, we probably can, but I don't know how. Aha! hdiutil is the Mac equivalent of loopback mounts, at least for this kind of job. NFS export the directory with the DVD image on to the Mac and run "hdiutil attach -imagekey diskimage-class=CRawDiskImage macos.img" - and it thinks a bit, and up pops a Finder window saying "Install Mac OS X", or words to that effect!
Well, now I feel like a genius, but it also has instructions... not saying much more than "select Install Mac OS X and off it goes". So we do that, and... "Click Restart to begin installation". There's a reason this has happened, but still... generally I like to hope I'll get more than one instruction in before things go off the rails.
We try that on the off-chance; no good. (What it actually does, I discover later, is try and furtle the PRAM so the machine will boot from the install media next time. When the "install media" is a loopback-mounted disc image inside a DVD image mounted via NFS, this fails dismally).
Now there's a brief diversion, because surely some Macs don't have DVD drives? Why else does housemate have this funky external one? Indeed, MacBook Airs don't, and there's a thing called "CD and DVD sharing"... with a client for the Mac OS and Windows, because God forbid Apple use any kind of normal file sharing protocol. Still, needs must, bounce rei into Windows, install it, turn it on. I suspect it is hideously insecure but she has usagi between her and the cruel outside world.
The DVD should show up under "Devices" in the Finder sidebar. Of course, it doesn't. Hurdle one, we discover, is that there are two NetInfo configuration options that, if not turned on, disable this facility - they're on by default on DVDless machines, but off by default otherwise, because God forbid Apple let you use this facility if you have a perfectly good broken optical drive of your own. Turn them on. No change. Google, google, oh... it works in 10.5 and upwards. Beat head on keyboard.
Hey-ho. I suppose I will actually have to attach a hard disc via USB with the installer files on that. Fortunately, I have three external hard discs; unfortunately, they're my backup discs. Still, I can use the one I'm about to write a backup onto; worst case, I'll just have to rsync 250 GB to it rather than just the changes. But I figure, let's see if I can luck out, I'll dd the first 8 GB of the filesystem off it, make an HFS+ filesystem smaller than that, and dd it back again when I'm done. (I don't yet know if that worked.)
cfdisk. No, not cfdisk. Needs a GPT partition table. Well, I guess I can rewrite the old msdos partition table when I'm done, then dd back the 8 GB. parted can make a GPT partition table. It can make a 7.5 GB partition. Can it make an HFS+ filesystem? No. Well, I was planning to plug the disc into the Mac anyway. Plug it into the Mac, make a filesystem (which inexplicably also adds a small partition with an MSDOS filesystem for EFI, apparently this is used only for firmware upgrades, why is it on my disc?), rsync across all the installer files, and bang! Away we go.
Away we don't go; it boots so far, and stops dead. Find out how to get a Mac to actually show you the boot messages, sigh. (At least unlike Silicon Graphics, at the point the machine won't boot completely, there is a way to see them.) Bit of puzzling over the last message printed, which is to do with the Ethernet, but actually it's that launchd (a sort of grand unified init replacement) doesn't like the ownership on some of the files, refusing when running as root to trust files other people can write, and it's not that it choked but that the very last thing in the rc file is "sleep 99999999" with a comment saying that the installer or something will always shut the system down. Hm.
On the CD they're all unknown:unknown, but apparently that works anyway (I assume there's some shim somewhere), but booting off USB you have to get the ownership right. Fix up those files... in fact, chown -R the whole disc 0:0, which apparently worked for someone somewhere. Ha, it boots! It boots to the install system telling me the installer failed, and there are some log messages I can view. To be precise, there is one, telling me the installation couldn't be done. Joy!
After a quick refresher on the whole head/keyboard experience, I read a bit more about how real Mac users (you demented Kool-Aid drinkers) set up booting from USB storage. Apparently you have to use Disc Utility to restore the USB drive from the install DVD, which is especially helpful if you still have a buggered DVD drive.
However, it turns out you can find the volume hdiutil mounted in the Finder, and restore from that, which looks like it just copies the same files as my rsync does, but clearly does some other magic because... presto! install system, and install system not complaining about how it can't run the installer, but instead install system happily running.
With any luck Earth Sciences will ask me an open-ended question about the Mac OS at interview. Also, I've probably missed a few things out; it's been a long night; and I certainly missed out some obvious false starts, like changing the startup disc to the not-booting USB one and having to clear the PRAM.
First things first, her Russian housemate has lent her an external DVD drive that also doesn't seem to work. I eyeball this object dubiously; it's a flat metal square object, slightly bigger than a DVD, with a slot in the front and a USB connection out the back, and plugging it in produces nothing more than a log message saying it's the "wrong product family", or some such.
A bit of Googling tells me this came with a Macbook Air (which Russian housemate confirms), and doesn't work with anything else. Curse you, Apple. But apparently it's not totally gratuitous; it draws too much power for a USB device... although frankly you'd think they could put a second USB plug on it, or a wall wart, or something. No, I still haven't forgiven them for crippling their MP3 players.
If I had an external USB / Firewire DVD drive, this would be easy. Do I? No. A little more Googling turns up two suggestions; one that you can NetBoot Macs from real computers, and one that you can install off a USB drive or similar.
The NetBooting angle is pretty futile. Of course, Apple can't possibly do a network install using the same protocols as everyone else. Nooo. They have their own special hack on DHCP; and it can be made to work, but the last Web page on it is from about 2008. I decide to put that one to the bottom of the stack as Plan Z.
Around now, I'm at my house; stick the DVD in, and "mount /cdrom". What I get is a 790MB ISO 9660 filesystem with Boot Camp on it. Hmmm. A vague thought tickles my head that Apple install discs tend to have multiple filesystems smooshed onto them willy-nilly. If someone wants to tell me this is actually a perfectly standard way of smooshing filesystems onto a DVD, I sit corrected.
This chap is trying to do something a bit different, but he does tell us how to find the start of the HFS+ partition on the DVD. I boot rei into Linux (because she's got the disc space), use "readom" to make an image of the entire DVD, and kick off his hexdump invocation.
We find one! A little arithmetic later, "losetup -o 827510784 /dev/loop0 macos.img", "mount -t hfsplus /dev/loop0 /mnt/backup", and yes, we have got a MacOS install DVD image. Hooray! So we NFS export it to the Mac, and...
... oh. We can't NFS export a loopback mounted filesystem. Well, we probably can, but I don't know how. Aha! hdiutil is the Mac equivalent of loopback mounts, at least for this kind of job. NFS export the directory with the DVD image on to the Mac and run "hdiutil attach -imagekey diskimage-class=CRawDiskImage macos.img" - and it thinks a bit, and up pops a Finder window saying "Install Mac OS X", or words to that effect!
Well, now I feel like a genius, but it also has instructions... not saying much more than "select Install Mac OS X and off it goes". So we do that, and... "Click Restart to begin installation". There's a reason this has happened, but still... generally I like to hope I'll get more than one instruction in before things go off the rails.
We try that on the off-chance; no good. (What it actually does, I discover later, is try and furtle the PRAM so the machine will boot from the install media next time. When the "install media" is a loopback-mounted disc image inside a DVD image mounted via NFS, this fails dismally).
Now there's a brief diversion, because surely some Macs don't have DVD drives? Why else does housemate have this funky external one? Indeed, MacBook Airs don't, and there's a thing called "CD and DVD sharing"... with a client for the Mac OS and Windows, because God forbid Apple use any kind of normal file sharing protocol. Still, needs must, bounce rei into Windows, install it, turn it on. I suspect it is hideously insecure but she has usagi between her and the cruel outside world.
The DVD should show up under "Devices" in the Finder sidebar. Of course, it doesn't. Hurdle one, we discover, is that there are two NetInfo configuration options that, if not turned on, disable this facility - they're on by default on DVDless machines, but off by default otherwise, because God forbid Apple let you use this facility if you have a perfectly good broken optical drive of your own. Turn them on. No change. Google, google, oh... it works in 10.5 and upwards. Beat head on keyboard.
Hey-ho. I suppose I will actually have to attach a hard disc via USB with the installer files on that. Fortunately, I have three external hard discs; unfortunately, they're my backup discs. Still, I can use the one I'm about to write a backup onto; worst case, I'll just have to rsync 250 GB to it rather than just the changes. But I figure, let's see if I can luck out, I'll dd the first 8 GB of the filesystem off it, make an HFS+ filesystem smaller than that, and dd it back again when I'm done. (I don't yet know if that worked.)
cfdisk. No, not cfdisk. Needs a GPT partition table. Well, I guess I can rewrite the old msdos partition table when I'm done, then dd back the 8 GB. parted can make a GPT partition table. It can make a 7.5 GB partition. Can it make an HFS+ filesystem? No. Well, I was planning to plug the disc into the Mac anyway. Plug it into the Mac, make a filesystem (which inexplicably also adds a small partition with an MSDOS filesystem for EFI, apparently this is used only for firmware upgrades, why is it on my disc?), rsync across all the installer files, and bang! Away we go.
Away we don't go; it boots so far, and stops dead. Find out how to get a Mac to actually show you the boot messages, sigh. (At least unlike Silicon Graphics, at the point the machine won't boot completely, there is a way to see them.) Bit of puzzling over the last message printed, which is to do with the Ethernet, but actually it's that launchd (a sort of grand unified init replacement) doesn't like the ownership on some of the files, refusing when running as root to trust files other people can write, and it's not that it choked but that the very last thing in the rc file is "sleep 99999999" with a comment saying that the installer or something will always shut the system down. Hm.
On the CD they're all unknown:unknown, but apparently that works anyway (I assume there's some shim somewhere), but booting off USB you have to get the ownership right. Fix up those files... in fact, chown -R the whole disc 0:0, which apparently worked for someone somewhere. Ha, it boots! It boots to the install system telling me the installer failed, and there are some log messages I can view. To be precise, there is one, telling me the installation couldn't be done. Joy!
After a quick refresher on the whole head/keyboard experience, I read a bit more about how real Mac users (you demented Kool-Aid drinkers) set up booting from USB storage. Apparently you have to use Disc Utility to restore the USB drive from the install DVD, which is especially helpful if you still have a buggered DVD drive.
However, it turns out you can find the volume hdiutil mounted in the Finder, and restore from that, which looks like it just copies the same files as my rsync does, but clearly does some other magic because... presto! install system, and install system not complaining about how it can't run the installer, but instead install system happily running.
With any luck Earth Sciences will ask me an open-ended question about the Mac OS at interview. Also, I've probably missed a few things out; it's been a long night; and I certainly missed out some obvious false starts, like changing the startup disc to the not-booting USB one and having to clear the PRAM.
There are 5 comments on this entry.