[Parted-maintainers] Bug#604134: ppc: after debian installation MacOS 9.2 won't recognize disk anymore
annathemermaid at hush.com
annathemermaid at hush.com
Sun May 22 01:51:46 UTC 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
tag 604134 - squeeze-ignore
Justification: workaround doesn't work, alternative workaround
(described below) is horribly, horribly convoluted
I am multi-booting on an iBook G3 (April 2003), 900mHz. The
hardware does, amazingly for a G3, appear to be capable of handling
disks greater than 128 GB, although OS 9.2.2 is not.
This is one of the last models capable of booting directly into Mac
OS 9.2.2, as opposed to only running it in Classic Mode. However,
apparently Mac OS 9.2.2 can only be installed from within Classic
Mode on OS X, not directly off the CD. After Debian broke Mac OS
9.2.2 so it couldn't boot anymore, but instead displayed a floppy
image with a flashing question mark, the Update Drivers function on
the Classic install CD did not work. When booting off the CD, the
option was greyed out, and when opening the CD in Classic mode, it
did not appear capable of seeing the disk. Re-blessing the System
Folder didn't help either. Neither did re-initializing the Apple
Partition Map with OS X's pdisk and manually inputting the
partition map that was there before, although admittedly there were
some asterisks in the original that I could not duplicate.
I have successfully installed OpenBSD and NetBSD on this iBook
without them breaking Mac OS 9.2.2. OpenBSD worked normally, while
NetBSD required following some very well-written instructions about
bypassing certain parts of their installation procedure manually.
The NetBSD makes mention of the default installation procedure
faking the Apple Partition Map in such a way that it works for most
purposes but not for Mac OS; however, it is possible to work around
this by bypassing that portion of the installation and only
modifying (not re-initializing) the partition map with NetBSD's
pdisk. (Which, for the record, they have graciously ported to
Linux.)
Based on the NetBSD documentation, I devised a plan to wipe the
disk and start over, this time bypassing the portions of the Debian
installer than might be causing issues. But first, I copied yaboot,
yaboot.conf, and ofboot.b to a small external drive. For reference,
here are the NetBSD/macppc installation instructions.
ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.1/macppc/INSTALL.html
The NetBSD documentation goes into great detail on how to correctly
partition a disk on macppc that is intended to be multi-booted.
http://www.netbsd.org/ports/macppc/partitioning.html
I re-initialized the disk with Mac OS X's Disk Utility, being
careful of course to install the Classic disk drivers. Classic's
Disk Setup would also have worked; however, Disk Setup cannot see
more than 128GB of the disk, thus I chose Disk Utility. Mac OS
9.2.2 is perfectly capable of reading this larger-than-128GB
partition map, although of course I expect it wouldn't be able to
boot from or mount any partitions over the limit, at least not
without third party software. Then, after making sure any HFS/HFS+
partitions were unmounted, I ran pdisk /dev/disk0 from a terminal.
NetBSD has excellent instructions on the use of pdisk, and creating
filesystems afterward. (As an alternative to newfs_hfs
/dev/whatever, you may also create the HFS(+) partitions using Disk
Utility's Erase Partition functionality.)
http://www.netbsd.org/ports/macppc/partitioning.html#pdisk
Using pdisk, I was able to get rid of the free spaces Disk Utility
puts between partitions. I was, of course, careful not to touch the
first 8 partitions (partition map and drivers). I was also able to
create partitions with type Apple_UNIX_SVR2, which is what Debian
and NetBSD use, and also one of type OpenBSD.
I then installed Mac OS X Tiger. After booting into Tiger, I had to
change the permissions on the disk I intended to install Classic on
so that it was actually writable. They were probably broken as the
result of my nonstandard way of creating the filesystems. Ctrl-
clicking the disk, this could be done graphically. After this, I
was able to restore a Classic System Folder from a small backup
media (the disk that originally came with the laptop and is now in
a USB enclosure), and use that to install Mac OS 9.2.2 onto another
partition. At this point, both OS X and Classic were quite able to
boot.
I then booted into the Debian cd and selected expert mode. However,
since expert wasn't expert enough for me, I promptly pressed Esc
and changed the debconf priority to low. I then went to the
beginning and continued normally, until it came time to partition
the disks. At this point, instead of entering partman, I escaped to
a shell. I had already partitioned all of Debian's partition's from
Tiger's pdisk, since I did not know if any of Debian's partitioning
utilities were safe to use, not having found pdisk among them, and
did not want to re-install everything another half-dozen times to
find out. So, I used mac-fdisk only to view pdisk to remind myself
where everything was, but did not change anything with it. I should
also add that I specifically avoided creating an Apple_Bootstrap
partition (more on that later). After answering the Sphinx's
question, I created the actual filesystems with mkfs_ext3, mounted
them all onto /target, and turned on the swap.
I could not figure out how to manually create dm-crypt/luks
partitions from the installer. Fortunately, I only wanted swap,
/tmp, and /var/tmp encrypted, so it was no big deal to wait until
after installation to encrypt them. However, had I wanted to
encrypt other partitions, it would have been more of an issue.
I then proceeded normally with the installation procedures after
partitioning, although at this point I started getting warning
messages, courtesy of the Carpet Riders of Petra. After installing
the base system, I escaped back into the shell and modified
/target/etc/fstab manually.
I probably didn't enter the cdrom entry into fstab properly, thus
allowing the escape of a harpy, because installing installation
sets did not work properly. No matter: nothing I can't fix post-
installation. (This ultimately involved fixing fstab with the
proper cdrom entry, apt-cdrom, manually editing sources.list, apt-
get update, and of course installing the desired packages.) If you
do get the package installation working properly in the installer,
I advise against the "Graphical Desktop" option. When I tried it on
a previous installation, I did not get multiple consoles and was
unable to escape from X.org by pressing Ctrl+Alt+Fn+F1; however,
without that set of packages, Ctrl+Alt+Fn+F[1-6] works great.
I also skipped the yaboot installation and finished the
installation without installing yaboot.
Mac OS X and Classic still booted fine. Yay!
I restored the yaboot, yaboot.conf, and ofboot.b from the backup
media onto the root of the first HFS+ partition.
I was able to get into yaboot with the following OpenFirmware
command:
boot hd:,yaboot
For ofboot.b:
boot hd:,ofboot.b
Yaboot boots directly to Linux; ofboot.b is the multi-booter that
shows different options.
The NetBSD explains OpenFirmware usage in excellent detail.
http://www.netbsd.org/ports/macppc/SystemDisk-tutorial/
However, before I could get yaboot to actually boot into Linux
successfully, I had to experiment to yaboot.conf. I edited
yaboot.conf with OS X's vim, as I did not trust TextEdit not to
screw with the formatting. I still haven't got ofboot.b to work
properly. Apparently, yaboot reads the current version of
yaboot.conf, whereas ofboot.b appears to have been generated based
on the original yaboot.conf and takes no notice of the new one.
Getting yaboot to work properly was probably the hardest step of
all, and, even with the help of Gentoo documentation, involved a
bit of trial-and-error.
http://www.gentoo.org/doc/en/handbook/handbook-
ppc64.xml?part=1&chap=10#manual_yaboot
After taming several small dragons, this is what I ended up with.
Yaboot complains about being on an Apple_HFS partition rather than
an Apple_Bootstrap partition, but it does work. I ignored a lot of
warnings to make everything work.
boot="/dev/disk/by-id/ata-SAMSUNG_HM160HC_S12TJDQB113413-part9"
device=hd:
partition=15
root="/dev/hda15"
timeout=100
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
enablecdboot
macosx="/dev/disk/by-id/ata-SAMSUNG_HM160HC_S12TJDQB113413-part9"
macos="/dev/disk/by-id/ata-SAMSUNG_HM160HC_S12TJDQB113413-part10"
image=/boot/vmlinux
label=Linux
read-only
initrd=/boot/initrd.img
image=/boot/vmlinux.old
label=old
read-only
initrd=/boot/initrd.img.old
Tada! A working Debian installation, although like I said, I still
had to manually correct fstab and sources.list, install desired
software, and setup the encrypted partitions. And Mac OS X *and*
Mac OS 9.2.2 still work, without any need for an "Update Drivers"
function. However, mythological jokes aside, I think you will
agree with me that my solution is far too convoluted to count as a
proper workaround.
A better way would be to change Debian's installer to, if the user
states they plan on multi-booting (especially with Mac Classic,
although there might be other operating systems out there that
could be confused by a bad partition map), use NetBSD's pdisk
rather than partman, and provide an easier way of putting yaboot,
and maybe even ofboot.b, onto an HFS+ partition rather than an
Apple_Bootstrap partition, so that Linux can start in a similar
fashion to OpenBSD and NetBSD, without breaking other operating
systems.
A quick way would be to throw a warning into the Debian installer
that it might break Mac Classic (and possibly other operating
systems), possibly in such a way that could not be repaired short
of wiping the disk, and to provide detailed instructions on a
manual installation procedure, like mine, on how to avert this
potential disaster.
-----BEGIN PGP SIGNATURE-----
Charset: UTF8
Note: This signature can be verified at https://www.hushtools.com/verify
Version: Hush 3.0
wsBcBAEBAgAGBQJN2GwyAAoJEKlMTST7VF+oUcAH/3B3oOwt4C1RLhbYzlR5B0HIJAS5
FZkrjGyxGkv5sNYo+DSb4MkqKTWtLgzcaDvFSfpPc/y3vlmuI1LMf8uYN4yDfx6onhz2
SXbdfOST9ioZCP0qssPHr4qz1hKwNrdaVm7Tud1sPW+UKk50UQQTIVX2qGrSNTbKZTtE
n7k6Z37K654cL1ZErE6j1OCU0+Gu4L14MdhHx/klRvaU4H8I+ugc/SHUL74XAdFFtUH2
rBBMzZnDPhJTGDw5eYuSs8G7Bs6EOAMV28KROojxrFTkeV/RC4c4srqwMbPwhL5S4Jbp
ZCYKUeXxcggqAdqYRzXFToCnlVGNXmN+eJiMOZY/ybU=
=TnXM
-----END PGP SIGNATURE-----
More information about the Parted-maintainers
mailing list