Difference between revisions of "Mac"

From ArchWiki
Jump to navigation Jump to search
(Changed the chown command to something that makes more sense. Some structure cleanup.)
(Updated various sections based on my own experiences)
Line 240: Line 240:
  
 
===Wifi===
 
===Wifi===
 +
====Ath5k====
 +
* At least on the original black MacBook (with an Atheros AR242x), the ath5k driver built into the kernel works fine.
 +
* This driver is autoloaded by udev.
 +
* You can blacklist ath_pci in rc.conf, since it is also autoloaded but unnecessary:
 +
$ MODULES=(!ath_pci...
 
====Ndiswrapper====
 
====Ndiswrapper====
 
* Note that ndiswrapper only works on 32 bit systems.
 
* Note that ndiswrapper only works on 32 bit systems.
Line 246: Line 251:
 
* The Lenovo Thinkpad 802.11abgn driver works well with the MacBook.  The driver can be obtained through the manufacturer's [http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-66449 own page], or directly with the following command:
 
* The Lenovo Thinkpad 802.11abgn driver works well with the MacBook.  The driver can be obtained through the manufacturer's [http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-66449 own page], or directly with the following command:
 
  $ wget -c ftp://ftp.software.ibm.com/pc/pccbbs/mobiles/7iwc28ww.exe
 
  $ wget -c ftp://ftp.software.ibm.com/pc/pccbbs/mobiles/7iwc28ww.exe
* Or you can use the drivers found in your OSX Dvd. I had success with the file broadcomxpinstaller.exe.
+
* Or you can use the drivers found in your OS X DVD. I had success with the file broadcomxpinstaller.exe.
 
* You need cabextract to extract the file.  Get it with pacman.
 
* You need cabextract to extract the file.  Get it with pacman.
 
  pacman -S cabextract
 
  pacman -S cabextract
Line 352: Line 357:
 
** Put them in /etc/rc.local to set them on boot
 
** Put them in /etc/rc.local to set them on boot
  
===X11===
+
===X11==
* '''NOTE:''' 915resolution is deprecated, and the xf86-video-intel driver should work out of the box (at least on the Macbook 2.1).  I couldn't get xf86-video-810 to do 1280x800.
+
====Simple configuration====
* Type 'pacman -S xorg xf86-video-i810 915resolution'
+
* Install X server and hardware drivers:
(it is sometimes better to use xf86-video-intel driver instead of xf86-video-i810, for example if you need to use xrandr features)
+
$ pacman -S xorg xf86-video-intel xf86-input-evdev xf86-input-synaptics
 +
* Add hal to daemons array in /etc/rc.conf:
 +
$ DAEMONS=(hal...
 +
* X will now work "out of the box" (without an xorg.conf).  Hotplugging and two-finger scrolling work without any additional configuration.
 +
====Old video configuration (depreciated)====
 +
* This replaces xf86-video-intel
 +
* Install drivers:
 +
$ pacman -S xf86-video-i810 915resolution
 
* Type 'X -configure'
 
* Type 'X -configure'
 
* Open /etc/conf.d/915resolution in your editor, uncomment the 'MODE' and 'RESOLUTION'.
 
* Open /etc/conf.d/915resolution in your editor, uncomment the 'MODE' and 'RESOLUTION'.

Revision as of 21:10, 14 December 2008

This article attempts to annotate the installation and configuration of Arch Linux on the Apple MacBook. All generations are supported, and relevant details concerning individual specifications have tried to be incorporated wherever necessary.

Partitioning in OS X

This section attempts to cover the most practical paths one can take in creating an ideal partition layout in OS X for the MacBook. If one prefers a Linux environment for setting up his or her partitions, the section, Partitioning in Arch, below will cover the specific points that need to be taken into consideration when implementing a partitioning layout on the MacBook. References to more user-friendly applications, such as Apple's "Boot Camp," will be mentioned here, but the depth will not be as great as that knowledge has already been documented extensively elsewhere.

Before attempting any of the following pre-installation procedures, it is advisable to upgrade your firmware to the latest state released by Apple. You can achieve this either through the "Software Update" application bundled with OS X, or through the downloads on the support section of Apple's home page. Note: The "Software Update" in OS X may not pick up all the firmware updates available for your computer. Therefore, it is possible your chance of having the most update firmware code will be increased by searching through Apple's official download page.

Single Boot

Dedicating your MacBook to Arch Linux permits you to follow the Official Arch Linux Install Guide as in a typical installation. If using rEFIt on a small partition without OS X, be sure not to install your boot loader of choice in the MBR (/dev/sda), but instead to the /boot partition or root partition if you are not going to reserve a separate partition for /boot.

Also note that the "Auto-Prepare" feature available on the Installation CD will allow you to erase and format your hard drive just fine, but the manual installer uses cfdisk to partition your drive, and it does not have the capability to recognize the GUID partition scheme that your MacBook will be in if formatted with "Disk Utility" (used by default in a normal OS X installation). In that case, it might be best to not use the installer to partition your disk and instead use a GPT-capable partitioner such as parted.

Furthermore, there are a few caveats discussed below that you should be familiar with in order to avoid any unpleasant outcomes:

  • Note: The points discussed below do not apply if you choose to keep a small partition containing OS X and a small EFI System Partition on the same GPT-scheme hard disk you will be installing Arch Linux to. The section that follows assumes you do not want any trace of OS X on your MacBook.
  • Firmware Updates - You will not be able to update the firmware on your MacBook without a hard disk layed out with the GUID Partition Table (GPT) containing an OS X installation and a separate EFI System Partition. If you do not have access to an external OS X environment, it may be best to include a small partition containing OS X as well as an EFI System Partition on the hard drive Arch Linux will be installed onto. With this method, you have the choice of booting Arch Linux through a boot menu, such as rEFIt, or via the firmware default isolated in your MacBook's PRAM (discussed in the second caveat below).
  • Delayed Boot - The mechanism the MacBook uses to boot an operating system does not have the ability to quickly recognize a disk laid out solely with the MBR scheme. Instead, it searches for a familiar GUID partition table that holds an EFI System Partition to transfer its rights to. This scanning can take anywhere between twenty and thirty seconds, in contrast to the process normally taking around ten seconds when the default operating system is selected through Apple's "Startup Disk." Since the "Startup Disk" application on both the OS X Install Disk and the default OS X installation cannot locate an operating system installed within the MBR scheme, there are a few alternative solutions that solve this problem:
1. Modify the code held in your MacBook's PRAM to skip checking for the GUID Partition Table and boot straight from the MBR. Following this method, you will have a system that boots normally, just like any other would, with an estimated time of around ten seconds from power-on to GRUB. This is actually what Apple's "Startup Disk" does, which is the graphical front-end for the application about to be described.

Warning: If you have adjusted the startup sound on your MacBook to something other than the default it came with, then the startup sound may be reset back to its factory default after the following modifications are made to your system's PRAM. You may have to boot into an external OS X environment in order to change the startup sound back to what you had before.

First, boot from an OS X Install Disk (this procedure may not work from an external OS X installation) and open up "Terminal." Use "diskutil list" to obtain the identifier of the disk Arch Linux will be installed onto.

diskutil list

The top part of the output should look something like this:

/dev/disk0
 #:                   type name               size      identifier
 0:  FDisk_partition_scheme                   *111.8 GB disk0

The following command will install the code to your MacBook's PRAM that allows it to boot from the MBR. Replace "[disk identifier]" with the identifier obtained from the above command:

bless --device /dev/[disk identifier] --setBoot -legacy

Using the previous example the command would be:

bless --device /dev/disk0 --setBoot -legacy

Note: The device /dev/disk0 does not actually represent the MBR, even though that is what we type in for the command. The device echoed with the below command, "bless --getBoot", should not be /dev/disk0 but another main block device nomination, such as /dev/disk2. To insure you have correctly set the proper pointer that can boot the MBR, such as /dev/disk2, type the following command:

bless --getBoot
2. Another option you have is to partition your hard disk with the GPT scheme and keep rEFIt installed on a small partition. This method does not result in as fast of a boot as the above does, but it gives you a boot menu that shows up on startup, allowing you to choose a valid operating system to boot from. This can be achieved by booting your MacBook into Target Disk Mode (Firewire); connecting to another disk with OS X installed, and partitioning your drive with the GPT scheme while creating a small HFS+ partition to hold rEFIt; installing rEFIt onto that partition; and finally typing "cd /efi/refit; ./enable-always.sh". It may be wise to set up all your partitions during this process, so as to avoid having to choose from a very select few partitioners that support the GPT scheme your disk will be laid out in. Furthermore, if you set up your partitions with "Disk Utility" or its back-end diskutil, there is no need to use gptsync to synchronize your partition tables. You can continue the installation process like you normally would (starting with the install step dedicated to filesystem creation), but be sure at the very end to install GRUB onto your boot partition or, if you do not want a separate boot slice, the root partition. You do not want to install onto /dev/sda or else this might prevent rEFIt from acting the way it was designed to.
3. A third option to counter the delayed boot is to hold the "Option" key on boot to bring up a menu that can transfer control to the MBR (the menu item will be titled "Windows"). Your MacBook will then boot to the MBR as fast as it physically can with the total time it takes to boot dependent upon how fast you confirm your selection at the menu. Holding the "Menu" button on a compatible Apple Remote during boot will also perform this same function.
  • Startup Sound - There is no available method for changing the startup sound on your MacBook without the presence of OS X. If you would like the startup sound on boot to be muted or at a specific volume output when single-booting Arch Linux, then an easy way is to adjust or mute the volume in OS X before Arch is installed. If the startup sound has returned after a firmware upgrade or PRAM modification, or you have already erased OS X and installed Arch Linux and would like to make adjustments now, boot from an external OS X drive (select it from the startup menu by holding "Option" on boot), and make arrangements from there.

Dual Boot

This portion of the article makes the assumption that one wants to install Arch Linux on top of an already-existing OS X configured MacBook. A higher success rate and smoother installation may be achieved by installing OS X from scratch and then following these steps. If this is the preferred option, then you may also decide to setup your partitions through "Disk Utility" before OS X is installed. In the case of a layout incorporating a shared partition, make sure to choose a filesystem that is writable from both OS X and Linux, for example: HFS+ (non-journaled) or FAT32 (more about dual boots with a shared partition below). In any case, you always have the option of disabling journaling on the default HFS+ filesystem in OS X in order to allow read/writes from Arch Linux.

No Shared Partition

  • Optional Step: Install rEFIt. This will give you a boot menu to choose between OS X and Arch Linux on every boot. Download the ".dmg" from the Refit Homepage and install it. Make sure to install your Linux boot loader (i.e. GRUB or LILO) on your /boot partition or on your root partition if you are not going to have separate partitions for both. Be careful about installing a boot loader to /dev/sda as this can lead to unexpected results with rEFIt.
  • Note: You can either partition your hard disk with the command-line application, diskutil, or its GUI front-end, "Boot Camp." Diskutil comes embedded into OS X, while "Non-Leopard" users may find themselves having to download and pay for the latest "Boot Camp" release.

1. Partitioning with diskutil:

  • Note: diskutil partitions a disk differently than most other applications. It creates new partitions by resizing an exisiting partition and creating new ones out of the remaining free space (in the case below the partition to be split is the second one located on /dev/disk0s2). Furthermore, your chances of success will almost always be guaranteed when performing the following operations after a clean OS X installation.
  • To partition using diskutil, open the "Terminal" application found in the /Applications/Utilities folder. The following steps can be performed while your OS X volume is mounted.
  • Disable journaling on your about-to-be-resized OS X partition. You can do this with "Disk Utility" in OS X or with diskutil through the following command. (Type "ls /Volumes/" to obtain the label of your OS X partition.)
sudo diskutil disableJournal /Volumes/[LABEL]
  • Next, type "diskutil list" and you should see something like this:
/dev/disk0
 #:                   type name               size      identifier
 0:  GUID_partition_scheme                    *111.8 GB disk0
 1:                    EFI                    200.0 MB  disk0s1
 2:              Apple_HFS Macintosh HD       111.5 GB  disk0s2
  • Below is the command usage for resizing a partition and reclaiming the remaining free space by creating a new partition. Note the disk identifier from the "diskutil list" command you typed (in the example above it would be disk0s2), and replace [disk identifier] with that identifier. Replace "[disk size]" with the new size of your OS X partition and "[partition size]" with the remaining space calculated via the total amount of space your original OS X partition takes up. Last, replace ["Partition label"] with a name for your new Arch Linux partition.
sudo diskutil resizeVolume [disk identifier] [disk size] "Linux" ["Partition label"] [partition size]
  • The example command below resizes the initial OS X partition (disk0s2) to 55.5 gigabytes and then creates the partition assigned to Arch Linux with the free space that was left over. The amount of free space that was left over after the resizing was calculated with the "diskutil list" command used above. "Linux" is the GPT recognized name for any of the possible filesystems most attributed to Linux.
sudo diskutil resizeVolume disk0s2 55.5G "Linux" "Phrakture" 56G
  • Reboot.
  • Verify your disk was formatted correctly.
diskutil list

2. Partitioning with "Boot Camp": The "Boot Camp" application released by Apple is considered by some to be more user-friendly due to its graphical interface and simple procedure.

  • Note: Apple no longer officially hosts the "Boot Camp" beta software; you can still obtain the last publicly released version, "Boot Camp 1.4b," from an unofficial mirror site. If you have 10.5 "Leopard," the "Boot Camp" final release comes bundled with the default installation and can be found in /Applications/Utilities. The software can also be extracted from the 10.5 Install Disk and installed onto any supported version of OS X.
  • Install "Boot Camp" if it is not already installed, and run the "Boot Camp Assistant" from the /Applications/Utilities folder.
  • Partition your hard drive however you like.

With Shared Partition

The easiest way to go about dual booting Arch Linux and OS X with a shared partition is by using Apple's diskutil application, the CLI back-end for "Boot Camp." Partitioning with diskutil keeps you from having to install Arch Linux through the FTP disk in order to use parted to partition and gptsync to sync the GPT and MBR partition tables (diskutil recognizes both the new GPT scheme and the old MBR and creates and syncs them for you upon write). In addition to using diskutil to partition, you will also have a choice of whether or not you want the shared partition to be a "shared" /home folder for both operating systems or a smaller partition while allowing both Arch Linux and OS X to have their own /home folders. You will also have to decide what filesystem to format your shared partition with. The non-journaled HFS+ and FAT32 filesystems are popular for sharing files between Linux and OS X due to both operating systems being able to read/write to them well. In the case of a shared /home, the Case-sensitive HFS+ (Non-Journaled) filesystem is a good way to go considering read/write support for non-journaled HFS+ filesystems is good in Linux, and the "case-sensitive" aspect of the HFS+ filesystem permits good interoperability between Arch Linux and OS X. Also, do not forget to synchronize your Arch and OS X UIDs, otherwise you will not have write access to your /home directory from both Arch and OS X; the Home Sharing section of this article describes how to do this.

  • Optional Step: Install rEFIt. This will give you a boot menu to choose between OS X and Arch Linux on every boot. Download the ".dmg" from the Refit Homepage and install it. Make sure to install your Linux boot loader (i.e. GRUB or LILO) on your /boot partition or on your root partition if you are not going to have separate partitions for both. Be careful about installing a boot loader to /dev/sda as this can lead to unexpected results with rEFIt.
  • Note: You can either partition your hard disk with the command-line application, diskutil, or its GUI front-end, "Boot Camp." Diskutil comes embedded into OS X while "Non-Leopard" users may find themselves having to download and pay for the latest "Boot Camp" release.
  • Further note: diskutil partitions a disk differently than most other applications. It creates new partitions by resizing an exisiting partition and creating new ones out of the remaining free space (in the case below the partition to be split is the second one located on /dev/disk0s2). Furthermore, your chance of success will almost always be guaranteed when performing the following operations after a clean OS X installation.
  • Open the "Terminal" application found in the /Applications/Utilities folder. The following steps can be performed while your OS X volume is mounted.
  • Disable journaling on your about-to-be-resized OS X partition. You can do this with "Disk Utility" in OS X or with diskutil through the following command. (Type "ls /Volumes/" to obtain the label of your OS X partition.)
sudo diskutil disableJournal /Volumes/[LABEL]
  • Type "diskutil list" and you should see something like this:
/dev/disk0
 #:                   type name               size      identifier
 0:  GUID_partition_scheme                    *111.8 GB disk0
 1:                    EFI                    200.0 MB  disk0s1
 2:              Apple_HFS Macintosh HD       111.5 GB  disk0s2
  • Below is the command usage for resizing a partition and reclaiming the remaining free space by creating a new partition(s). Note the disk identifier from the "diskutil list" command you typed (in the example above it would be disk0s2) and replace [disk identifier] with that identifier. Replace "[disk size]" with the new size of your OS X partition and "[partition size]" with the remaining space you want each individual partition to take up, calculated via the total amount of space your original OS X partition takes up. Last, fill in the ["Partition label"] fields with names for your new partitions.
sudo diskutil resizeVolume [disk identifier] [disk size] [partition type] ["Partition label"] [partition size] [partition type] ["Partition label"] [partition size]
  • The following example resizes the original OS X partition (disk0s2) to 30GB and sets up a 71.5GB shared, non-journaled HFS+ (Case Sensitive) /home partition and a 10GB Arch Linux root partition:
sudo diskutil resizeVolume disk0s2 30G "Case-sensitive HFS+" "Shared" 71.5G "Linux" "Arch" 10G
  • If you would rather use the FAT filesystem on a small shared partition and keep separate /home folders on the Arch Linux and OS X partitions, then you could use something like:
sudo diskutil resizeVolume disk0s2 50G "MS-DOS FAT32" "Shared" 11.5G "Linux" "Arch" 50G
  • The commands above do not actually format the partitions. They only store the proper information that the GUID Partition Table needs so it can be read from by applications and the native EFI bootloader. You will now have to format any partitions that can not be formatted in Linux with the desired filesystem. If you chose the Non-Journaled Case-sensitive HFS+ filesystem for your shared partition then you will need to format it with the below command after you reboot. You will then have to run "diskutil list" again to get the identifier for the new shared partition (following the example above it would be disk0s3).
  • Reboot
diskutil list
diskutil eraseVolume "Case-sensitive HFS+" "Shared" [disk identifier]
  • If you chose the FAT filesystem for your shared partition you can also choose to format it from OS X, but you may end up doing it over again in the Arch Linux installer when it comes time to mount and format your filesystems. To format from OS X type:
newfs_msdos -F 32 -v "Shared" /dev/[disk identifier]
  • If throughout this procedure you get a "chosen size is invalid..." error try expressing the size of the partitions in megabytes instead of gigabytes. The original command for a FAT32 formatted shared partition would then look like:
sudo diskutil resizeVolume disk0s2 50000M "MS-DOS FAT32" "Shared" 11500M "Linux" "Arch" 50000M
  • If you get a "Resizing encountered error No space left on device (28) on disk" error even though you have verified the total size of the partition you are splitting with "diskutil list", then first resize only the soon-to-be-split partition:
sudo diskutil resizeVolume disk0s2 30G
  • Reboot, and then create the rest of the partitions:
sudo diskutil resizeVolume disk0s2 30G "Case-sensitive HFS+" "Shared" 71.5G "Linux" "Arch" 10G
  • After using any of the above commands to repartition your MacBook, you can reboot and verify your partitions have been created with "diskutil list".
  • Note: It may be best at this point to synchronize the UID of your main account in OS X with the default in Arch Linux. Skip down to the Home Sharing section of this article for directions on how to do this.

Partitioning in Arch

If you prefer to partition in Linux, there are two tools available to Arch end-users that faciliate this process on the MacBook: parted and refit. GNU Parted will allow the repartitioning of your disk even if it is laid out in GPT format, while the refit package, available in the Arch community repository, allows the synchronization of the MBR table that is created by parted and the GUID Partition Table that is originally on a default OS X installation. If your hard disk is not layed out with the GPT scheme, then you can use the partitioner available through the Arch installer, cfdisk, and you need not follow the rest of the details covered in this section. You can find the scheme your drive is laid out in with Apple's "Disk Utility" or by trying to use cfdisk (the default application run from the Arch installer): if the drive is laid out GPT-style, you will be informed by cfdisk and possibly denied readable and/or writable access to the table.

[Note: The refit package was moved from [community] to [unsupported] at the end of January 2008; see this forum thread. This means that it can not be installed with the simple pacman command below!]

Note: If you are going to resize the HFS+ partition used by default in OS X, it may be wise to disable journaling prior to the task. You can do this with "Disk Utility" in OS X or with diskutil through the following command:

sudo diskutil disableJournal /Volumes/[LABEL]

Type "ls /Volumes/" to obtain the label of your OS X partition.

Prepare the Arch environment for partitioning:

  • Get the latest Arch Linux FTP Install CD and burn it.
  • Reboot, and hold down "C" during startup, so it will boot from the CD, or hold "Option" to select it from the firmware menu. If you installed rEFIt, you can select the Install CD from the boot menu that automatically comes up.
  • Type "arch" at the boot prompt or "arch vga=773" if you prefer a higher resolution.
boot: arch vga=773
  • Note: Due to a bug in the Apple firmware (Note from rEFIt FAQ), some MacBook Pro Core 2 Duo users have reported that the keyboard often does not work at the Arch Linux boot prompt. The only options are to either get a USB keyboard, which should work all the time, or keep rebooting until it works.
  • Note: Some MacBook (Pro) Core Duo users report strange keyboard output such as long delays and character doubling. If this is your situation, entering the following at the boot prompt should alleviate any such symptoms:
boot: arch noapic irqpoll acpi=force
/arch/setup
  • Select "FTP/HTTP" as the installation source when asked.
  • Select "Configure Network" from the "Main Menu."
  • Probe and/or select your network interface and either confirm the usage of DHCP or set up your interface statically.
  • Exit by selecting "Exit Install" at the "Main Menu."
  • Open /etc/pacman.conf in your favorite editor and uncomment the "[community]" header and its "Include" path to enable the repository:
[community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/community
  • Since "ftp://ftp.archlinux.org/" is throttled, configure /etc/pacman.d/core, /etc/pacman.d/community, and /etc/pacman.d/extra for a less slow download by moving a fast mirror to the top in those files. If you do not know which mirrors are the quick ones for you, then any mirror other than "ftp://ftp.archlinux.org/" will do for now.
  • Bring the available list of packages up to date, and install the latest versions of refit and parted along with their dependencies. This can be done with one command:
pacman -Sy refit parted
  • Continue with the instructions below that are relevant to your particular table layout, either a single boot or dual boot. If you do not have rEFIt installed and you do not plan on dual booting Arch and OS X, feel free to partition how you normally would, possibly ignoring the rest of this section.

Single Boot

This section only describes how to prepare your hard disk with parted if you are single booting Arch, while keeping rEFIt installed on a small partition. If you do not have rEFIt installed on a HFS+ partition and your drive is not layed out in the GPT format, there are no special modifications to consider during the single boot process. If your whole drive is configured with the MBR scheme, then you are advised to use whatever partitioner you feel most comfortable with, as there are no usual restrictions upon how you may partition your drive.

  • Note: If you had decided to partition your disk back when you installed rEFIt onto a small partition, these instructions are not relevant; you may move on to the actual installation process described in the Installation section of this article and select the "Partition Hard Drives" step in the "Prepare Hard Drive" menu on the installer, in order to format your assigned partitions.
  • Run the parted application on your hard drive:
parted /dev/sda
  • Type "p" to view the current partition table.
(parted) p
  • If you installed rEFIt onto a small partition but did not create the other partitions you want, you can now create all the other partitions you desire. If you installed rEFIt on a partition taking up the whole drive, you will have to resize the partition with the following command. Note: The command is based upon the assumption that rEFIt is installed on the first partition of the hard drive. If rEFIt is installed on any other partition, simply change the number "1" to whichever one it is on.
(parted) resize 1 <START> <END>
  • For <START> and <END>, use the count in MBs of where you want your partition to start and end.
  • To create a swap partition type:
(parted) mkpart primary linux-swap <START> <END>
  • The same goes for any other regular partition:
(parted) mkpart primary ext2 <START> <END>
  • Note: Parted only has the ability to format via the ext2, FAT16, FAT32, and linux-swap filesystems. It has the ability to create reiserfs partitions if libreiserfs is installed (not available through the Arch repositories). If you desire to use a filesystem such as ext3, reiserfs, xfs, or jfs, partition your hard drives in the parted application and format them as ext2. Then, during the actual Arch installation process, you will be given the opportunity to perform any other necessary filesystem creation over the original ext2 partition.
  • Further note: If you are single booting Arch on a MacBook layed out with the MBR scheme, you will be able to create a logical partition like you would be able to during any other typical pre-installation process. If your hard disk is not layed out MBR-style and instead layed out with the GPT scheme, you cannot create a logical partition as the GPT standard does not support the implementation needed to do so. You can find the scheme your drive is laid out in with Apple's "Disk Utility" or by trying to use cfdisk (the default application run from the Arch installer): if the drive is laid out GPT-style, you will be informed by cfdisk and possibly denied readable and/or writable access to the table.
  • Quit parted.
(parted) quit
  • Since you are using rEFIt on a small partition without OS X, synchronize your GUID Partition Table with the newly created MBR partition table.
gptsync /dev/sda
  • Jump to the Installation section of this article, and start the installation (/arch/setup).

Dual Boot

  • Run the parted application to partition your hard disk for a dual boot.
parted /dev/sda
  • Type "p" to view the current partition table.
(parted) p
  • If repartitioning from an OS X configured MacBook that holds an EFI System Partition, resize the current OS X partition first in order to free up space for your new partitions. Note: If you do not have an EFI System Partition and only have an OS X partition, change the number "2" in the following command to whichever partition OS X is on (probably "1").
(parted) resize 2 <START> <END>
  • For <START> and <END>, use the count in MBs of where you want your partition to start and end.
  • If you have any partitions on your disk other than the EFI System Partition and the partition that holds OS X, then remove them with the "rm" command:
(parted) rm <NUMBER>
  • Replace <NUMBER> with the position the partition rests on your drive. For example, to remove the third partition that comes after the OS X and EFI System Partition, according to your partition table shown with "p", type:
(parted) rm 3
  • Note: Be sure not to accidently remove the first or second partitions if that is where OS X and your EFI System Partition reside. Review your work carefully.
  • You may now, if you choose, make a partition for swap.
(parted) mkpart primary linux-swap <START> <END>
  • For <START> and <END>, use the count in MBs of where you want your partition to start and end.
  • The same goes for any other regular partition:
(parted) mkpart primary ext2 <START> <END>
  • Note: Parted only has the ability to format via the ext2, FAT16, FAT32, and linux-swap filesystems. It has the ability to create reiserfs partitions if libreiserfs is installed (not available through the Arch repositories). If you desire to use a filesystem such as ext3, reiserfs, xfs, or jfs, partition your hard drives in the parted application and format them as ext2. Then, during the actual Arch installation process, you will be given the opportunity to perform any other necessary filesystem creation over the original ext2 partition. Parted does not have the ability to create HFS+ filesystems, as may be the case if you desire a shared /home; you need to perform this type of creation in OS X.
  • Further note: If your hard disk is not layed out MBR-style and layed out with the GPT scheme (the default standard on a typical OS X installation), you cannot create a logical partition as the GPT standard does not support the implementation needed to do so. You can find the scheme your drive is laid out in with Apple's "Disk Utility" or by trying to use cfdisk (the default application run from the Arch installer): if the drive is laid out GPT-style, you will be informed by cfdisk and possibly denied readable and/or writable access to the table.
  • Quit parted.
(parted) quit
  • Synchronize your GUID Partition Table with your newly created MBR partition table.
gptsync /dev/sda
  • Jump to the Installation section of this article, and start the installation (/arch/setup).

rEFIt

  • You can now install the optional rEFIt if you have not done so already. Note: This is not a requirement. It only gives you a menu to choose between OS X and Arch Linux upon every boot.
  • In OS X, download the ".dmg" from -> Refit Homepage and install it.
  • If you have already partitioned your hard disk in preparation for the Arch installation, rEFIt may not be enabled by default. You will have to run the "enable.sh" script installed in /efi/refit/.
  • Open up "Terminal" and enter:
cd /efi/refit; ./enable.sh

Installation

This section assumes you have already finished partitioning your MacBook in preparation for an Arch installation. If you are single booting Arch Linux and you are not using rEFIt, you may follow the Official Arch Linux Install Guide with no special modifications, ignoring the rest of this section. If you are using rEFIt either in a single boot or dual boot setup, you will need to install your boot loader of choice onto your /boot partition or on your root partition if you are not opting for separation. The procedure for doing so is what follows.

  • Type "arch" at the boot prompt or "arch vga=773" if you prefer a higher console resolution.
boot: arch vga=773
  • Note: Due to a bug in the Apple firmware (Note from rEFIt FAQ), some MacBook Pro Core 2 Duo users have reported that the keyboard often does not work at the Arch Linux boot prompt. The only options are to either get a USB keyboard, which should work all the time, or keep rebooting until it works.
  • Note: Some MacBook (Pro) Core Duo users report strange keyboard output such as long delays and character doubling. If this is your situation, entering the following at the boot prompt should alleviate any such symptoms:
boot: arch noapic irqpoll acpi=force
  • Run the Arch installer:
/arch/setup
  • Be sure to work your way down through the menu, and do not forget to select the "Partition Hard Drives" step under the "Prepare Hard Drive" menu to format your partitions and mount them so Arch can be installed onto them. For the rest of the installation, you can follow the Official Arch Linux Install Guide and install everything normally until you make it to the menu item titled "Install Bootloader."
  • Note: The following procedure is unique to GRUB. The GRUB boot loader now has the complete ability to boot your Arch Linux system, is considered stable, and is now recommended more often for Linux installation on a MacBook then LILO. If you wish to use the LILO boot loader, you will have to consult further documentation as the article's contributors have not yet attempted to boot Arch on the MacBook with LILO.
  • Select "Install Bootloader" from the "Main Menu" of the installer.
  • Choose the option "Use the GRUB bootloader" when asked.
  • When you review your GRUB configuration file, make sure that both "root" fields point to the correct partitions and the kernel and initrd paths are correct for your partition setup. If you plan on using a separate boot partition, do not have "/boot" in front of "/vmlinuz26" and "/kernel26.img" on the "kernel" and "initrd" fields respectively. The following example boots Arch Linux from the fourth partition on the hard drive devoted to the root file system. This could pertain to those dual booting OS X with Arch while having an EFI System Partition and a shared home.
# (0) Arch Linux
title  Arch Linux
root   (hd0,3)
kernel /boot/vmlinuz26 root=/dev/sda4 ro vga=773
initrd /boot/kernel26.img
  • The example below boots Arch from the second partition on the hard drive assigned to /boot, while the third partition is assigned to root (/). This could be an example for those having only rEFIt installed on a small partition and no OS X.
# (0) Arch Linux
title  Arch Linux
root   (hd0,1)
kernel /vmlinuz26 root=/dev/sda3 ro vga=773
initrd /kernel26.img
  • If you are using rEFIt, make sure you install GRUB onto a partition, either your /boot or your /root (i.e. /dev/sda4) if you are not using separate partitions for both.
  • Do not install GRUB onto /dev/sda! Doing so is likely to lead to an unstable post-environment.
  • If GRUB was successfully installed, choose "Exit Install" from the "Main Menu."
  • If you did not partition your disk from OS X using diskutil or "Disk Utility" and instead partitioned with another third-party program or from Linux, sync your partition tables one more time for good measure.
gptsync /dev/sda
  • NOTE: If you get an error that GRUB was not installed successfully, it sometimes works if you go through the same steps a second time. If you receive an error message again stating that GRUB was not successfully installed, run the following commands, and then attempt to install GRUB again:
! Replace the "3" with whatever your root partition is (i.e. sda4 -> 4)
! 83 is for ext2/3.  If you have something else, type "sfdisk -T" for a list of supported partition types. 
# sfdisk -c /dev/sda 3 83
# gptsync /dev/sda
  • If you still get an error message when installing GRUB, keep trying those commands. It should work eventually.
  • You may now reboot your system. If rEFIt is setup correctly, you will be able to choose the correct icon in the boot menu on startup. If you do not have rEFIt installed, you will have to either hold the "Option" key during startup (or the "Menu" button on a compatable Apple Remote), or follow the instructions below to allow your MacBook to transfer its pre-control rights directly to GRUB (this will save the maximum time possible during a normal boot).
reboot
  • If you are single booting without rEFIt and need to save a new instruction set in the PRAM to boot straight from the MBR instead of spending time searching for the GUID Partition Table, hold the "Option" key during startup or the "Menu" button on a compatable Apple Remote and boot into your new Arch Linux setup.
  • Then, synchronize your local package database with the one on the FTP/HTTP server you chose as your default during the install process, and install the "eject" package via pacman to eject your Arch installation media. This can all be done with one command:
pacman -Sy eject
  • Eject the disk.
eject
  • Insert an OS X Install Disk, and reboot while holding either the "C" or "Option" keys to initiate the loading of the DVD.
  • Follow the instructions in this article titled "Delayed Boot" under the Single Boot (Partitioning from OS X) section to reconfigure your firmware's default boot device.
  • Note: If you are sharing your Arch /home folder with OS X, skip down to the Home Sharing section of this article before you create your first user account.
  • Enjoy your new Arch MacBook!

Post Install

Wifi

Ath5k

  • At least on the original black MacBook (with an Atheros AR242x), the ath5k driver built into the kernel works fine.
  • This driver is autoloaded by udev.
  • You can blacklist ath_pci in rc.conf, since it is also autoloaded but unnecessary:
$ MODULES=(!ath_pci...

Ndiswrapper

  • Note that ndiswrapper only works on 32 bit systems.
  • First, install the ndiswrapper package like so:
$ pacman -Sy ndiswrapper
  • The Lenovo Thinkpad 802.11abgn driver works well with the MacBook. The driver can be obtained through the manufacturer's own page, or directly with the following command:
$ wget -c ftp://ftp.software.ibm.com/pc/pccbbs/mobiles/7iwc28ww.exe
  • Or you can use the drivers found in your OS X DVD. I had success with the file broadcomxpinstaller.exe.
  • You need cabextract to extract the file. Get it with pacman.
pacman -S cabextract
  • Create a new directory for the soon-to-be extracted files, change the cwd to it, and extract the main file.
mkdir 7iwc28ww; cd 7iwc28ww/; cabextract 7iwc28ww.exe
  • Install the driver where <path/to/driver> is the .inf file from the extracted .exe. If you are using the Lenovo Thinkpad 802.11abgn driver, replace <path/to/driver> with WINXP_2K/NET5416.INF.
ndiswrapper -i <path/to/driver>
  • The below command may have already been executed during installation of the ndiswrapper application, but run it anyway just to be sure the correct alias for wlan0 is written to /etc/modprobe.conf.
ndiswrapper -m
  • Verify your driver has been installed properly:
ndiswrapper -l
  • Now, you can add "ndiswrapper" to your MODULES array in /etc/rc.conf, and load the module manually:
modprobe ndiswrapper

Madwifi

Primary installation through the Arch repositories:

  • First, install the madwifi driver and madwifi-utils:
pacman -Sy madwifi madwifi-utils
  • Then, load the "ath_pci" module. You can also add it to the MODULES list in /etc/rc.conf if you want it to load on a normal boot.
modprobe ath_pci
  • And if everything is ok, you should see something like this:
ifconfig             
 ath0    Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX  
         inet6 addr: fe80::219:e3ff:fed4:be51/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0 
         RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
  • Some MacBook users have reported more success when downloading and installing from SVN. There is a madwifi-svn package in the AUR, which can be found here.
    • The problems one may encounter when using madwifi drivers on MacBook is that wifi suddenly stops working. This may happen after the system is awaken or just after some random period of time (see the ticket here http://madwifi.org/ticket/1017) and using /etc/rc.d/network restart doesn't always help. Some people have reported success when they unloaded all the madwifi modules and loaded them back again.

Fan Speed

  • The fan doesn't seem to change speeds with the temperature. We can (somewhat) fix this
  • Add applesmc to your MODULES array in /etc/rc.conf
    • Also run:
modprobe applesmc
  • This creates a bunch of magic files in /sys/devices/platform/applesmc.768
  • As root type
   echo 1 > /sys/devices/platform/applesmc.768/fan1_manual
  • As root type
   echo 3500 > /sys/devices/platform/applesmc.768/fan1_output
    • You may want to add this to your /etc/rc.local
    • The number can be anywhere from 1800 to 6200.
    • I find that for normal use, 3500-4000 is good.
    • When it gets really hot, 4500-5000 is good.
    • (after you add applesmc to your modules, running sensors will give you a lot more output)
    • I'm going to try and write a script to deal with this better.
(I've wrote a simple app in C to keep my MacBook cold. It's written for xfce4-genmon-plugin, but you can also use it with conky, cron or anything else.) -- Husio 16:38, 30 June 2007 (EDT)

Temperature Sensors

  • To go along with this, we should be able to read from the temperature sensors.
  • Type
pacman -S lm_sensors
  • To autodetect sensors type 'sensors-detect'
  • In /etc/modprobe.conf add:
alias char-major-89 i2c-dev
  • In /etc/rc.conf add:
i2c-i801, eeprom, and coretemp to your MODULES() line.
  • In /etc/rc.local add:
sensors -s
  • Now you can type sensors to see your core temperatures.

Suspend

Suspend to Ram

If you want to get your macbook suspend to ram on closing it and you're using acpi, just add to /etc/acpi/actions/lm_lid.sh:

# Suspend
if [[ `cat /proc/acpi/button/lid/LID0/state | tr -s " " | cut -d" " -f2` = "closed" ]]
then
    pm-suspend
fi

There's some problem with mpd if you suspend when mpd is playing. It can't connect to localhost after waking up.

Backlight Control

pommed

  • Install the 'pommed' program from community
  • Put 'pommed' in your DAEMONS array in /etc/rc.conf
  • Start it manually with '/etc/rc.d/pommed start'

You may also want to install gpomme which is GUI for pommed daemon. Edit then ~/.gpommerc and add gpomme to startup (it's not a daemon).

By default the F1, F2 ... FX keys are disabled and act like Fn+F1, Fn+F2 ... To enable the keys and make use of Fn+FX, modify /etc/pommed.conf.mactel or /etc/pommed.conf.pmac by changing fnmode = 1 to fnmode = 2. Save it as pommed.conf and restart pommed with /etc/rc.d/pommed restart.

To enable the sound keys (Fn+F3, Fn+F4 and Fn+F5), you have to modify /etc/pommed.conf : change init = -1 to init = 80 and (at least on Macbook 2) change volume = "PCM" to volume = "Front" and after that restart pommed with /etc/rc.d/pommed restart. (Thanks to the Debian Wiki)

macbook-backlight

If you want to control your backlight from console, install macbook-backlight (it's in AUR). If you're using acpi, you may also want your /etc/acpi/actions/lm_battery.sh to look like this:

if [[ -z $(acpi | grep discharging) ]]
then
    /usr/bin/macbook-backlight +80
else
    /usr/bin/macbook-backlight -80
fi

Now you can also set it in pommed.

Frequency Scaling

  • Run 'pacman -S cpufrequtils'
  • Add speedstep-centrino (be careful, since a recent update it seems to be "acpi_cpufreq"), cpufreq_conservative to your MODULES array in /etc/rc.conf
    • Modprobe them manually too.
  • Run 'cpufreq-set -c 0 -g conservative' and 'cpufreq-set -c 1 -g conservative'
    • Put them in /etc/rc.local to set them on boot

=X11

Simple configuration

  • Install X server and hardware drivers:
$ pacman -S xorg xf86-video-intel xf86-input-evdev xf86-input-synaptics
  • Add hal to daemons array in /etc/rc.conf:
$ DAEMONS=(hal...
  • X will now work "out of the box" (without an xorg.conf). Hotplugging and two-finger scrolling work without any additional configuration.

Old video configuration (depreciated)

  • This replaces xf86-video-intel
  • Install drivers:
$ pacman -S xf86-video-i810 915resolution
  • Type 'X -configure'
  • Open /etc/conf.d/915resolution in your editor, uncomment the 'MODE' and 'RESOLUTION'.
  • Set the RESOLUTION to '1280 800'
  • Add 915resolution to your DAEMONS array in /etc/rc.conf
    • Start it manually with /etc/rc.d/915resolution start

Touchpad

With 7.3 version of x.org and kernel 2.6.22 or later, it should work out of the box. If it doesn't follow these instructions for loading the kernel modules:

  • First you must add, appletouch, usbhid, and tsdev modules to the MOD_BLACKLIST array in rc.conf. (This is because udev loads the modules in random order)
  • Then add appletouch, usbhid to MODULES array IN THAT ORDER.

By default the touchpad operates in compatibility mode by emulating a standard mouse. Many users though will find these default settings problematic as the touchpad is too sensitive and will cause accidental cursor jumping and clicking. However, by using a dedicated driver, more advanced features and fine tuning of the touchpad become available.

  • Type 'pacman -S synaptics' to install the driver
  • Load the synaptics driver by adding the following line to the Module section of your xorg.conf:
Load "synaptics"
  • Add the touchpad to the ServerLayout section:
InputDevice    "Synaptics Touchpad" "CorePointer"
  • Add this section to your xorg.conf. I will enable horizontal two-finger-scrolling and a right click by tapping the top right hand corner of the touchpad. It switches off mouse clicks for tapping the touchpad, like OSX does.
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "CorePointer"	
Option "Device" "/dev/input/mice"
Option "Protocol" "auto-dev"
Option "LeftEdge" "100"
Option "RightEdge" "1100"
Option "TopEdge" "50"
Option "BottomEdge" "300"
Option "FingerLow" "20"
Option "FingerHigh" "30"
#We don't want the palm to trigger a tap, therefore a tap has to be quite fast
Option "MaxTapTime" "100"
Option "MaxTapMove" "100"
Option "MaxDoubleTapTime" "200"
Option "VertScrollDelta" "25"
Option "HorizScrollDelta" "60"
Option "VertTwoFingerScroll" "true"
Option "HorizTwoFingerScroll" "0"
Option "FastTaps" "true"
#Tapping the top right-hand corner will trigger a right click
Option "RTCornerButton" "3" 
#An ordinary tap will not trigger a click 
Option "TapButton1" "0"
Option "TapButton2" "0"
Option "TapButton3" "0"
Option "MinSpeed" "0.5"
Option "MaxSpeed" "3.5"
Option "AccelFactor" "0.05"
EndSection
  • Finally, restart your X server.
  • The Debian Wiki has also a few suggestions on how to configure right-clicking and scrolling.
  • Also, see Touchpad Synaptics or the synaptics manpages for many more options.

Sound

If you follow the arch wiki on ALSA it pretty much covers the instructions and specifics. However, there is a noticeable crackling sound from the left channel. I fixed this with the following: (as root/sudo)

 # mkdir /etc/modprobe.d/
 # nano /etc/modprobe.d/options

Add this line:

 # options snd-hda-intel position_fix=1


The above commands creates a options file, then specifies a fix. You Must REBOOT!

iSight

There is linux-uvc-isight in the AUR. Some people for whom the normal release didn't work had success with linux-uvc-isight-svn, but if you use that, install linux-uvc-utils-svn as well. Then, follow the instructions :

You *must* install and load the firmware to /lib/firmware, e.g:

 # mkdir -p /lib/firmware

Then, as you need apple's firmware you have to copy it form your mac partition (or get it from the internet) :

# cp ${OSX_MOUNT}/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport /lib/firmware

Make sure you installed ift (isight-firmware-tools, also in AUR) and :

 # ift-extract --apple-driver AppleUSBVideoSupport

A udev rule "/etc/udev/rules.d/isight.rules" should have been installed with ift which should load the isight firmware on bootup from /lib/firmware.

Reboot or reload your udev rules :

 # udevcontrol reload_rules

If the firmware doesn't load you can try doing it manually:

 # /usr/lib/udev/ift-load -b 005 -d 006 --firmware /lib/firmware/isight.fw

Check the two numbers for they should match "lsusb | grep 05ac:8501"

You can also manually create a udev rule in "/etc/udev/rules.d/isight_manual.rules"

 # ACTION=="add", SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="8501",
 #  RUN+="/usr/lib/udev/ift-load -b 005 -d 006 --firmware /lib/firmware/isight.fw"

Alternately for a slightly more dynamic approach, which allows other usb devices to be plugged in when booting.

 # ACTION=="add", SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="8501",
 #  RUN+="/usr/lib/udev/ift-load -b `lsusb | gawk '{if ($6 == "05ac:8501") {sub (/:/,"", $4); print $2 " -d " $4}}'` --firmware /lib/firmware/isight.fw"

Load the 'uvcvideo' module and add it to your /etc/rc.conf if you want it to load at boot.

Everything should work, if you have mplayer, you can test with :

 # mplayer tv:// -tv driver=v4l2:width=1280:height=1024:device=/dev/video0 -fps 20

If you see your face, then it's ok (if you don't, check that you are in front of your iSight).

Apple Remote

lirc

Because lirc and lirc-utils from default repository won't work with macbook, you have to compile them with macmini driver. Both PKGBUILDs can be found in ABS. After installation, record your remote signal with:

 $ /usr/bin/irrecord --driver=macmini --device=/dev/usb/hiddev0 /etc/lircd.conf

Here's how the /etc/lircd.conf might looks like:

 begin remote
   name  /etc/lircd.conf
   bits            8
   eps            30
   aeps          100
   one             0     0
   zero            0     0
   pre_data_bits   24
   pre_data       0x87EED4
   gap          211976
   toggle_bit_mask 0x87EED402
 
       begin codes
         # key_name               signal_
           up                       0x0B
           down                     0x0D
           prev                     0x08
           next                     0x07
           play                     0x04
           menu                     0x02
       end codes 
 
 end remote

Set your bindings in ~/.lircrc or in /etc/lircrc for global configuration. Example setting for mplayer:

 begin
 prog = mplayer
 button = play
 config = pause
 repeat = 15
 end
 
 begin
 prog = mplayer
 button = menu
 config = stop
 repeat = 15
 end
 
 begin
 prog = mplayer
 button = prev
 config = seek -10
 repeat = 10
 end
 
 begin
 prog = mplayer
 button = next
 config = seek +10
 repeat = 10
 end
 begin
 prog = mplayer
 button = up
 config = volume 1
 repeat = 1
 end
 
 begin
 prog = mplayer
 button = down
 config = volume -1
 repeat = 1
 end

appleir

This patch is only for kernel < 2.6.22.

Load the appleir module (or add it to the MODULES array in /etc/rc.conf). Then run xev to check the signals, or copy this to ~/.Xmodmap:

keycode 153 = XF86AudioNext
keycode 144 = XF86AudioPrev
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume
keycode 162 = XF86AudioPlay
keycode 158 = XF86Favorites

and run xmodmap ~/.Xmodmap.

Home Sharing (incomplete !)

UID Synchronization

In OS X

Note: It is recommended that UID/GID manipulation be done immediately after a new user account is created, in OS X as well as in Arch Linux. If you installed OS X from scratch, then this operation is guaranteed to work after logging into your account for the first time.

Step 1: Change UID and GID(s)

·Pre-Leopard

  1. Open NetInfo Manager located in the /Applications/Utilities folder.
  2. If not done for you already, enable access to user account transactions by clicking on the closed lock at the bottom of the window, and entering your account password, or root password if you have created a root account.
  3. Navigate to /users/<new user name> where <new user name> is the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch.
  4. Change the UID value to 1000 (the value used by default for first user created in Arch).
  5. Change the GID value to 1000 also.
  6. Navigate to /groups/<new user name>, automatically saving the changes you have made so far, where <new user name> is, again, the name of the account that will have read/write access to the folder that will be shared with the primary user in Arch. Note: If you get an error message that the transaction is not allowed, log out and log back in.
  7. Change the GID value to 1000 (the value used by default for user account creation in Arch).

·Leopard

In Leopard, the NetInfo Application is not present. A different set of steps is required for UID synchronization:

  1. Open System Preferences.
  2. Click on Accounts.
  3. Unlock the pane if not already done so.
  4. Right-click on the desired user and select "Advanced Options."
  5. Write down the value of the User ID field, you'll need it later on. Change both the UID and GID to match the UID and GID of the account wished to be shared with in Arch (1000 by default for the first user created in Arch).

Step 2: Change "home" permissions

  1. Open up "Terminal" in the /Applications/Utilities folder.
  2. Enter the following command to reclaim the permission settings of your home folder, replacing <your user name>, <your user group> and <your old UID> with the user name whose UID and GID values you just changed, the group name whose GID value you just changed and the old UID number, respectively.
find /User/<your user name> -user <your old UID> -exec chown <your user name>:<your user group>
In Arch

To synchronize your UID in Arch Linux, you are advised to perform this operation while creating a new user account. It is therefore recommended that you do this as soon as you install Arch Linux, but if you have already set up a normal .... (Will finish the rest later--burned out)

fstab Line

...