- Arch installation with GRUB, GNOME and either ext4 or btrfs
First of all, you want to dual boot and have windows already installed, shrink its partition. Next, burn Arch iso to an USB or CD and boot it. Disable safe boot in BIOS if enabled.
To make things easy, it is good idea to perform the installation through ssh. This enables you to copy and paste commands which is really usefull :) I highly encourage to copy all commands i supplied to some editor, edit their arguments and then paste it to ssh session and execute. To enable this feature, first set up password for root account:
passwd
Next step is to connect to the local network. This step is not necessary if you are using ethernet cable, in that case you should be already connected to the internet. If you are using wifi, follow the steps below.
To connect to a wireless network use iwctl command. First step is to list avalibe devices:
iwctl station list
There should be device called wlan0 or something simillar, that is the one we want to use to connect to the wifi. In next examples replace wlan0 with your wireless network interface name. Next, scan avalibe networks using command:
iwctl station wlan0 scan
iwctl station wlan0 get-networks
You should see your network name on the list. Now, connect to the wifi using command:
iwctl station wlan0 connect $NETWORK_NAME
where $NETWOK_NAME is you wireless network name. In my case network name is "Internet", co my command looks like:
iwctl station wlan0 connect Intenet
You will be asked to enter network passphrase (password), enter password and confirm it with enter.
Now, that the internet connection is established, it is time to get your ip address and connect via ssh. To get ip addresses assigned to all of your interfaces use command:
ip a
which is short for:
ip address
As a result you should get something like this:
1: lo: (...)
2: enp3s0: (...)
4: wlan0: (...)
inet 192.168.0.54/24 (...)
Where what follows inet is your ipv4 address you are looking for. lo interface is your loopback, so ignore it. In my case my ipv4 address is 192.168.0.54. In order to connect from another machine we need to enter command:
ssh root@$IP_ADDRESS
where $IP_ADDRESS is ipv4 address assigned to our machine running arch install, in my case:
ssh root@192.168.0.54
Enter your password set in the beggining with passwd command and you are ready to go.
Now, you need to prepare for installation.
Default keyboard layout is us. In order to list avalibe ones use command:
ls /usr/share/kbd/keymaps/**/*.map.gz
In my case i want to load Polish keyboard layout, so additionaly grep for for "pl":
ls /usr/share/kbd/keymaps/**/*.map.gz | grep pl
There is layout:
/usr/share/kbd/keymaps/i386/qwerty/pl.map.gz
which i want to use, it is simple, default polish layout. In order to load it i use command:
loadkeys pl
As you see, you only specify filename, without extension or path.
Next step is to verify boot mode. It is important, because both patritioning and GRUB isntallation depend on your boot mode. Check for defined efivars:
ls /sys/firmware/efi/efivars
If you get "No such file or directory" error, it means you are using legacy mode. In other case, you are booted in UEFI mode. Remember which mode you have, it is very important!
Simply paste this command:
timedatectl set-ntp true
This step is very important. Now is the right time to make mind about partions layout. I will try to cover most common layouts. Before you begin this step decide if you want swap partition and if you want to completely wipe your disk. If you are installing Arch overwriting existing Linux installation you can skip this part, your disk is already partitioned. Just skip to next part.
Now, before next steps identify disk name using command:
fdisk -l
Device name is something like that: /dev/sdb with partition names like /dev/sdb1.
If you don't have efivars, you are in legacy mode. That means you don't have to create additional partition for boot loader (GRUB). The final layout should be like this:
- / partition - new partition / existing Linux one
- SWAP partition if needed, for example 16GB
- other partitions with other operating systems
In that case, you need one additional partition:
- /bool/efi partition - about 300MB+
To create new partition for Linux use command:
fdisk /dev/sdb
Create new partition with n, select p, primary partition type, use default partition sumber (remember it!), use default first sector, specify size, for example +180G for 180G partition or just use default for using whole avalibe space. If you want to use swap, create swap partition first, for example with +16G for swap and then just use all avalibe space for primary partition.
Example steps:
- 500MB partition for UEFI boot - n -> p -> ENTER -> ENTER -> +500M
- 16GB partition for SWAP - n -> p -> ENTER -> ENTER -> +16G
- all avalibe space for linux partition - n -> p -> ENTER -> ENTER -> ENTER
if you are asked to overwrite signature, say Yes to it :)
In that case you should have empty space on your disk. In my case it was /dev/sdb with only one partition, /dev/sdb1 with Windows on it of size 120G, where whole disk is 240G.
In that case, in fdisk create new patrition table. For Legacy boot mode use DOS partition table with command o, for UEFI use GPT with command g. Next, create required partitions.
List partitions with p.
In that case, you need to add bootable flag to partition with Linux, just use a command and enter partition number.
For SWAP partition you need to change partition type to SWAP. To do that, use t, then enter SWAP partition number, seletc L to list partition types and choose one for swap, in my case 82.
List partitions with p.
For SWAP partition you need to change partition type to SWAP. To do that, use t, then enter SWAP partition number, seletc L to list partition types and choose one for swap, in my case 19.
For EFI Boot partition you need to change partition type to EFI BOOT. To do that, use t, then enter SWAP partition number, seletc L to list partition types and choose one for EFI system, in my case 1.
Write changes with w command.
Next, format partitions you created + Linux one.
use fdisk -l
to get all partitions, select one with EFI type (in my case /dev/sda1) and format it:
mkfs.fat -F32 /dev/sda1
use fdisk -l
to get all partitions, select one with Linux swap type (in my case /dev/sdb1) and activate swap:
mkswap /dev/sdb1
swapon /dev/sdb1
Identify Linux partition with fdisk -l
and format it. In my case it is /dev/sdb2.
To format it to etx4 (easy way - recommended) use:
mkfs.ext4 /dev/sdb2
Now just mount it:
mount /dev/sdb2 /mnt
If you are in UEFI boot mode mount /boot partition as well:
mount /dev/sda1 /mnt/boot
For btrfs use:
mkfs.btrfs /dev/sdb2
Additionaly, create subvolumes. Good example is:
PARTITION="/dev/sdb2"
and after choosing partition:
mount $PARTITION /mnt
btrfs su cr /mnt/@
btrfs su cr /mnt/@home
btrfs su cr /mnt/@var
btrfs su cr /mnt/@opt
btrfs su cr /mnt/@tmp
btrfs su cr /mnt/@.snapshots
umount /mnt
mount -o noatime,commit=120,compress=zstd,space_cache,subvol=@ $PARTITION /mnt
mkdir /mnt/{boot,home,var,opt,tmp,.snapshots}
mount -o noatime,commit=120,compress=zstd,space_cache,subvol=@home $PARTITION /mnt/home
mount -o noatime,commit=120,compress=zstd,space_cache,subvol=@opt $PARTITION /mnt/opt
mount -o noatime,commit=120,compress=zstd,space_cache,subvol=@tmp $PARTITION /mnt/tmp
mount -o noatime,commit=120,compress=zstd,space_cache,subvol=@.snapshots $PARTITION /mnt/.snapshots
mount -o subvol=@var $PARTITION /mnt/var
Just replace PARTITION= with correct partition name and you should be OK. If you don't trust me, go read BTRFS documentation :)
If you are in UEFI boot mode mount /boot partition as well:
mount /dev/sda1 /mnt/boot
Installation is done with:
pacstrap /mnt
command. You need to specify packages you want to install. Base installation is:
pacstrap /mnt base linux linux-firmware vim
It containst only base linux system, kernel and firmware files for linux + vim of course. Depending on installation options additionally add following ones:
- AMD processor:
amd-ucode
- Intel processor:
intel-ucode
- BTRFS filesystem:
btrfs-progs
For me, intell processor + btrfs filesystem the command is following:
pacstrap /mnt base linux linux-firmware vim intel-ucode btrfs-progs
Now, that the system is installed, we need to take additional steps.
In order for installed linux to automatically mount correct partitions you need to generate fstab configuration file. To do so, type the following:
genfstab -U /mnt >> /mnt/etc/fstab
Since the installation is complete, we need to chroot into it in order to install additional packages and configure installed system. Exec the following:
arch-chroot /mnt
Set timezone (you can list avalibe ones with timedatectl list-timezones
) and sync hardware clock:
ln -sf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
hwclock --systohc
Next, decide on what locale (language) you want to use. Edit /etc/locale.gen in search for correct one. In my case, I want to use Polish language, so i uncomment the line with pl UTF8 locale:
vim /etc/locale.gen
resulting in pl_PL.UTF-8 UTF-8
uncommented. Then, generate locale with:
locale-gen
and set generated locale to /etc/locale.conf. Use the name of locale displayed while generating.
echo LANG=pl_PL.UTF-8 >> /etc/locale.conf
Next step is to set correct keyboard layout. If you didn't use loadkeys
command in the beggining use us keymap, which is the default one.
echo KEYMAP=pl >> /etc/vconsole.conf
Select machine name and save it to /etc/hostname and generate /etc/hosts.
HOSTNAME_NEW=ArchThinkpad
Edit HOSTNAME_NEW value to desired value and execute:
echo $HOSTNAME_NEW >> /etc/hostname
echo "127.0.0.1 localhost" >> /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.1.1 $HOSTNAME_NEW.localdomain $HOSTNAME_NEW" >> /etc/hosts
Set the password for root account with passwd
.
Next, install essential packages with pacman -S
command. The ones you need for sure:
grub
- grub boot loadergrub-btrfs
- grub btrfs module, if you used btrfs filesystemefibootmgr
- EFI Boot Manager, if you have UEFI boot modebase-devel linux-headers networkmanager network-manager-applet wpa_supplicant dialog os-prober mtools dosfstools reflector git lsb-release xdg-utils xdg-user-dirs
- all the essentialsbluez bluez-utils
- bluetooth supportcups
- printing supporttlp
- laptop power management, only for laptopsopenssh
- ssh deamon
In my case, i used the following command for BTRFS on Legacy boot mode installation (so everything without efibootmgr):
pacman -S base-devel linux-headers networkmanager network-manager-applet wpa_supplicant dialog os-prober mtools dosfstools reflector git lsb-release xdg-utils xdg-user-dirs bluez bluez-utils cups grub grub-btrfs tlp openssh
Just use defaults and install all the things you want.
Edit /etc/mkinitcpio.conf (vim /etc/mkinitcpio.conf
) and add btrfs to MODULES=() line, so it looks like:
MODULES=(btrfs)
and execute:
mkinitcpio -p linux
In that case, simply execute:
grub-install /dev/sdb
Where /dev/sdb is the disk on which you installed Arch. Then generate grub config:
grub-mkconfig -o /boot/grub/grub.cfg
In that case, simply execute:
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Arch
Where /dev/sdb is the disk on which you installed Arch. Then generate grub config:
grub-mkconfig -o /boot/grub/grub.cfg
Select desired username:
MYUSERNAME=archmaster
where MYUSERNAME is your desired username of course.
Create an user with specified username in wheel group (for sudo):
useradd -mG wheel $MYUSERNAME
passwd $MYUSERNAME
Then execute visudo
and uncomment the following line:
%wheel ALL=(ALL) ALL
Enable netowrking, bluetooth, tlp and CUPS services. Just paste the following:
systemctl enable NetworkManager
systemctl enable bluetooth || echo "no bluetooth"
systemctl enable cups.service || echo "no cups"
systemctl enable tlp.service || echo "no tlp"
systemctl enable sshd || echo "no ssh"
Next step is to install display server and display drivers. Correct opensource drivers are:
xf86-video-amdgpu
- for AMD GPUxf86-video-intel
- for Intell GPU, integrated one as wellxf86-video-nouveau
- for NVIDIA GPUxf86-video-vesa
- generic driver
Additionally install OpenGL support (mesa
) and X11 display server (xorg
group). For me (Intell CPU with integrated GPU):
pacman -S xf86-video-intel mesa xorg
Love it or hate it, GNOME is the most complete Linux DE, together with KDE. For ease of use i suggest installing GNOME:
pacman -S gnome gnome-extra
systemctl enable gdm.service
If you have Windows, install:
pacman -S ntfs-3g
then run:
echo "GRUB_DISABLE_OS_PROBER=false" >> /etc/default/grub
sudo grub-mkconfig -o /boot/grub/grub.cfg
Exit chroot with exit
and reboot machine (reboot
). Congratulations, you have installed Arch with GNOME. Now check if it works and if now search through archwiki to solve all the problems :) In my case i forgot the bootable flag on /dev/sdb2, easily fixable no operating system found error :)
I provide additional config for GNOME myself. In order to install it:
- open Extensions App and enable User Themes extension
- open Terminal, go to preferences and add new profile with random name
- git clone https://github.com/ickyicky/dotfiles
cd dotfiles
./install.sh
and select y for every option- log out and log in
- open terminal, select Base16Ocean256 profile, if needed add transparency in colors tab
- reopen terminal
Now you are ready to post neofetch screenshot to r/uniporn
You can additionally install pamac for GUI software installation:
yay -S pamac