This is a how to install Gentoo on a brand new Apple Mac Mini Server 2,1. It turned out to be a bit tricky (in fact i wasted 5 days). So if you want to follow my guide, you should already be experienced with linux. I still provide a step by step tutorial. But please READ ALL THE MENTIONED DOCS first, before you start! How to read the following text:
See full list on wiki.debian.org. AEZAKMI System Requirements. Windows 8.1 x64, Windows 10 x64, Windows Server 2008 R2, Windows Server 2012, Windows Server 2016, Windows Server 2019 Dual-core, 64-bit Processor 4gb RAM 2gb Free Hard Disk Space Directx 11 Graphics Card Administrator Account MacOS iMac, MacBook, Mac mini 2010 or later macOS 10.12 Sierra or later 4gb. OWC's step-by-step video of how to install dual SSDs or hard drives in an Apple Mac mini Server (Mid 2010). Interested in using these videos on your site view our video usage policy. DISCLAIMER: Although every effort is made to provide the most accurate and useful information in OWC Videos, no warranty, expressed or implied, is made regarding.
# italic is a command line you enter in a terminal
italic is a line you add to a config file
blockquote is a config file
Well, to install an unencrypted linux on the Mac Mini was easy, but i wanted to install an RAID 1 with DM-CRYPT and LVM2 on the 500gb disks.
-1.) Howto install a regular Gentoo on a Mini
Now if you don’t need RAID, encryption and the logical volume manager, then its quite simple to install Gentoo. Just
– Install rEFIt
– Boot Live CD and install Gentoo according to the manual.
– Use LILO instead of GRUB and reboot.
0.) Now lets start with the tricky part.
But to add all the other features to the mac mini installation was not that simple. More or less we work with the three following HOWTOS
[1] The Gentoo Handbook
[2] HOWTO for LVM2, RAID, DM-Crypt
[3] HOWTO for GRUB2
And i will just refer to them as [1],[2],[3]. Something like „[1] / 10.b. Default: Using GRUB“ refers to the section of document 1 😉 Again: Read them first and my article before you start anything. Also you should read the rEFIt documentation and all man pages of unknown commands.
1.) Preparing EFI
Apple does not use a regular BIOS, but an Extensible Firmware Interface (EFI). That means we have to tell the EFI, to boot other OS as well.
Boot your Mac Mini, download rEFIt from their website, open the .dmg file and install rEFIt.mpkg. Now you can switch between your OS when pressing „ALT“ (on a windows keyboard) before starting the mac.
2.) Booting from a Live CD
Welcome to the first problem: The Mac Mini (4,1) , Mac Mini Server (2,1) and the new Mac Book Pros (Generation 8 ) use the nVidia MCP89 SATA Chip. It is not really supported by the kernel [UPDATE: SINCE 2.6.37 A PATCH FOR EHCI USB HOST IS PROVIDED, THERE IS NO NEED TO APPLY THE PATCH ANY MORE], so if you boot e.g. a regular Gentoo Install CD (or Debian), then you won’t find any drives or harddisks at all. A workaround is provided by Kernel >=2.6.36. Also Ubuntu 10.10 patched their 2.6.35 kernel to find this chip. Thats the Live CD i used.
Get the Ubuntu 10.10 Live CD from here. Boot your Mac while pressing „ALT“, in rEFIt choose „Windows CD“ (yeah 😉 ). Don’t just hit enter to boot Ubuntu, you’ll end at a black screen. Instead, in the first menu hit F6, activate „nomodeset“ and then boot up Ubuntu.
3.) Installing additional things & stuff
Perhaps you want to change your keyboard first, but i’ll stick with the necessary informations: Ubuntu does not know LVM2 and RAID, but thats what we need for [2]. Open a terminal and install
# sudo apt-get install lvm2 mdadm
Now lets deal with the Hard Disks. Apple uses Guid Partition Table (GPT), i just have Gentoo running on the hard disks, no boot option for Mac OS X any more. So there was no need to keep any GPT signatures. I later deleted the 200MB EFI partitions as well.
# sudo parted /dev/sda and mklabel msdos
repeat for the second hard disk:
# sudo parted /dev/sdb and mklabel msdos
4.) Follow instructions
Until you have entered the chroot environment, don’t forget to use sudo, if you stick to my way (booting from Ubuntu). In case you are booting from any other cd and got a real root account, then of course you don’t need sudo.
After using parted, you can can just follow instructions from the HOWTOs. Start with [2] / Partitions till you have reached the Point [2] / Installation. Then you continue with [1] / 4.d. Don’t forget to activate the swap partition after making file systems!
# sudo swapon /dev/mapper/vg-swap
Mount all your partitions, unpack the stage3 file, portage tree, until you reach [1] / 7.b.
5.) Kernel configuration
You need at least a Kernel >= 2.6.36, get it from here. Keep in mind, you’re still in the chroot environment:
# cd /usr/src
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.tar.bz2
# tar xvjf linux-2.6.36.tar.bz2
# ln -s linux-2.6.36 linux
# cd /usr/src/linux
# make menuconfig
[2] / Installation tells you, that you need the Device Drivers + Crypt Support. But as you have no PS2 Keyboard, you also need USB + FULL HID installed, otherwise you have no chance to enter you password. Yeah, that happened to me… 😉
Device Drivers —> Multiple device drivers -> Device mapper support
Device Drivers —> Multiple device drivers -> Crypt target suport
Cryptographic API —>
Device Drivers —> HID Devices -> full HID support
Device Drivers —> USB support -> EHCI HCD (USB 2.0)
Device Drivers —> USB support -> OHCI
Device Drivers —> USB support -> UHCI
Yes, i got all three activated. When i got some time, i will update this howto and provide a minimal kernel config for the mac mini server.
# make && make modules_install
# cp arch/i386/boot/bzImage /boot/kernel-2.6.36
6.) Follow [1] until [1] / 10
Until you got to the point of installing a boot loader. If you really stick to the partition scheme from [2] you use this /etc/fstab:
/dev/md1 /boot ext3 noauto,noatime 1 2
/dev/mapper/vg-root / ext3 noatime 0 1
/dev/mapper/vg-swap none swap sw 0 0
/dev/mapper/vg-home /home ext3 defaults 0 2
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
proc /proc proc defaults 0 0
7.) Install Bootloader
Now it gets a bit tricky: Because GRUB does not know how to handle EFI, LiLo is easy to configure as long as you don’t use RAIDS, LVM and DM-Crypt. So we have to install GRUB2 and more or less continue with [3]. For now just tell /etc/portage/package.keyword to install grub-1.98 (don’t get confused, thats Grub2). Grub2 doesn’t like premounted /boot partitions. So we leave chroot, umount /mnt/gentoo/boot, reenter chroot and mount it from there:
# exit
# sudo umount /mnt/gentoo/boot
# sudo chroot /mnt/gentoo /bin/bash
# env-update && source /etc/profile
# mount /boot
Furthermore Grub2 can’t really handle LVM volumes, so we have to patch it. Get the PATCH
# cp lvm-detection.patch /usr/portage/sys-boot/grub/files
Tell the ebuild to use the patch file:
# nano /usr/portage/sys-boot/grub/grub.198 ebuild
add the following line to the src_unpack section
epatch „${FILESDIR}“/lvm-detection.patch
then tell portage not to complain about the new file size
# ebuild /usr/portage/sys-boot/grub/grub-1.98.ebuild manifest
now finally install grub2:
# emerge -vat grub
8.) Create Initrd before installing grub
Follow [2] / Packages to create the initramfs. But there is one important modification:
/dev/mapper/vg-root is only a symlink to ../dm-1. If you just use the line from the HOWTO
cp -a /dev/console /dev/sda2 /dev/sdb2 /dev/null /dev/urandom dev
you end with an unbootable initramfs (sth. like „cannot open / create device node“). To avoid this, use
cp -a /dev/console /dev/sda2 /dev/sdb2 /dev/null /dev/urandom /dev/dm-* dev
instead! Then you can continue according to [2] and create the initramfs.
9.) Configuring Grub2
Thats where i became a bit lazy and tired of rebooting and rebooting all the time, so this is a quick and dirty work around, not really clean. First
# grub-mkconfig -o /boot/grub/grub.cfg
Then edit /boot/grub/grub.cfg
# nano /boot/grub/grub.cfg
(YES, i can READ: „DO NOT EDIT THIS FILE“ -> it just means, you have to do this step every time you reconfigure grub2. Any helpful comment for a clean and neat solution is appreciated!).
and scroll till you find
linux /kernel.2.6.36 root=/dev/mapper/vg-root ro
below (but within the {} ) add:
initrd /initramfs
Now we install grub on both MBR (in case one of the disks fails we can still boot the raid from the second one:
# grub-install /dev/sda
# grub-install /dev/sdb
10.) Thats it!
Just leave the Chroot, umount everything and reboot. Don’t forget to hit „ALT“ for rEFIt – then hit ENTER on any of the two partitions. Wait a bit, enter you password and then enjoy your new system. 😉
11.) Helpful commands & advices
If you screw anything up and you have to reenter the Chroot enviroment:
Press ALT, boot Ubuntu Live CD (nomodeset), then
# sudo apt-get install lvm2 mdadm
# sudo mdadm –assemble /dev/md1 /dev/sda1 /dev/sdb1
# sudo mdadm –assemble /dev/md2 /dev/sda2 /dev/sdb2
# sudo cryptsetup luksOpen /dev/md2 vault
# sudo vgchange -ay vg
# sudo mkdir /mnt/gentoo
# sudo mount /dev/mapper/vg-root /mnt/gentoo
# sudo mount /dev/mapper/vg-home /mnt/gentoo/home
# sudo swapon /dev/mapper/vg-swap
# sudo mount -t proc none /mnt/gentoo/proc
# sudo mount -o bind /dev /mnt/gentoo/dev
# sudo chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile
# mount /boot
Also if anything goes wrong during the boot process, it helps to slow down the init file in the initramfs by adding a sleep 10 after every line.
Mac Mini
So far so good, hope i was able to give something back to the linux community.
Comments are closed.