Boot from an usb
Information for people who want to install Arch Linux on an SSD or harddisk

Before booting from an usb stick you better check your hardware settings. Boot into your hardware settings or BIOS or UEFI settings. Then check following settings. It can have different names and different keyboard shortcuts to reach it.

  • Disable Secure Boot
  • Disable Launch CSM or Legacy Support
  • Set Boot Mode to UEFI
  • Enable USB Boot
  • Set USB Disk as boot priority
Boot from the iso in VB with BIOS

The image above is proof that we are booting with BIOS. The iso will boot up instantly and provide you with a prompt.

MBR or EFI we end up at the same prompt.

pre-installation
Set the keyboard layout
Arch Linux standard boots into an US keyboard layout. Many of us do not have to do anything. Just check the main keyboard keys and see if they all work.

But others need to change for example from qwerty to azerty.

We follow this link on the wiki to test things out:

https://wiki.archlinux.org/index.php/Keyboard_configuration_in_console

We have used this command to have a list of all possible keyboards out there.

Finally I will use this code to have my Belgian azerty keyboard. You choose your keyboard layout.

VErify the boot mode
You can get confirmation with this code :

or

Then you see this message “No such file or directory“.
You booted with BIOS.

Connect to the internet
Normally you will be connected to the internet out of the box.

On virtualbox you will ALWAYS be connected IF your host computer has internet.

We test our internet connection via

I added “-c 4”. Now it will only ping 4 times.

We can ask also some more information about our interface with

The name of your ethernet (or wifi) interface is important to know. In my case enp0s3.
You will need it later in conkies etc.

Your DHCP server (mostly a router) has provided you with all the information you need to go on the net :

  • Ipaddress for your pc
  • Subnetmask
  • Gateway ipaddress
  • Nameserver to resolve the names into an ipaddress
UPDATE THE SYSTEM CLOCK
We tell our computer to sync the date and time. At this point we do NOT say what timezone we are in.
Partition the disks
This is the most dreaded part and it is also the topic of much debate online.
What tool to use?
What partitions to make?
In what order?
What size?

We will use a minimal partition in order not to complicate things.

  • Root partition /dev/sda1 with 20GB, EXT4 format, primary, boot
  • Swap partition /dev/sda2 with 2XRAM recommended size, primary, swap on

Since I made only a 30GB harddisk in my virtualbox, I will only take 10GB for my swap partition. Rule of thumb is twice your RAM for the size of your swap.

With the commands fdisk -l or lsblk we discover that our harddisk is named /dev/sda.

That is all we need to know to get started.

Then we start cfdisk to partition our harddisk. You can also use fdisk, gdisk or parted. I choose to go with this more or less graphical partitioning tool.

We have choosen to install BIOS so we choose now DOS.

On a virtualbox and on a freshly bought ssd or harddisk you will get the same image.
However if you are reusing a harddisk, you will see lines (partitions) on there.
Delete all the partitions untill you have the same view like image beneath.

Notice the words Label: Dos in the third line.

If that is not the case, first type this in a terminal.

Use the arrow keys to move around cfdisk. Let us create the root partition.
Press enter on the New menu and type 20GB, choose primary and press Enter.
The type is set to Linux and that is correct. However do not forget to select Bootable for this partition. You will see an asterisk in the column Boot.
Now that the ROOT partition is created. Let us create the swap partition.
As a rule of thumb it must be twice the RAM. In my case that would be 32 GB and I have only 30GB in my virtualbox. I will take 10GB for SWAP in this exercise.
Move the selection to Free space.
Move the selection to New and press Enter. Choose Primary.
We take all the space that is left for Swap and press enter.
Move the selection to Type and choose Linux swap.
We will stick to 2 partitions.

We can make more partitions if you want. More info about partitions here.

This should be the result.
Then we choose Write. When you typed yes and confirmed it with an Enter you can select quit.

When typing lsblk things must be changed. We have now 2 partitions.

Format the partitions
We have sliced our harddisk into 2 pieces but we did not format them yet.
That is what we will do now with these commands.

Formatting the ROOT partition

Formatting the swap partition and activating it

Mount the file system BIOS
We need to mount our created root partition into our linux hierarchy.

INSTALLATION
Select the mirrors
You can select the mirrors that are closest to you geographically BUT it does not mean they will be the fastest. Normally I will change nothing until the speed is not satisfactory. As an example I changed some of the settings with nano and showed you how to save it then.

Read the info about mirror servers as this is quite important.

Install the base and base-devel packages
We are going to install the base and base-devel packages on our mounted partition in /mnt now. This will become our Linux system lateron.

CONFIGURE THE SYTEM
Fstab BIOS
Let us use the script genfstab to generate a fstab file so linux will know what partitions we have like root and swap.

You should have 2 partitions when you open the file with

CHROOT
Let us now move inside your future linux system and change elements there.

With exit you can exit this chroot environment should you want it.

I can only recommend you read the article about chroot. It helped me fix a broken Arch Linux system in the past.

Time zone
Here we are going to set our timezone aka where do you live according to Linux.

We investigate all the possibilities by navigating to the folder zoneinfo.

In my case I used

Then we set the hardware clock from the systemclock with this command.

LOCALE
In the locale we are going to set your localization.

What language do you want the system to be in?

You can investigate by using this command and uncomment the language or languages you prefer.

In my case I used en_US.UTF-8 and deleted the hashtag in front of it. Use the Page up and Page down key to navigate throught the list. You need to find out your language.

Belgium would be nl_BE.UTF-8.

Then we save the file and generate the locale by running this command

We will also set the variable LANG or language to reflect the same choice.

And type in this file

and save it.

IF you changed the keyboard layout like me you should do this too.
Let us make sure Arch Linux remembers to use my azerty keyboard after rebooting.

and add this line to it and save it afterwards

Shorter Alternative

HOSTNAME
We need to give our computer a name. Best is to choose one with no special characters and no spaces.

There is the longer way where you use nano and the shorter way. Up to you to decide. The result will be the same

Write the name you have choosen for your computer.

Then we save the file with CTRL + X.

We did the shorter alternative in the video this time.

Ps. I mixed up the hostname file between tutorials ArchLinux, Archlinux and ArchErik. Just take one unique name.

Shorter Alternative

Then we edit our /etc/hosts file so it reflects this code. Use the TAB to align them.

I have choosen ArchErik as hostname for my computer. You change it to your name.

NETWORK CONFIGURATION
We will use the application NetworkManager afterwards in any of our desktops we would like to install. Therefore it makes sense to install and activate this application right now.

Make sure you type NetworkManager in the second line. It is case sensitve.
You will get 3 symlink lines as a result.

When we boot we will have internet on board.

Initramfs
Creating a new intramfs is not required according to the wiki as result I will not create one with the command mkinitcpio -p linux.

But on ArcoLinux we made an article about the ugly lines when you shutdown. In that article we edit /etc/mkinitcpio.conf and add shutdown to the hooks. We will first experiment with the standard configuration and see what we get.

I show you in the video where you can add this “shutdown” if we need it lateron.

Re-edit after shutdown: we see these “ugly” lines upon shutdown as well on Arch Linux. We can do the fix later. It is just for cosmetic reasons.

Root Password
We add a password to our root account with this command. Choose your password wisely.

Boot loader
To install grub to our system in order to be able to boot lateron we need to pass these commands (you can add os-prober to the installation line if you multi-boot):

Sometimes you see people add –recheck as extra check. It does not seem necessary.
We still need to make the grub configuration file with this command in order to be able to boot lateron.

Reboot
Rebooting
Now we can think about rebooting our system.
Type exit to get out of the chroot environment.

We can optionally unmount our disks with

Then we can reboot with

And log back in with root as user and his/hers password.

The image beneath is proof that grub has been installed correcly.

Reboot after shutdown of virtualbox
We assume you have ArchLinux installed on Virtual Box and that you shutdown the virtual machine.

When you restart Virtual Box you will be presented with this screen underneath.
Select storage and make sure the iso of Arch Linux is deselected from IDE Secondary Master.

Then we start our Arch Linux and we will boot into grub.