Skip to content

Instantly share code, notes, and snippets.

@Myl0g
Last active January 9, 2018 23:26
Show Gist options
  • Save Myl0g/aaa8da8eb62e1b7a9b87a95e9f47d96b to your computer and use it in GitHub Desktop.
Save Myl0g/aaa8da8eb62e1b7a9b87a95e9f47d96b to your computer and use it in GitHub Desktop.

Beginning

Download the ISO.

If you're installing to a flash drive, download VirtualBox and the Extension Pack to make the process easier.

Preparing the ISO

Burn the ISO to a flash drive with Etcher.

If you're using VirutalBox, make a new Virtual Machine with all the default options. You'll bind it to the ISO shortly.

Booting the ISO

Follow the instructions for your specific device to boot to another drive. For Mac, you'd restart, and when you hear the startup chime, press and hold Option, selecting the flash drive when the screen appears.

For VirtualBox, try to Start the virtual machine. You'll see a dialog, and a choice within that dialog. Press the folder icon to the right of that choice, and then choose the ISO.

Choose "Boot Arch Linux" at the screen which results.

Preparing the Destination Disk

What happens next depends on the device you'll be booting Arch Linux off of.

Enter the command sfdisk -l to see the avaliable disks. Make sure you choose the correct one (e.g. by looking at space capacity), or you'll lose the data on the wrong disk. Remember the disk ID (e.g. /dev/sda).

BIOS-based Computers

Most Windows computers are BIOS-based.

  • Run the command cfdisk, with a space followed by your disk ID. Use the Up and Down arrows to move over the "dos" option, then hit Enter.
  • Hit Enter on the "Free Space" to create a new partition.
  • Use a desired amount (G = gigabytes, M = megabytes, etc.), and hit Enter. Then use the Left/Right keys to select "Bootable". Hit Enter.
  • Select the option "Write". Type in "yes" to confirm and write the disks.
  • Select the option "Quit".

Remember the partition ID (e.g. /dev/sda1) for later use.

Use the command mkfs.ext4 followed by a space and your partition ID (e.g. /dev/sda1).

Do mount <your partition ID here, without brackets> /mnt to mount the new partition to the folder /mnt.

UEFI-based Computers

Macintosh computers and some Windows computers are UEFI-based.

  • Run the command cfdisk, with a space followed by your disk ID. Use the Up and Down arrows to move over the "gpt" option, then hit Enter.
  • Hit Enter on the "Free Space" to create a new partition.
  • Enter in "512M", and hit Enter. Then use the Left/Right keys to select "Type". Select the type "EFI system" and hit Enter.
  • Repeat the above step for another partition, this time for any size you'd like (the main partition).
  • Select the option "Write". Type in "yes" to confirm and write the disks.
  • Select the option "Quit".

Remember the partition IDs of the two new partitions, and which one's which (e.g. /dev/sda1).

Run mkfs.fat -F32 followed by a space and the partition ID of the one you labeled EFI system.

Run mkfs.ext4 followed by a space and the partition ID of the main partition.

Use mount <main partition ID, without brackets> /mnt to mount the main part to the folder /mnt.

Use mount <EFI partition ID, without brackets> /mnt/boot to mount the EFI part to the boot folder.

Install the Base System

This step requires an Internet connection. If you don't have Ethernet, the easiest option by far is to tether a cellular-capable phone into your computer (on iOS, enable Personal Hotspot and then just plug it in).

If you are running a Virtual Machine, you already have Internet.

Run pacstrap /mnt base base-devel to download and install all the necessary packages for your Arch system.

Generate your FSTAB by running genfstab -U /mnt > /mnt/etc/fstab.

To enter your new system, run arch-chroot /mnt.

Configure Booting

BIOS Systems

Use pacman -S grub os-prober to install the GRUB bootloader.

Run grub-install --recheck <your disk ID, without the brackets>.

Run grub-mkconfig -o /boot/grub/grub.cfg to make the config file.

UEFI Systems

Install the systemd bootloader with bootctl install.

Make a new boot entry with nano /boot/loader/entries/arch.conf. Enter in the following:

title   Arch Linux
linux   /vmlinuz-linux
initrd  /initramfs-linux.img
options root=<main partition ID, without brackets> rw

Set the default entry with nano /boot/loader/loader.conf. Enter in:

timeout 3
default arch

The Rest of It

Use this diagram from Reddit to keep going. Start at the second column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment