Easiest Arch Linux Manual

0

How to create MBR partition table

There are many tools to perform the task of creating the partition table, I will use ‘Parted’ for this article. Find the block device name with ‘lsblk’ command:

NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda              8:0    0 111.8G  0 disk

In my case the block device, or SSD on which I will be installing Arch Linux, is ‘/dev/sda’

We are using the ‘Parted’ tool to create the partition table. Run the ‘parted’ command against the block device, which in my case is ‘/dev/sda’.

# parted /dev/sdX

Replace ‘sdX’ with your block device name, in my case it was:

# parted /dev/sda

In the command line, you will notice that ‘#’ is replaced with ‘(parted)’, which means you are running the parted command. We have to first create a partition table with msdos (MBR).

(parted) mklabel msdos

It will warn you about destroying all data. Type Yes. Let’s create root and then swap using the following pattern:

(parted) mkpart part-type fs-type start end

For root, the part-type will be primary; the file system will be ext4. As you can see the start point is 1MB and end point is 40GB, which means it will create a 40GB partition. I am giving 40GB to root because I don’t create a separate home partition, it’s created inside the root partition. I gave

(parted) mkpart primary ext4 1MiB 40GiB

Now we will set boot flag on it:

(parted) set 1 boot on

Once the root partition is created, we will create the swap partition. For swap the file system will be ‘linux-swap’ and the end point for the previous partition will become the start point for next partition:

(parted) mkpart primary linux-swap 40GiB 42GiB

I am creating 2GB of swap because I have over 32GB of RAM on this system and I really don’t need any swap partition. If you have a good amount of RAM, you don’t really need swap. However, you do need it if you use ‘suspend to memory’ feature which I doubt anyone uses these days.

If you want, you can create more partitions, just use the same pattern. Just bear that end point of the previous partition is the start point for the next partition. If you want to use all of the remaining free space then used 100% as the end point.

An example:

(parted) mkpart primary ext4 42GiB 100%

This will create another partition with remaining free space.

Check if the partitions are created correctly by running the ‘print’ command:

(parted) print

If everything looks good, exit ‘parted’ tool with ‘quit’ command:

(parted) quit

0

How to convert users to Linux

Previous article

How to add an external hard drive to PlayStation 4

Next article