Install instructions for Macbook Air OSX and Arch side by side
Before starting you should have some knowledge of partitioning and Arch Linux. Also, I'd like to note that, more than likely, the wireless card in your Macbook Air will not be detected by the Arch boot disk (or most other distros). With that being said, you will need a USB-to-Ethernet adapter. I like this one.
Items needed for install:
- Internet connection
- USB-to-Ethernet Adapter
- USB flash drive for the bootable .dmg (covered later)
- You will first need to resize your MacOS partition. You can do this using the Mac Disk Utility. If you are using APFS(Encrypted), you will be required to reinstall MacOS first, since the encrypted file system will not allow a resize.
- Turn off System Integrity Protection (SIP).
- Restart your MacOS
- Before it starts, press and hold
Command+R
- Select
Terminal
from theUtility
menu - In the terminal, enter
csrutil disable
- You should see a message similar to
Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.
- Reboot your machine
- Download and install rEFInd.
- Download the zip
- Extract to a folder
- In
Terminal
enter the directory that was extracted - Run the command
sudo ./refind-install
- Download the current Arch Linux iso.
- Convert
archlinux-20xx.xx.xx-x86_64.iso
to.dmg
format.
hdiutil convert -format UDRW -o archlinux-20xx.xx.xx-x86_64.iso arch-converted.dmg
- Write the
arch-converted.dmg
to a USB flash drive.
- In a terminal, enter
diskutil list
- Identify your USB drive. In my case it was
/dev/disk2
- Once you have identified the disk, enter
diskutil unmountDisk /dev/disk2
(replace disk2 with your USB drive) - Once unmounted, enter
sudo dd if=arch-converted.dmg of=/dev/rdisk2 bs=1m
(use anr
before disk to access the raw drive)
- Boot to USB drive.
- Power down your Macbook
- Insert your USB-to-Ethernet Adapter
- Power on, press and hold the
Alt/Option
key - On the UEFI selection menu, select your boot USB drive
- Verify network connectivity.
- Verify adapter appears and has connetivity. Enter
ip addr
- If DHCP has not started on the NIC enter
systemctl start dhcpcd@INTERFACE
, whereINTERFACE
is the NIC name. - Ping Google to verify internet connection. Enter
ping 8.8.8.8
- List devices and format unused partition.
- Enter
fdisk -l
to list the disks - Enter
sgdisk -n 0:0:0 -t 0:8300 -c 0:"data" /dev/sda3
(This assumes the partition you created is on devicesda
and is partition3
) - Inform OS of partition changes by entering
partprobe /dev/sda
(If device is notsda
, enter correct device name) - Make the filesystem format using
mkfs.ext4 /dev/sda3
- Mount the newly created partition.
mount /dev/sda3 /mnt
- Create a swap file.
- Create the file:
dd if=/dev/zero of=/mnt/swapfile bs=1M count=2048
(Change count to how big you would like it. I have it set to be 2GB) - Change permissions on the file:
chmod 600 /mnt/swapfile
- Inform OS to use as swap:
mkswap /mnt/swapfile
- Perform initial install of Arch to mounted volume.
pacstrap /mnt base base-devel grub-efi-x86_64 linux-headers broadcom-wl-dkms wpa_supplicant dialog vim git reflector
- Generate the
/etc/fstab
.
genfstab -pU /mnt >> /mnt/etc/fstab
echo 'tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0' >> /mnt/etc/fstab
echo '/swapfile none swap defaults 0 0' >> /mnt/etc/fstab
- Enter the fresh installed Arch system.
arch-chroot /mnt /bin/bash
- Initialize the
pacman-key
.
pacman-key --init
pacman-key --populate archlinux
- Update timezone information.
rm /etc/localtime
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
hwclock --systohc --utc
- Set hostname.
echo MYHOSTNAME > /etc/hostname
- Set your locale.
sed -i 's:#en_US.UTF-8 UTF-8:en_US.UTF-8 UTF-8:g' /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 >> /etc/locale.conf
echo LANGUAGE=en_US.UTF-8 >> /etc/locale.conf
echo LC_ALL=en_US.UTF-8 >> /etc/locale.conf
- Set
root
user password.
passwd
- Allow
wheel
group insudoers
file.
sed -i '/%wheel ALL=(ALL) ALL/c\%wheel ALL=(ALL) ALL' /etc/sudoers
- Add user and set password.
useradd -m -g users -G wheel $MYUSERNAME
passwd $MYUSERNAME
- Add
ext4
to/etc/mkinitcpio.conf
.
sed -i '/^MODULES=/c\MODULES=(ext4)' /etc/mkinitcpio.conf
- Regenerate the initrd image.
mkinitcpio -p linux
- Edit
/etc/default/grub
- Modify line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet libata.force=1:noncq"
- Add line:
GRUB_DISABLE_SUBMENU=y
- Make
grub.cfg
and standaloneboot.efi
file.
grub-mkconfig -o boot/grub/grub.cfg
grub-mkstandalone -o arch.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi --compress=xz boot/grub/grub.cfg
- Mount EFI partition and create. (assuming partition /dev/sda1)
mkdir -p /mnt/EFI
mount /dev/sda1 /mnt/EFI
mkdir -p /mnt/EFI/arch
cp /arch.efi /mnt/EFI/arch/arch.efi
- Exit chroot and reboot.
exit
reboot
- You should now be greeted with the rEFInd boot loader, and see an option for your Arch Linux partition.
To set this temporarily (in your current session only), use the following command:
echo "2" | sudo tee /sys/module/hid_apple/parameters/fnmode
To set this permanently (starts on next boot), use the following command:
echo "options hid_apple fnmode=2" | sudo tee /etc/modprobe.d/hid_apple.conf
Install Yay AUR Helper and Pacman Wrapper (https://github.com/Jguer/yay)
-
Create a directory for the yay PKGBUILD files and enter it.
mkdir ~/yay
cd ~/yay
-
Download yay PKGBUILD from AUR.
wget --no-check-certificate https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=yay --output-document=./PKGBUILD
-
Run
makepkg
to build and install yay.makepkg -si
-
You can now install packages from the Arch User Repository using a similar command:
yay -S google-chrome
-
If you receive a message similar to
A stop job is running for Session c2 of user xx
, you can decrease the timeout from 90 seconds (default) in the following config file:/etc/systemd/system.conf
Uncomment and change time on line:
DefaultTimeoutStartSec=10s
Uncomment and change time on line:
DefaultTimeoutStopSec=10s
-
If you receive a bunch of messages similar to
Failed to remount '/oldroot/sys/fs/cgroup/pids'
orRemounting '/oldroot/sys/fs/cgroup/pids'
, you can hide these by addingshutdown
toHOOKS
in the/etc/mkinitcpio.conf
file. Then rebuild theinitrd
image.sudo mkinitcpio -p linux