Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

nicbet/archlinux-x230

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Installation of Arch Linux on Lenovo Thinkpad X230

Introduction

About a week ago, I picked up a beaten up old Lenovo X230 machine with the goal of making this my schlepp-everywhere Linux development box.

Those little laptops are awesome! They support the Linux operating system extremely well, in fact most things work out of the box and reliably, such as sleep, hibernate, attaching external displays, Wifi, keyboard, touchpad, trackpoint, etc. The X230 has a full voltage CPU that’s actually quite beefy and makes the machine very pleasant to develop with.

First thing I did though was toss the built-in 4GB RAM stick and pop in a fresh set of Kingston HyperX SODIMMs. They can be had at Canada Computers for around 80$ and are totally worth the investment - especially when running tons of docker containers and VMs during development.

This git repo records my journey of installing Arch Linux, a running, binaries based Linux distribution that’s quite popular among developers.

Why Arch Linux?

Why Arch? Well I’m a big fan of continuous integration (CI) and continuous delivery (CD) at my workplace so I knew that I wouldn’t want a step-wise released system such as Ubuntu or Fedora.

Don’t get me wrong, they are by no means bad distributions of Linux, in fact they are well preferable for servers where it’s all about repeatability of the environment. In any case, that choice left me with Gentoo or an Arch-based Linux distribution.

I don’t like compiling everything and the kitchen sink from scratch - I’ve done that a decade ago during my undergrad days to learn about all things C++, make and optimization, but boy is it a time sucker! I need to be productive. Fast! That really only left me with Arch Linux. I dabbled with Manjaro, but in the end decided to go pure Arch for the power of choice. Here we go!

Hardware

General

  • Intel i5 3360M with vPro
  • Upgraded to 16GB RAM SODIMM DDR3L PC12800 CL9 204 Pin Kingston HyperX (Model HX316LS9IBK2/16)
  • 9 Cell Battery Genuine Lenovo 44++
  • Intel SSD 530 Series SATA 120GB

Output of lspci

  • 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
  • 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
  • 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
  • 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
  • 00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)
  • 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
  • 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
  • 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
  • 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
  • 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
  • 00:1f.0 ISA bridge: Intel Corporation QM77 Express Chipset LPC Controller (rev 04)
  • 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
  • 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
  • 02:00.0 System peripheral: Ricoh Co Ltd PCIe SDXC/MMC Host Controller (rev 07)
  • 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)

BIOS Settings

Main

UEFI Bios VersionG2ET99WW (2.59)
UEFI Bios Date2013-12-04
Embedded Controller VersionG2HT34WW (1.13)
CPU TypeIntel Core i5 3360M
CPU Speed2.80 GHz
Installed Memory16,384MB
UEFI Secure BootOff

Config

Network

Wake on LANAC Only
UEFI IPv4 Network StackEnabled
UEFI IPv6 Network StackEnabled
UEFI PXE Boot PriorityIPv4 First

USB

USB UEFI BIOS SupportEnabled
Always on USBEnabled
Always on USB Charge in Off ModeDisabled
USB 3.0 ModeAuto

Keyboard / Mouse

TrackpointEnabled
Touch PadEnabled
Fn and Ctrl Key SwapDisabled
Fn Key LockDisabled

Display

Boot Display DeviceThinkPad LCD

Power

Intel Speedstep TechnologyEnabled
Mode for ACMaximum Performance
Mode for BatteryBattery Optimized
Adaptive Thermal Management
Scheme for ACMaximize Performance
Scheme for BatteryBalanced
Optical Drive SpeedNormal
CPU Power ManagementEnabled
PCI Express Power ManagementEnabled
Express Card SpeedAutomatic
Power On with AC AttachDisabled
Intel Rapid Start TechnologyEnabled
Entry After30 Minutes

Beep and Alarm

Password BeepDisabled
Keyboard BeepEnabled

Serial ATA

SATA Controller Mode OptionAHCI

CPU

Core Multi-ProcessingEnabled
Intel Hyper-Threading TechnologyEnabled

Intel AMT

Intel AMT ControlDisabled

Security

Password

Hardware Password ManagerEnabled
Supervisor PasswordEnabled
Lock UEFI Bios SettingsEnabled
Password at unattended BootEnabled
Password at restartEnabled
Power-On PasswordEnabled
Hard-Disk PasswordEnabled

Fingerprint

Predesktop AuthenticationEnabled
Reader PriorityExternal -> Internal
Security ModeNormal

Security Chip

Security ChipActive
BIOS ROM Strings ReportingDisabled
CMOS ReportingDisabled
NVRAM ReportingDisabled
SMBIOS ReportingDisabled
Intel TXT FeatureDisabled
Physical Presence for ProvisioningDisabled
Physical Presence for ClearEnabled

UEFI Bios Update Option

Flash BIOS Updating by End-UsersEnabled
Secure Rollback PreventionDisabled

Memory Protection

Execution PreventionEnabled

Virtualization

Intel Virtualization TechnologyEnabled
Intel VT-d FeatureEnabled

I/O Port Access

Ethernet LANEnabled
Wireless LANEnabled
WiMAXEnabled
Wireless WANEnabled
BluetoothEnabled
USB PortEnabled
ExpressCard SlotDisabled
UltrabayEnabled
eSATA PortEnabled
Memory Card SlotEnabled
Integrated CameraEnabled
MicrophoneEnabled
Fingerprint ReaderEnabled

Anti-Theft

Intel AT Module ActivationDisabled
Intel AT Module StateNot Activated
CompuTrace Module ActivationDisabled
CompuTrace Module StateNot Activated

Secure Boot

Secure BootDisabled
Platform ModeUser Mode
Secure Boot ModeStandard Mode

Startup

Network BootPCI LAN
UEFI/Legacy BootUEFI Only
CSM SupportYes
Boot ModeQuick
Option Key DisplayEnabled
Boot Device List F12 OptionEnabled
Boot Order LockDisabled

Creating USB Boot Media

Download the arch-XXX-dual.iso image from http://www.archlinux.org

Using Mac OS X

  1. Open a terminal
  2. Find USB drive diskutil list
  3. Write image sudo dd if=archlinux.img of=/dev/rdiskX bs=1m

Base Installation

Boot from USB

  • Ensure Secure Boot is disabled in the BIOS.
  • Hit ENTER on BIOS prompt, hit F12, select USB drive.
  • In the menu, select Arch Linux UEFI.

Connect to Network

Either plug in the Ethernet cable, or to get access via WiFi, run wifi-menu command and follow the prompts.

Partitioning

We will use the following partition layout using the parted and gdisk commands:

  • 512MB partition for EFI, formatted fat32, mounted to /boot
  • 40GB partition for OS, formatted ext4, mounted to /
  • 60GB partition for User, formatted ext4, mounted to /home
  • 16GB partition for Intel Rapid Start, labeled GUID=D3BFE2DE-3DAF-11DF-BA40-E3A556D89593

Note that we will not create a swap partition in this system, since 16GB of RAM are plenty and anything beyond that we can more easily handle with swap files anyway. Instead we will use the Intel Rapid Start firmware of our i5 vPro chip to implement a BIOS based suspend to hibernate. It is also entirely possible to implement a software based suspend to hibernate on this system via a swap partition.

Preparation

  • Check which block devices are available in the system using the lsblk command. Usually the SSD is /dev/sda.
  • Start the partition editor with parted /dev/sdX, where X is the correct block device name.
  • In parted create a GPT partition table on the block device. THIS WILL DESTROY ALL DATA ON THE DEVICE!
mklabel gpt

For the EFI Partition

  • In parted run to create a UEFI partition of type EFI System Partition (ESP), formatted to fat32 filesystem with a size of 512 MB.
(parted) mkpart ESP fat32 1MiB 513MiB
  • In parted set the boot flag on the ESP partition.
(parted) set 1 boot on

For the OS Partition

In parted run to allocate 40GB space and formatted to an ext4 filesystem.

(parted) mkpart primary ext4 513MiB 40GiB

For the Home Partition

In parted run to allocate 100GB space and formatted to an ext4 filesystem.

(parted) mkpart primary ext4 40GiB 100GiB

For the Intel Rapid Start Partition

Run gdisk /dev/sdX where X is the correct block device name. Once in gdisk we will run the following commands in order:

  • p to print the partition table. The output of this command should say 16.5GiB of free space available on the 128GB SSD drive.
  • n to create a new partition. Since we only have 16.5GB free space at the very end of the disk, we can hit ENTER on all questions until we see info about HEX code or GUID.
  • Enter D3BFE2DE-3DAF-11DF-BA40-E3A556D89593 as the GUID for this partition.
  • Finish with w and Y to write these changes to disk.

Create the Filesystems

Next, we need to format the partitions created in the previous step. I assume that you block device is /dev/sda and that the partitions were created as above.

mkfs.fat -F32 /dev/sda1
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3

Mount the Partitions

Now it’s time to mount our OS, Home and Boot Partitions. First we mount root.

mount /dev/sda2 /mnt

Next, we create a directory boot and mount our ESP partition to it.

mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot

Now, we create a directory home and mount our Home partition to it.

mkdir -p /mnt/home
mount /dev/sda3 /mnt/home

We are all set to proceed the installation and install the base system files.

Install System Files

With all the partitions mounted in place, we will now continue to install Arch Linux on the system. We install the base and base-devel collections:

pacstrap -i /mnt base base-devel

After all packages are installed, we generate an fstab file. Here the -U flag asks the generator to use partition UUIDs instead of kernel device names.

genfstab -U /mnt > /mnt/etc/fstab

Next, we switch into our new system and finish the installation there.

arch-chroot /mnt /bin/bash

First, we setup the system language:

nano /etc/locale.gen

In this file, find the line that corresponds to your language preference. Mine is US English with UTF-8 character support, aka en_US.UTF-8. After editing, we let the system generate the locale files.

locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8

Next, we configure the system time:

tzselect

We also create a symbolic link, for me the selected time zone was America/Toronto

ln -s /usr/share/zoneinfo/America/Toronto /etc/localtime

Finally, we will use the hardware clock for our system, which expects the clock to be set to UTC. This can often mix things up with other Operating Systems such as Windows or Mac OS X, so be careful when multi-booting. Our system is a Linux-exclusive, so no worries there.

hwclock --systohc --utc

Setup Hostname

In the next step, set the hostname for your machine.

echo "my-laptop" > /etc/hostname 

Setup Boot Manager

We are using an UEFI setup, so let’s install grub and the efibootmgr. For multiboot setups, make sure to also install the os-prober package for multiboot support. We don’t need this for our machine.

pacman -S grub efibootmgr

Now let’s setup grub, our Boot partition was mounted earlier under /mnt/boot which in the change root environment becomes /boot:

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub
grub-mkconfig =o /boot/grub/grub.cfg

Add a User

First things first! Let’s set a password for our root user account before we proceed!

passwd

Next, we will go ahead an add a regular user account that we will use in our day-to-day activities. I picked nicbet for my username, you can pick your own!

useradd -m -G wheel,users -s /bin/bash nicbet
passwd nicbet

We added the user to the wheel group. This is a special group that will allow our user to execute administrative commands using the sudo tool. For this to work we will have to allow the wheel group to execute sudo commands. The safest way to do this is via the visudo command.

pacman -S sudo
EDITOR=nano visudo

Find and uncomment the line

%wheel ALL=(ALL) ALL

Install First Boot Essentials

Before we can exit out of our change root environment and start our fresh system for the first time, we need to install some essentials while we are still booted from the USB and have a working network connection. The wifi-menu command we ran earlier to get our Wifi connection working was installed as part of the base packages, however, for it to function, we need the dialog and the wpa_supplicant dependencies.

pacman -S iw wpa_supplicant dialog

Boot the new System

We are ready to boot our new system! First we exit out of the change root environment.

exit

Next, we unmount all partitions:

umount /mnt/home
umount /mnt/boot
umount /mnt

And finally shutdown the system:

shutdown -h now

Once the shutdown is completed, remove the USB Boot Media and power on the new system.

Kernel Modules

Power

Desktop Environment

Tweaks

Fish Shell

Powersaving

Automatically power down audio card

Add the following line to /etc/modprobe.d/audio_powersave.conf:

options snd_hda_intel power_save=1

Fingerprint Reader

Touchpad

Gnome3

Intel Wifi

  • Create file /etc/modprobe.d/iwlwifi.conf
  • Insert lines
options iwlwifi 11n_disable=1
options iwlwifi swcrypto=1

About

Arch Linux on Thinkpad X230

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published