- 1 Prepare the storage devices
Prepare the storage devices
In this step, the storage devices that will be used by the new system will be prepared. Read Partitioning for a more general overview.
Identify the devices
The first step is identify the devices where the new system will be installed. The following command will show all the available devices:
This will list all devices connected to your system along with their partition schemes, including that used to host — and boot — the live Arch installation media (e.g. a USB drive). Not all devices listed will therefore be viable or appropriate mediums for installation. To filter out inappropriate results, the command can optionally be amended as follows:
# lsblk | grep -v "rom\|loop\|airoot"
Devices (e.g. hard disks) will be listed as
x is a lower-case letter starting from
a for the first device (
b for the second device (
sdb), and so on. Existing partitions on those devices will be listed as
Y is a number starting from
1 for the first partition,
2 for the second, and so on. In the example below, only one device is available (
sda), and that device uses only one partition (
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 80G 0 disk └─sda1 8:1 0 80G 0 part
sdxY convention will be used in the examples provided below for partition tables, partitions, and file systems. As they are just examples, it is important to ensure that any necessary changes to device names, partition numbers, and/or partition sizes (etc.) are made. Do not just blindly copy and paste the commands.
If the existing partition scheme needs not be changed, skip to #Create filesystems, otherwise continue reading the following section.
Partition table types
If you are installing alongside an existing installation (i.e. dual-booting), a partition table will already be in use. If the devices are not partitioned, or the current partitions table or scheme needs to be changed, you will first have to determine the partition tables (one for each device) in use or to be used.
There are two types of partition table:
Any existing partition table can be identified with the following command for each device:
# parted /dev/sdx print
For each device to be partitioned, a proper tool must be chosen according to the partition table to be used. Several partitioning tools are provided by the Arch installation medium, including:
Using parted in interactive mode
All the examples provided below make use of parted, as it can be used for both BIOS/MBR and UEFI/GPT. It will be launched in interactive mode, which simplifies the partitioning process and reduces unnecessary repetition by automatically applying all partitioning commands to the specified device.
In order to start operating on a device, execute:
# parted /dev/sdx
You will notice that the command-line prompt changes from a hash (
(parted): this also means that the new prompt is not a command to be manually entered when running the commands in the examples.
To see a list of the available commands, enter:
When finished, or if wishing to implement a partition table or scheme for another device, exit from parted with:
After exiting, the command-line prompt will change back to
Create new partition table
If you want to start from scratch — and do not intend to keep existing partitions on a device — its existing partition table can be completely erased. This simplifies the creation of new partitions and avoids problems if converting disks from MBR to GPT or vice versa. Use the following command:
# sgdisk --zap-all /dev/sdx
Now open each device whose partition table must be (re)created with:
# parted /dev/sdx
To then create a new MBR/msdos partition table for BIOS systems, use the following command:
(parted) mklabel msdos
To create a new GPT partition table for UEFI systems instead, use:
(parted) mklabel gpt
You can decide the number and size of the partitions the devices should be split into, and which directories will be used to mount the partitions in the installed system (also known as mount points). The mapping from partitions to directories is the partition scheme, which must comply with the following requirements:
- At least a partition for the
/(root) directory must be created.
- Depending on the motherboard's firmware interface, the chosen #Partition table type, and in some cases also the chosen boot loader, the following additional partitions will must be created:
In the examples below it is assumed that a new and contiguous partitioning scheme is applied to a single device. Some optional partitions will also be created for the
/home directories: see also Arch filesystem hierarchy for an explanation of the purpose of the various directories; if separate partitions for directories like
/home are not created, these will simply be contained in the
/ partition. Also the creation of an optional partiton for swap space will be illustrated.
If not already open in a parted interactive session, open each device to be partitioned with:
# parted /dev/sdx
The following command will be used to create partitions:
(parted) mkpart part-type fs-type start end
part-typeis one of
logical, and is meaningful only for MBR partition tables.
fs-typeis one of the supported file systems listed in the manual. The partition will be properly formatted in #Create filesystems.
startis the beginning of the partition from the start of the device. It consists of a number followed by a unit, for example
1Mmeans start at 1MiB.
endis the end of the partition from the start of the device (not from the
startvalue). It has the same syntax as
start, for example
100%means end at the end of the device (use all the remaining space).
The following command will be used to flag the partition that contains the
/boot directory as bootable:
(parted) set partition boot on
partitionis the number of the partition to be flagged (see the output of the
For a minimum single primary partition using all available disk space, the following command would be used:
(parted) mkpart primary ext3 1M 100% (parted) set 1 boot on
In the following instance, a 20Gib
/ partition will be created, followed by a
/home partition using all the remaining space:
(parted) mkpart primary ext3 1M 20G (parted) set 1 boot on (parted) mkpart primary ext3 20G 100%
In the final example below, separate
/ (20Gib), swap (4GiB), and
/home (all remaining space) partitions will be created:
(parted) mkpart primary ext3 1M 100M (parted) set 1 boot on (parted) mkpart primary ext3 100M 20G (parted) mkpart primary linux-swap 20G 24G (parted) mkpart primary ext3 24G 100%
In every instance, a special bootable EFI System Partition is required.
If creating a new EFI System Partition, use the following commands (the recommended size is 512MiB):
(parted) mkpart ESP fat32 1M 513M (parted) set 1 boot on
The remaining partition scheme is entirely up to you. For one other partition using 100% of remaining space:
(parted) mkpart primary ext3 513M 100%
/ (20GiB) and
/home (all remaining space) partitions:
(parted) mkpart primary ext3 513M 20.5G (parted) mkpart primary ext3 20.5G 100%
And for separate
/ (20GiB), swap (4Gib), and
/home (all remaining space) partitions:
(parted) mkpart primary ext3 513M 20.5G (parted) mkpart primary linux-swap 20.5G 24.5G (parted) mkpart primary ext3 24.5G 100%
Once the partitions have been created, each must be formatted with an appropriate file system. All available partitions on the intended installation device can be listed with the following command:
# lsblk /dev/sdx
With the exceptions noted below, it is recommended to use the
ext4 file system:
# mkfs.ext4 /dev/sdxY
If a swap partition has been created, it must be set up and activated with:
# mkswap /dev/sdxY # swapon /dev/sdxY
See Swap#Swap file for an alternative.
Mount the partitions
/ (root) partition must be mounted first: this is because any directories such as
/home that have separate partitions will have to be created in the root file system. The
/mnt directory of the live system will be used to mount the root partition, and consequently all the other partitions will stem from there. If the root partition's name is
# mount /dev/sdxR /mnt
/ partition has been mounted, any remaining partitions may be mounted in any order. The general procedure is to first create the mount point, and then mount the partition to it. If using a separate
# mkdir -p /mnt/boot # mount mount /dev/sdxB /mnt/boot
If using a separate
# mkdir -p /mnt/home # mount mount /dev/sdxH /mnt/home
Once all the remaining partitions, if any, have been mounted, the devices are ready to install Arch.