Skip to content

3.Partitionning

Julien Chappuis edited this page May 21, 2023 · 5 revisions

Pre-installation

This part follows closely the Arch wiki Installation Guide, and covers the part called Pre-installation link in the wiki.

The goal is to have an Arch setup environment properly configured to execute the installation.

Keyboard

ls /usr/share/kbd/keymaps/**/*.map.gz  # (1)
loadkeys us-acentos.map.gz # (2)
  1. lists all possible keymap values

  2. I configure all my QWERTY keyboards as US-International with dead keys to enable easy en/fr typing

Verify that the PC booted in EFI mode

efivar -l # (1)
  1. should output a lot of EFI variables

(Laptop) Connect to the wireless network

laptop
wifi-menu
  • confirm the name of the profile

  • select the wifi network

  • type the wifi password

Verify that internet works

ping -c 3 www.google.com

Set the timezone

timedatectl set-ntp true
timedatectl list-timezones | grep <city>  # (1)
timedatectl set-timezone Europe/Zurich   # (2)
timedatectl status
  1. find the timezone for your <city>

  2. Grüezi mitenand! 🇨🇭

Disk partitioning

It is always assumed that Windows has been installed before Linux.

References

Workstation - dual drive setup

workstation

In this setup, the OS selection is done at boot time via the EFI bios : F8 during startup, and selecting the right disk. This is thus a dual bootloader dual boot. This setup prevents any OS from messing up with the other one (I am looking at you Windows 10).

List of drives on my workstation

workstation
Table 1. Table List of drives
Capacity Model Name Device path OS Usage

931.51 GiB

Crucial SSD MX200 1TiB SATA

Disk 0

/dev/sda

Windows

Data

931.51 GiB

Samsung SSD 860 EVO 1TiB SATA

Disk 1

/dev/sdb

Windows

/Videos2

1863 GiB

Samsung SSD 980 Pro 2Tib M2.2280 NVME

Disk 2

/dev/nvme0n1

Windows

Videos

931.50 GiB

Samsung SSD 990 Pro 2Tib M2.2280 NVME

Disk 3

/dev/nvme1n1

Windows

OS

931.50 GiB

Samsung SSD 990 Pro 2Tib M2.2280 NVME

Disk 4

/dev/nvme2n1

Linux

OS

Linux Partition tables

workstation

My workstation has 64GiB of ram, so I am using 64GiB of swap size. This is probably overkill 😃

Table 2. Partition table for the main Arch drive
Linux Path Size Type Usage

/dev/nvme2n1p1

2048MiB

EFI System - ef00

/boot

/dev/nvme2n1p2

64GiB

Linux Swap - 8200

swap

/dev/nvme2n1p3

(128Gio)

Linux Filesystem - 8300

/

/dev/nvme2n1p4

(500Gio)

Linux Filesystem - 8300

/home

/dev/nvme2n1p5

(~1.1Tio)

Linux Filesystem - 8300

/projects

Check current disks and partitions

workstation
lsblk # (1)
lsblk -o name,size,type,mountpoints,vendor,model,label,partuuid
fdisk -l # (2)
  1. shows an overview as a tree

  2. shows a high level partition table for each disk

Create the partitions for the main Arch drive

workstation
Wipe existing partitions for the main Arch drive
workstation
gdisk /dev/nvme2n1
  • X then Z then confirm with Y, Y

Setup the new partition table structure for the main Arch drive

workstation

This follows exactly the partition structure given in the tables above.

cgdisk /dev/nvme2n1
  • Confirm warning with Enter

  • Create boot partition (/dev/nvme2n1p1)

    • Select free space, choose new option

    • Enter (to set first sector)

    • 2048M (for end sector)

    • ef00 (partition type = EFI system)

    • boot (partition name)

  • Create swap partition (/dev/nvme2n1p2)

    • Select free space (the large one), choose new option

    • -64G (to set first sector, starting from the end)

    • Enter (default value for end sector)

    • 8200 (partition type = Linux swap 8200)

    • swap (partition name)

  • Create root partition (/dev/nvme2n1p3)

    • Select free space (the large one), choose new option

    • Enter (default value for first sector)

    • 128G (to set the end sector)

    • Enter (partition type = Linux Filesystem 8300)

    • root (partition name)

  • Create home partition (/dev/nvme2n1p4)

    • Select free space (the large one), choose new option

    • Enter (default value for first sector)

    • 500G (to set the end sector)

    • Enter (partition type = Linux Filesystem 8300)

    • home (partition name)

  • Create projects partition (/dev/nvme2n1p5)

    • Select free space (the large one), choose new option

    • Enter (default value for first sector)

    • Enter (default value for end sector)

    • Enter (partition type = Linux Filesystem 8300)

    • projects (partition name)

  • Select write

  • Confirm by typing yes

  • Select quit

Format the partitions

workstation
mkfs.fat -F32 /dev/nvme2n1p1 # (1)
mkfs.ext4 /dev/nvme2n1p3 -L ArchLinux # (2)
mkfs.ext4 /dev/nvme2n1p4 -L Home # (3)
mkfs.ext4 /dev/nvme2n1p5 -L Projects # (4)
mkswap /dev/nvme2n1p2 -L Swap # (5)
swapon /dev/nvme2n1p2 # (6)
  1. formats /boot

  2. formats /

  3. formats /home

  4. formats /projects

  5. declares /swap

  6. enables swapping

Verify that the partitions are OK

workstation
lsblk -o name,model,fstype,parttype,mountpoint,label,size,partuuid
  • Standard Linux partition should have parttype 0FC63DAF-8483-4772-8E79-3D69D8477DE4

  • Swap Linux partition should have parttype 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F

Mount the filesystem

workstation
mount /dev/nvme2n1p3 /mnt # (1)

mkdir /mnt/boot # (2)
mount /dev/nvme2n1p1 /mnt/boot

mkdir /mnt/home # (3)
mount /dev/nvme2n1p4 /mnt/home

mkdir /mnt/projects # (4)
mount /dev/nvme2n1p5 /mnt/projects
  1. Mount /

  2. creates the boot mounting point and mounts /boot

  3. creates the data mounting point and mounts /home

  4. creates the data mounting point and mounts /projects

Note
You can proceed to the next section.

(Laptop) Dual boot

laptop

This is a traditional dual boot on one single drive. The linux bootloader offers the OS selection at boot time, and the /boot partition is shared between Linux and Windows.

Important
Windows has to be installed first.
Warning
By default windows boot size is 100mb, which is enough for one linux kernel. You can work around this at Windows setup time by using diskpart to delete the boot partition and create a larger one instead.

List of drives on my laptop

laptop
Table 3. Table List of drives
Capacity Model Name Device path OS Usage

477 GiB

Samsung PM981 SSD 512 GiB NVME

Disk 0

/dev/nvme0n1

Windows + Linux

/ + C:

Partition table (T480s) for the main drive

laptop

My laptop has 16GiB of ram, so I am also using 16GiB of swap.

Table 4. Partition table for the main Arch drive
Linux Path Size Type Usage

/dev/nvme0n1p1

499MiB

Windows recovery environment

/dev/nvme0n1p2

1024MiB

EFI System partition (ef00)

/boot

/dev/nvme0n1p3

16MiB

Windows reserved

/dev/nvme0n1p4

194.7GiB

Microsoft basic data

C: (Windows 10)

/dev/nvme0n1p5

16GiB

Linux Swap 8200

/swap

/dev/nvme0n1p6

50GiB

Linux Filesystem (8300)

/

/dev/nvme0n1p7

*

Linux Filesystem (8300)

/home

Note
the standard EFI partition created by windows is usually 100MiB. I configured it to be 550MiB during the Windows setup.

Check current disks and partitions (T480s)

laptop
lsblk -o name,model,fstype,parttype,mountpoint,label,size,partuuid    #(1)
fdisk -l    #(2)
  1. shows an overview as a tree

  2. shows a high level partition table for each disk

Create the partitions for the main drive

laptop
Warning
Do not wipe the partitions or you will delete Windows

Setup the new partition table structure for the main drive

laptop

This follows exactly the partition structure given in the tables above.

cgdisk /dev/nvme0n1
  • The Windows partition structure will appear, leave it alone.

  • Create swap partition (/dev/nvme0n1p5)

    • Select free space (the large one), choose [new] option

    • -16GiB (to set first sector, from the end of the drive)

    • [Enter] (default value for end sector)

    • 8200 (partition type = Linux swap 8200)

    • swap (partition name)

    • The partition will appear at the end of the list

  • Create root partition (/dev/nvme0n1p6)

    • Select free space (the large one), choose [new] option

    • [Enter] (to set first sector)

    • 50GiB (default value for end sector)

    • [Enter] (partition type = Linux Filesystem 8300)

    • root (partition name)

  • Create home partition (/dev/nvme0n1p7)

    • Select free space (the large one), choose [new] option

    • [Enter] (to set first sector)

    • [Enter] (default value for end sector to use the*remaining size of the disk)

    • [Enter](partition type = Linux Filesystem 8300)

    • home (partition name)

  • Select [write]

  • Confirm by typing yes

  • Select [Quit]

Format the partitions

laptop
mkfs.ext4 /dev/nvme0n1p6 -L ArchLinux       # (1)
mkfs.ext4 /dev/nvme0n1p7 -L JubiHome        # (2)
mkswap /dev/nvme0n1p5 -L Swap               # (3)
swapon /dev/nvme0n1p5                       # (4)
  1. formats /

  2. formats /home

  3. declares /swap

  4. enables swapping

Verify that the partitions are OK

laptop
ls -l /dev/disk/by-partuuid
lsblk -o name,fstype,parttype,mountpoint,label,size,uuid
  • Standard Linux partition should have parttype 0FC63DAF-8483-4772-8E79-3D69D8477DE4

  • Swap Linux partition should have parttype 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F

Mount the filesystem

laptop
mount /dev/nvme0n1p6 /mnt # (1)
mkdir /mnt/home # (2)
mount /dev/nvme0n1p7 /mnt/home
mkdir /mnt/boot # (3)
mount /dev/nvme0n1p2 /mnt/boot
  1. Mount /

  2. creates the home mounting point and mounts /home

  3. creates the boot mounting point and mounts /boot

    • Verify that /mnt/boot contains a folder called EFI (this is the pre-existing Windows bootloader)

What you got so far

Your hardrives are ready for Arch linux installation, which we will cover next.