Difference between revisions of "Apple Fusion Drive"

From ArchWiki
Jump to: navigation, search
(Proceed installing Archlinux)
(update link(s) avoid redirect)
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Installing Archlinux on iMac Fusion (2013) systems =
+
[[Category:Apple]]
 
+
 
Apple uses a [[Wikipedia:RAID]] alternative called CoreStorage to merge the ssd and hdd into a single logical volume (sold as Fusion). We need to remove this volume, so we can reinstall OSx to the hdd without using the ssd.
 
Apple uses a [[Wikipedia:RAID]] alternative called CoreStorage to merge the ssd and hdd into a single logical volume (sold as Fusion). We need to remove this volume, so we can reinstall OSx to the hdd without using the ssd.
  
 
== Boot into recovery ==
 
== Boot into recovery ==
  
Power on your iMac, holding down apple+R to enter the recovery environment. Make sure you have an internet connection (via ethernet cable or WiFi) for your iMac so it can start 'Internet Recovery' which  runs from RAM (a virtual disk2). This will allow you to play with the hdd and sdd without problems caused by mounted disks.
+
The iMacs that come with Fusion also come with a Rescue partition that runs itself from RAM (a virtual disk2). This will allow you to play with the hdd and sdd without problems caused by mounted disks. Power on your iMac, holding down apple+R to enter the recovery environment.  
  
When the Internet Recovery has started, start a Terminal (under menu 'Utilities).
+
When the Recovery has started, start a Terminal (under menu 'Utilities).
  
 
== Destroy CoreStorage and prepare new volumes ==
 
== Destroy CoreStorage and prepare new volumes ==
 
Find the CoreStorage 'Logical volume group' ID, and take note of the ssd and larger disk (disk0 & 1)
 
Find the CoreStorage 'Logical volume group' ID, and take note of the ssd and larger disk (disk0 & 1)
<pre> diskutil cs list</pre>
+
diskutil cs list
  
Unmount the MacintoshHd (might not always be needed) and remove the CoreStorage volume
+
Remove the CoreStorage volume
<pre> umount /Volumes/Macintosh\ HD
+
  diskutil cs delete <VOLUMEID>
  diskutil cs delete <VOLUMEID></pre>
+
 
 +
Sometimes you need to unmount a volume or try the above command twice for OSX to 'understand' and actually run it successful.
  
 
Zero the ssd (if you specify the correct disk this takes ~ 5 minutes)
 
Zero the ssd (if you specify the correct disk this takes ~ 5 minutes)
<pre> diskutil zeroDisk disk1</pre>
+
This will remove everything including the partition table so OSX doesn't 'see' the disk and won't try to use it during installation.
 +
diskutil zeroDisk disk1
  
Erase the hdd (this is faster then zeroing plus it creates a new HFS+ volume for OSx)
+
Erase the hdd (this is faster then zeroDisk plus it creates a new HFS+ volume for OSx)
<pre> diskutil eraseDisk JHFS+ Macintosh disk0</pre>
+
diskutil eraseDisk JHFS+ Macintosh disk0
  
 
== Install OSX on hdd ==
 
== Install OSX on hdd ==
Line 29: Line 30:
  
 
== Proceed installing Archlinux ==
 
== Proceed installing Archlinux ==
Installing Archlinux requires no special tricks; just follow [[Installation Guide]] install grub-uefi and you should be good to go! Since you'll be installing on the [[Solid_State_Drives]], use parted and created aligned partitions. I use this scheme:
+
 
 +
Installing Archlinux requires no special tricks; follow the [[Installation guide]]; mount /dev/sda1 (the first partition of the hdd is the [[UEFI]] partition) on /boot/efi; install grub-efi-x86_64 and you should be good to go! Since you will be installing on the [[Solid_State_Drives]], use parted and created aligned partitions. I use this scheme:
  
 
  Model: ATA APPLE SSD SM128E (scsi)
 
  Model: ATA APPLE SSD SM128E (scsi)
Line 41: Line 43:
 
  2      16384000000B  121331777535B  104947777536B  ext4
 
  2      16384000000B  121331777535B  104947777536B  ext4
  
Also, to use the internal network-card you'll need at least kernel 3.9! I use a thunderbolt cable (which works in kernel 3.7+) to download the latest 3.9-rc
+
Also, to use the internal network-card you will need at least kernel 3.9! I use a thunderbolt cable (which works in kernel 3.7+) to download the latest 3.9-rc
 +
 
 +
When rebooting; hold left-alt to show the internal bootloader so you can select your new install. To change the default boot-option to Archlinux, you need to 'bless' the earlier created UEFI file. It is best to rename the created 'EFI/arch_grub/grubx64_standalone.efi' to 'EFI/BOOT/BOOTX64.EFI', then run the following command from MacOSx, after mounting the EFI partition:
 +
 
 +
sudo bless --device=/dev/disk1s2 --file=/Volumes/EFI/efi/BOOT/BOOTX64.EFI --setBoot
 +
 
 +
Make sure you specify a partition on the ssd as '--device'! Otherwise OSX will boot efi from the partition, but grub will not find the ssd (where the actual install is) and you'll end up in rescue-mode.
  
References:
+
== See also ==
 +
* [[IMac_Aluminium]]
 
* http://blog.fosketts.net/2011/08/05/undocumented-corestorage-commands/
 
* http://blog.fosketts.net/2011/08/05/undocumented-corestorage-commands/
 
* http://arstechnica.com/apple/2012/11/achieving-fusion-with-a-service-training-doc-ars-tears-open-apples-fusion-drive/2/
 
* http://arstechnica.com/apple/2012/11/achieving-fusion-with-a-service-training-doc-ars-tears-open-apples-fusion-drive/2/

Revision as of 07:38, 16 February 2014

Apple uses a Wikipedia:RAID alternative called CoreStorage to merge the ssd and hdd into a single logical volume (sold as Fusion). We need to remove this volume, so we can reinstall OSx to the hdd without using the ssd.

Boot into recovery

The iMacs that come with Fusion also come with a Rescue partition that runs itself from RAM (a virtual disk2). This will allow you to play with the hdd and sdd without problems caused by mounted disks. Power on your iMac, holding down apple+R to enter the recovery environment.

When the Recovery has started, start a Terminal (under menu 'Utilities).

Destroy CoreStorage and prepare new volumes

Find the CoreStorage 'Logical volume group' ID, and take note of the ssd and larger disk (disk0 & 1)

diskutil cs list

Remove the CoreStorage volume

diskutil cs delete <VOLUMEID>

Sometimes you need to unmount a volume or try the above command twice for OSX to 'understand' and actually run it successful.

Zero the ssd (if you specify the correct disk this takes ~ 5 minutes) This will remove everything including the partition table so OSX doesn't 'see' the disk and won't try to use it during installation.

diskutil zeroDisk disk1

Erase the hdd (this is faster then zeroDisk plus it creates a new HFS+ volume for OSx)

diskutil eraseDisk JHFS+ Macintosh disk0

Install OSX on hdd

Quit the terminal and start the OSX installer. Do not use the GUI based Disk Utility at this point, it will show your disks as errored (red) and will want to fix them for you. This will actually screw things up as it will recreate the CoreStorage volume (even if you choose not to 'fix' anything). The OSX installer should show you 1 disk; which is the created JHFS+ volume on the hdd.

Proceed by installing a fresh OSX version on the hdd. You can play around in OSX, for example use the 'Disk Utility' to resize the OSX partition so you can allocate some space for Linux to use besides the ssd. Now boot the Archlinux usb-stick by holding the left-ALT key while booting your iMac (you might need to use an apple keyboard for this to work). This will show you a bootmenu where you can select the USB drive for booting.

Proceed installing Archlinux

Installing Archlinux requires no special tricks; follow the Installation guide; mount /dev/sda1 (the first partition of the hdd is the UEFI partition) on /boot/efi; install grub-efi-x86_64 and you should be good to go! Since you will be installing on the Solid_State_Drives, use parted and created aligned partitions. I use this scheme:

Model: ATA APPLE SSD SM128E (scsi)
Disk /dev/sdb: 121332826112B
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start         End            Size           File system     Name  Flags
1      1048576B      16383999999B   16382951424B   linux-swap(v1)
2      16384000000B  121331777535B  104947777536B  ext4

Also, to use the internal network-card you will need at least kernel 3.9! I use a thunderbolt cable (which works in kernel 3.7+) to download the latest 3.9-rc

When rebooting; hold left-alt to show the internal bootloader so you can select your new install. To change the default boot-option to Archlinux, you need to 'bless' the earlier created UEFI file. It is best to rename the created 'EFI/arch_grub/grubx64_standalone.efi' to 'EFI/BOOT/BOOTX64.EFI', then run the following command from MacOSx, after mounting the EFI partition:

sudo bless --device=/dev/disk1s2 --file=/Volumes/EFI/efi/BOOT/BOOTX64.EFI --setBoot

Make sure you specify a partition on the ssd as '--device'! Otherwise OSX will boot efi from the partition, but grub will not find the ssd (where the actual install is) and you'll end up in rescue-mode.

See also