Instructions for Arch installation notes + Arch on IMac/Book installation.
References:
- pandeiro/arch-on-air
- ArchLinux Installation With OS X on Macbook Air (Dual Boot)
- Arch Installation guide
- ArchLinux on MacBook(Air)
1. Make bootable USB media with Arch ISO image (wiki, video guide)
dd if = archlinux-2015.01.01-dual.iso | pv | of = /dev/sd*
fdisk -l
cgdisk /dev/sd*
If the installation is on Apple device the partition table should look like this:
Mount point | Partition | Name | Partition type | Suggested size |
---|---|---|---|---|
NONE | /dev/sdX4 | Boot Loader | Apple HFS+ | 128M |
/ | /dev/sdX5 | Boot | Linux filesystem | 256MB |
/ | /dev/sdX6 | Root | Linux filesystem | [Rest of space] |
Check if the partition scheme of the disk is right:
lsblk
mkfs.ext4 /dev/sdX5
mkfs.ext4 /dev/sdX6
mount /dev/sdX6 /mnt
mkdir /mnt/boot && mount /dev/sdX5 /mnt/boot
Create a swapfile :
dd if=/dev/zero of=/mnt/swapfile bs=1G count=8
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapfile
Mount point | Partition | Name | Partition type | Suggested size |
---|---|---|---|---|
NONE | /dev/sdX4 | Boot Loader | Apple HFS+ | 128M |
/ | /dev/sdX5 | Boot | Linux filesystem | 256MB |
NONE | /dev/sdX6 | Swap | Linux Swap | [X] |
/ | /dev/sdX7 | Root | Linux filesystem | [Rest of space] |
Check if the partition scheme of the disk is right:
lsblk
Create Filesystem:
mkfs.ext4 /dev/sdX5
mkfs.ext4 /dev/sdX7
mount /dev/sdX7 /mnt
mkdir /mnt/boot && mount /dev/sdX5 /mnt/boot
mkswap /dev/sdX6
swapon /dev/sdX6
Mount point | Partition | Name | Partition type | Suggested size |
---|---|---|---|---|
NONE | /dev/sdX1 | Boot | BIOS boot partition | 2M |
/ | /dev/sdX2 | Root | Linux filesystem | [Rest of space] |
Check if the partition scheme of the disk is right:
lsblk
Create Filesystem:
mkfs.ext4 /dev/sdX2
mount /dev/sdX2 /mnt
Create a swapfile :
dd if=/dev/zero of=/mnt/swapfile bs=1G count=8
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapfile
Internet connection required, for wireless option use:
wifi-menu
For DHCP:
systemctl enable dhcpcd.service
Test:
ping www.google.com
Run
pacstrap /mnt base base-devel
genfstab -p /mnt >> /mnt/etc/fstab
vi /mnt/etc/fstab
/dev/sd*6 / ext4 defaults,noatime,discard,data=writeback 0 1
/dev/sd*5 /boot ext4 defaults,relatime,stripe=4 0 2
/swapfile none swap defaults 0 0
If your drive is HDD, you fstab file should look like this (Apple only):
/dev/sd*6 / ext4 rw,defaults,noatime,data=writeback 0 1
/dev/sd*5 /boot ext4 rw,defaults,data=ordered 0 2
arch-chroot /mnt /bin/bash
passwd
echo myhostname > /etc/hostname
ln -s /usr/share/zoneinfo/Canada/Eastern /etc/localtime
hwclock –systohc –utc
useradd -m -g users -G wheel -s /bin/bash myusername
passwd myusername
pacman -S sudo
echo “%wheel ALL=(ALL) ALL” > /etc/sudoers.d/10-grant-wheel-group
nano /etc/locale.gen
locale-gen
echo LANG=en_US.UTF8 > /etc/locale.conf
export LANG=en_US.UTF-8
Insert "keyboard" after "autodetect" if it's not already there.
vi /etc/mkinitcpio.conf
Then run it:
mkinitcpio -p linux
To boot up the computer we will continue to use Apple’s EFI bootloader, so we need GRUB-EFI:
pacman -S grub-efi-x86_64
vi /etc/default/grub
A special kernal parameter must be set to avoid system (CPU/IO) hangs:
GRUB_CMDLINE_LINUX_DEFAULT="quiet rootflags=data=writeback libata.force=1:noncq"
Additionally, the grub template is broken and requires this adjustment:
#Fix broken grub.cfg gen
GRUB_DISABLE_SUBMENU=y
Generate the configuration file of grub:
grub-mkconfig -o boot/grub/grub.cfg
grub-mkstandalone -o boot.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi --compress=xz boot/grub/grub.cfg
Copy boot.efi (generated in the command above) to a USB stick for use later in OS X:
mkdir /mnt/usbdisk && mount /dev/sdb /mnt/usbdisk
cp boot.efi /mnt/usbdisk/
For GRUB/EFI bootloader configuration
Install GRUB:
pacman -S grub
vi /etc/default/grub
The grub template is broken and requires this adjustment:
#Fix broken grub.cfg gen
GRUB_DISABLE_SUBMENU=y
Generate the configuration file of grub:
grub-install --target=i386-pc --recheck /dev/sdX
grub-mkconfig -o boot/grub/grub.cfg
Arch doesn't have wireless included in the base packages. Install the following packages before rebooting for the WiFi to work on reboot:
pacman -S iw wireless_tools wpa_supplicant dialog
Before rebooting, exit from the chroot and unmount partition/s:
exit
umount -R /mnt
reboot
Format (“Erase”) /dev/sda4 using Mac journaled filesystem.
This procedure allows the Apple bootloader to see our Arch Linux system and present it as the default boot option.
cd /Volumes/disk0s4
mkdir System mach_kernel
cd System
mkdir Library
cd Library
mkdir CoreServices
cd CoreServices
touch SystemVersion.plist
nano SystemVersion.plist
<xml version="1.0" encoding="utf-8"?>
<plist version="1.0">
<dict>
<key>ProductBuildVersion</key>
<string></string>
<key>ProductName</key>
<string>Linux</string>
<key>ProductVersion</key>
<string>Arch Linux</string>
</dict>
</plist>
Copy boot.efi from your USB stick to this CoreServices directory. The tree should look like this:
|___mach_kernel
|___System
|
|___Library
|
|___CoreServices
|
|___SystemVersion.plist
|___boot.efi
sudo bless --device /dev/disk0s4 --setBoot
You may need to disable the System Integrity Projection of OS X:
- Restart the computer, while booting hold down Command-R to boot into recovery mode.
- Once booted, navigate to the “Utilities > Terminal” in the top menu bar.
- Enter “csrutil disable” in the terminal window and hit the returnkey.
- Restart the machine and System Integrity Protection will now be disabled.
End of Arch Linux is installation.
Reboot the computer and hold the alt/option key to select operating system.
sudo pacman -S gnome
I will be using xinit to start the desktop enviroment, a display manager like GDM can be used and enable with systemd.
sudo pacman -S xorg-xinit
The .xinitrc file should look like this, first run:
cp /etc/X11/xinit/xinitrc ~/.xinitrc
sudo nano .xinitrc
then
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# twm &
#xclock -geometry 50x50-1+1 &
#xterm -geometry 80x50+494+51 &
#xterm -geometry 80x20+494-0 &
#exec xterm -geometry 80x66+0+0 -name login
exec gnome-session
Start session with:
starx
Install Guake:
sudo pacman -S guake
sudo pacman -S zsh
3.2 Install Oh My Zsh
Install halfo/lambda-mod-zsh-theme
3.3 Clone .dotfiles repo and install script:
git clone [email protected]:alphayed/.dotfiles.git
cd ~/.dotfiles
chmod +x .makesymlinks.sh
./.makesymlinks.sh
Use techdavid/backup script to restore Arch Linux's pacman configuration data and manually installed packages.
To backup your current packages and configuration, simply run the following at any time:
./bacpac backup
To restore your packages and configuration on another computer or after reinstalling the operating system, run the following:
git clone https://gist.github.com/alphayed/af79469e7f143bf5c517344e57503132 bacpac
cd bacpac
./bacpac restore
To update bacpac, which you should do every few days to stay up-to-date, run the following:
./bacpac update