After having big troubles with installing Linux on my new macbook I decided to post a simple (and incomplete
Googling around and spending much much time erasing and installing and erasing and installing ... I found some interesting things:
- an apple machine that borns with an os will never run an older os (macbooks included)
- rEFIt is only able to boot oses from the first 4 partitions on the internal disk (and from dvd-drive, and maybe from usb)
- leopard, which you pay for when you buy a macbook, and which you want to use, wants to be installed in one of the first 4 partitions
- leopard uses the first partition with a fat fs in it but leaves it empty (maybe for windows!? ...don't know)
- leopard needs to format your drive with EFI GPT UUID partition table (or whatever it is called )
- windows needs of course to be in a privileged position, and at this time I'm trying to install it...
- a boot partition for grub, which makes all your Linux work, must be within the first 4 partitions
My problem was that EVERY howto is for installing a single linux in only ONE
, which can be a problem for many reasons, unless you install osx and/or windows on an external drive or things like that which I din't like.
My configuration now is 9 GPT partition with Slackware-current, Ubuntu 7.10, osx and an empty partition for windows (which I haven't installed yet). The 3 are booting and running, but I'm still configuring them, so this guide won't help you configuring your macbook; for that you can google around.
What you need:
- Slackware install dvd
- Ubuntu 7.10 cd (NOT ALTERNATE, it didn't work for me!)
- rEFIt (dmg version for osx)
- a macbook, of course
- kernel source
- a working Linux console
- lots of patience and time
I assume you know how to:
- make a bootable custom slackware dvd
- burn your bootable cds/dvds
- compile a kernel
- use vi
- do many other things that I don't remember by now
If you don't, maybe you also don't need a 9 partition macbook =)
- compile the kernel with support for GPT partitions and all mac stuff, with all your needs. Don't forget usb support which you'll need for backups etc!
If you don't know what you need you can open extended info in osx (preinstalled or after step 1) or by putting in Ubuntu cd, booting it and "lspci -v" from a terminal, which, of course, is the better way
- make a custom Slackware dvd with kernel just compiled
- try it by putting it into dvd-drive and pressing alt (option key) when booting, it should boot and give you a console. try also parted (fdisk and cfdisk don't support GPT partitioning so, forget them.
- please read all the steps before starting. There are missing parts for which I apologize.
- I am not responsible for damages you do to your hardware/software and listed below is what functioned for me, I simply don't know how and if it will work on other configurations.
By doing this you have to use DiskUtil, osx's tool for partitioning disks, which is available after agreeing with license from the upper menu. With that tool you have to make your partitions as would be in your final configuration.
Personally I made 8 partitions in my 250gb disk, with different sizes, for different needs. This is the result:
- sda1 - 200MB fat32; well, actually I didn't, leopard's diskutil did...
- sda2 - 300MB ext3; /boot partition with grub and kernels
- sda3 - 70GB hfs+; this one is for osx
- sda4 - 40GB xfs; /home
- sda5 - 80GB xfs; this is for all other files
- sda6 - 15GB xfs; this is Ubuntu's root
- sda7 - 13GB ntfs; xp
- sda8 - 1GB swap; this should have been greater (I have 4gb ddr2...)
- sda9 - 20GB xfs; last but not least Slackware's root
The first one is hidden and made by default by leopard.
Note that diskutil leaves some empty space around the disk, between partitions (of course you'll notice that later, not within apple's tools).
You can leave future Linux partitions unformatted (in leopard they have taken away the possibility to create Unix partitions, so leave them empty), we'll format them later.
Using Tiger for partitioning and then installing leopard would end to a waste of time, because leopard needs (as said above) certain things for installing (tried also that way).
After partitioning your disk you have to install leopard and configure that, do whatever you want but do steps below
Install first boot loader.
Download and install rEFIt just like any other osx application but remember to do
Put your brand new Slackware dvd into the drive and boot it (it should appear as a choice from rEFIt's menu; if not, reboot).
make a backup of your osx installation or the entire drive with dd.
save your partition table:
dd bs=512 count=10 if=/dev/sda of=/<somewhere-in-some-external-drive>
count=1 should be enough but I love doing space-wasting secure things
dd bs=2048 if=/dev/sda of=/<somewhere-in-some-external-drive>
if you want all your drive, if=/dev/sda1 2 3... takes only one partition (which at this point is faster and safe, but remember sda with count).
After backing up you have to mount your Slackware partition somewhere
mkdir /mnt/linux /mnt/cdrom /install
mount /dev/sda9 /mnt/linux # sda9 is my Slackware /
mount /dev/hda /mnt/cdrom
tar xzf /mnt/cdrom/slackware/a/pkgtools*.tgz
tar xzf /mnt/cdrom/slackware/a/tar*.tgz
for dir in a ap d f k l n x xap; do cd $dir; installpkg -root /mnt/linux *.tgz; cd ..; done
Now you have to create your fstab, copy some stuff (like your kernel):
echo "/dev/sda9 / xfs defaults 1 1" > etc/fstab
mount /dev/sda2 boot
cp -r /boot/* boot/ ## initial kernel from live cd
cp -r /lib/modules/* lib/modules/
and run all necessary scripts, which I apologize, i don't remember but it looked like:
etc. I'm sorry I can't find the bookmark with the appropriate howto, but I'm sure you'll find it on the web =)
Install second boot loader.
Boot from Ubuntu cd and open a terminal.
mount /dev/sda2 /boot
cd /boot && mkdir grub
echo "(hd0) /dev/sda" > grub/device.map
create a file /boot/grub/menu.lst like this:
kernel /MB18.104.22.168v0.1 root=/dev/sda9 ro
and other stuff that you will find around like timeout=321 etc.
Note that (hd0,1) stands for /dev/sda2, which is the partition with your kernels, grub files, etc.
Grub must be installed on your boot partition and must be chainloaded from rEFIt. For me that was the only way it worked properly.
Reboot and you will find in rEFIt a penguin icon with the words "Boot Linux from Partition 3". enter it, wait few seconds and grub should appear. You should also be able to boot your Slackware Linux. Boot it and make a copy of /dev/sda2 (your boot partition) with dd as above, before moving to step five.
Boot your Ubuntu cd and follow the installation being careful of three things:
- set manually your partitions;
- install the boot loader in your boot partition (not /dev/sda because this would take you to a non-booting system);
- let the installer format your /boot partition (that's why we did the backup!);
In the way you like (eg. by booting your Slackware dvd, which is by far faster than the Ubuntu one) restore your /boot partition simply inverting "if" and "of" in the command you typed to back it up.
Setting up loaders.
Reboot using your Slackware dvd and enter in parted:
Now you have to do nothing but write your partition table, for example by unsetting a flag that is not set: set 8 boot off
This is done because partitioning tool from Ubuntu does something I ignore and changes the partition table in a strange way.
Set up all your kernels in /boot/grub/menu.lst.
Note that for me changing root=/dev/sdax with root=UUID=really-not-human-understandable-thing (which is Ubuntu's default) ended in a kernel panic, so I changed all default UUIDs in /dev/sdx. Also tried grub 1.95: it compiled and installed ok but it stuck waiting in its shell when booting.
Reboot again in osx by holding alt key at boot time and restore refit using enable.sh as above.
Reboot again and enter rEFIt's partitioning tool to update AGAIN your partition table.
I tried booting xp's cd but it found only the first 3 partitions on my drive. I Said the first three because xp sees some empty space (few MB, left by diskUtil) as a partition
I tried installing it into a different dirve and then copying with dd the entire partition over sda7 but I've only ben able to mount it in Linux, not to boot it as rEFIt boots only oses from first 4 partitions and grub simply didn't do the job.
I tried mapping the drive but the only thing happened is that grub restarted himself.
I tried mapping drives and booting the cd but somehow grub doesn't let me do that... googling around I found that you can only boot cds from other bootloaders by chainloading them after grub, so
I tried one of them and it did the same as rEFIt, it somehow canceled grub's mapping and booted the cd.
Yesterday I have bought a huge disk for backup and I'm going to remake all paritions, like this:
- sda1 - 200MB fat32; EFI
- sda2 - 13GB ntfs; xp
- sda3 - 67GB hfs+; leopard
- sda4 - 300MB ext3; /boot
- sda5 - 20GB xfs; Slackware /
- sda6 - 30GB xfs; /home
- sda7 - 15GB xfs; Ubuntu's /
- sda8 - 90GB xfs; this is for all other files
- sda9 - 4GB swap; I have 4gb ddr2
By this way windows partition is moved to the first three, resolving (hope) that problem. Better in partition 2 because it sees your disk as a strange ...thing.
Swap partition has grown to 4GB because of the hibernate feature and because they say so
I hope this will be appreciated by someone, who, like me, bought a macintel and messed up with those stupid limitations imposed for some strange reason by a company that wants to make unhappy Linux users.