Archlinux Install (Updated for 2017)

Back in 2012, a colleague Justin Caningon wrote an Archlinux installation guide. I thought it would be a good time to update this guide for 2017.

I’ve been playing around with PCIx passthrough with KVM and OVMF lately and decided it was time to write another guide.

 

1. Download the distro.

Hop over to here and grab the latest ISO of arch.

Get a USB drive thats at least the size of the ISO. At the time of writing the arch ISO is 500mb.

 

2. Prepare the USB for booting into arch for installation.

Arch is such a well documented distribution, that we can head over here to get the commands for prepping that flash drive.

I am using OSX to do this, and it goes like this:

a. Put the flash drive in the machine.
b. Open disk utility.
c. Eject the mounted partition of the flash drive.
d. Open the terminal app.
e. Type ‘diskutil list’. To find out which drive you will be working with.
f. Issue ‘ dd bs=4m if=/path/to/archlinux.iso of=/dev/diskx
g. Wait a few minutes for this to complete, and then put it in the machine to have arch installed on it.

 

3. Boot the machine into the Arch Linux installation live OS.

Select the USB you just created to boot from and you’ll get the arch boot menu.

 

 

 

Archlinux

 

You’ll want to select the ‘Boot Arch Linux (x86_x64).

This will drop you right into a shell.

Screen Shot 2017-03-08 at 10.18.10 AM

 

From here we can begin installing arch.

 

4. Partition the disks.

We want to find out where to install this. I’ve got 7 SSDs and 1 PCIx M2 drive.

‘fdisk’ will give me a listing of the disks on the system. Since I have so many, I am going to issue ‘fdisk -l | more’.

Your’e going to get a whole lot of output here. Its up to you to find the right disk. Typically this is best found looking at the size of the disk in question.

Once you’ve found it, lets partition the disks.

 

We’re going to use ‘cfdisk’ to create our installation. I am going to use my 480GB PCIx drive for this installation. Partitions will look thus:

/dev/sda1 15GB installation of archlinux
/dev/sda2 2x RAM swap disk (ive got 128GB of RAM here, so this will be 256GB)
/dev/sda3(5) ext partition holding the user data

so type in ‘cfdisk /dev/sd(x)’. In my system, the PCIx drive is /dev/sdk.

You’ll get this menu

Screen-Shot-2017-03-08-at-10.35.37-AM

 

 

Were going to create the partitions using the lower menu so it looks like this:

Screen-Shot-2017-03-08-at-10.37.50-AM

 

The sdk1 and sdk2 partitions are primary partitions.
The sdk3 partition is an extended  partition.
Make sure you mark sdk1 as bootable.

Write out and remember to type out ‘yes’ to get the writes in.
Then quit and well get on to making file systems.

 

5. Make the filesystems on the newly partitioned disks.

We’re going to use ext4 on sdk1 and sdk5.
Then we will make the sdk2 a swap.

We’ll use ‘mkfs.ext4′ on the /dev/sdk1 and sdk5:

Screen-Shot-2017-03-08-at-10.43.34-AM

Follow this procedure on /dev/sdk5.

 

Next we’ll make the swap partition.

Screen-Shot-2017-03-08-at-10.55.09-AM

 

‘mkswap’ and ‘swapon’ are the key commands here.

 

6. Mount the new partitions and install arch linux.

Well use the ‘mnt’ command to mount these partitions into the /mnt directory.

Screen-Shot-2017-03-08-at-12.12.46-PM

 

This will mount up those partitions to the /mnt directory so that we can install arch into that drive.

 

Next, well install Arch.

Here well use ‘pacstrap’ to bring all the installation media from the internet.

We will ‘pacstrap ‘base’ and ‘base-devel’ into the system.

Screen-Shot-2017-03-08-at-12.17.14-PM

 

This step will take quite a while depending on your internet connection. Sit back and relax while this runs through.

 

7. Prep the new system

a) Generate the fstab on the new system.

‘genfstab /mnt >> /mnt/etc/fstab’ will be the command of choice here.

b) Session into the new installation with

‘arch-chroot /mnt /bin/bash’

c) Edit the /etc/locale.gen file and add the line ‘en_US.UTF-8 UTF-8′, or if youre out of the US, add/uncomment your locale.
Then generate the locale file with ‘locale-gen’.

Screen-Shot-2017-03-08-at-12.29.57-PM

d) Edit the /etc/locale.conf and add the line ‘LANG=en_US.UTF-8′. Quit and save that file.

e) Next we’ll set the local timezone. You can list the timezones with ‘ls /usr/share/zoneinfo’.
I am in San Francisco, so I am going to use ‘/usr/share/zoneinfo/America/Los_Angeles’ for PST.
The way we set the local time is through this command. ‘
ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime’
Mine was there already so I had to remove the existing /etc/localtime directory.

f) Sync the clock to UTC with this command, ‘ hwclock –systohc –utc’

g) Change your password with ‘passwd’

h) Next we’ll install GRUB with ‘pacman -S grub os-prober‘,  ‘grub-install /dev/sdk1‘, and ‘grub-mkconfig -o /boot/grub/grub.cfg

Screen-Shot-2017-03-08-at-1.38.28-PM

Screen-Shot-2017-03-08-at-1.41.57-PM

Screen-Shot-2017-03-08-at-1.43.36-PM

Once you have done this, you can ‘exit’ and unmount the mounted drives.
A reboot will bring you into the installation. Don’t forget to remove that USB drive.


Archlinux Install (Updated for 2017)

Back in 2012, a colleague Justin Caningon wrote an Archlinux installation guide. I thought it would be a good time to update this guide for 2017. I’ve been playing around with PCIx passthrough with KVM and OVMF lately and decided it was time to write another...

Adding Passthrough Physical Disk in KVM Guests

I found myself needing to add a physical disk thats installed on a KVM host on to one of its guests. Although this is not always advised, it can be helpful in data recovery scenarios. Find which disk you want to add by using ‘fdisk -l’, looking at the...

Part 3.[PSGet-Counter] The Powershell Get-Counter cmdlet

Part 1.[Overview] ElasticSearch, Kibana, Logstash, and Windows Metrics over PowerShell TCP Connections Part 2.[PSJSON] The Powershell JSON TCP Connection Part 3.[PSGet-Counter] The Powershell Get-Counter cmdlet In the github repo, let’s take a look at the actual...

Part 2.[PSJSON] The Powershell JSON TCP Connection

Part 1.[Overview] ElasticSearch, Kibana, Logstash, and Windows Metrics over PowerShell TCP Connections Part 2.[PSJSON] The Powershell JSON TCP Connection Part 3.[PSGet-Counter] The Powershell Get-Counter cmdlet The JSON TCP connection is as follows: Function...

SuperMicro Server + CentOS 6.6 Kernel / PCIe Power

I recently had a bare metal SuperMicro server which was running an installation of CentOS 6.6. There was an issue with it where the NIC would randomly stop working. There seems to be an issue with PCIe Active State Power Management in some Linux Kernels...

Upgrading a Ubiquiti Unifi Controller on CentOS

In a previous post, I ran over how to install the UniFi controller on CentOS. In this post, I will show how to upgrade the installation, as they upgrade their software, you can follow along in the RHEL world. Download the Update Download the release from the UniFi...

Installing and Working With CentOS 7 x64 and KVM

Section A: Installing KVM on Centos 7 x64 Minimal Checking for Virtualization Support Just to be clear, we’ll need to check for virtualization support; that it is enabled in the BIOS and also enabled on kernel. To check if the kernel has virtualization support,...

Shinken/Nagios/Check_WMI_Plus Filtering

So I have a few windows servers getting checked with CHECK_WMI_PLUS. I am using Shinken as the service instead of Nagios. When using the Windows Pack I was frustrated because part of the checks are looking to services that are set to AUTO and reporting an error if...

Ubiquiti Unifi Controller In A Layer 3 Environment

I have got three fancy new UAP-AC-PRO units and I needed to get these across a layer 3 network. My controller actually sits at another site, and I wanted to have a single controller VM with a wide workload of APs around the buildings. Setting up the layer 3 is...

Centos 7 NetInstall Mirror

Centos 7 doesnt have a minimal build up yet (so sad!). But we can get this minimal installation by using the netinstall image and setting our URL to http://mirror.centos.org/centos/7/os/x86_64/ Happy centOSing.

WordPress ‘The uploaded file could not be moved to’ …

I recently moved a WordPress installation from Apache to Nginx on a different host. Each were running CentOS. The Nginx configuration was a little different due to the use of PHP-FPM. When I attempted to upload any files to the clients server via the WordPress web...

Using a USB/Serial with OSX and Screen

I’ve been using a Mac for quite a while as a systems administrator/network administrator. I don’t run into many people that use OSX for their daily machines as administrators, but I think that OS androgyny is more ubiquitous, so I think its apt to write an...

ESXi 5.1 SNMP Service Starting Failure

When you look up how to change the SNMP community for ESXi 5.1, VMWare has an article that displays the command to change the community of the SNMP service via the esxcli command. But when you attempt to actually start the service in the GUI, you get this error: This...