This is a simple guild that is much simpler than the official guild. It tells you how to install an Arch Linux & Windows dual system step by step. Don’t Panic!
Warning: Remember to backup the USB, the dd command will erase the USB completely.
Use lsblk command to find out the name of your USB drive.
DO not append a partition number, so do not use something like /dev/sdb1
lsblk
dd bs=4M if=archlinux.iso of=/dev/sdx && sync
Then, you can use the USB stick boot the system. Remember, if your system is 64 bit, then choose x86 64 archlinux. i686 is for 32 bit.
Partition can be tricky.
lsblk
I start fdisk from the shell prompt:
fdisk /dev/sdb
Command (m for help): p
Command (m for help): n
Command action
e extend
p primary partition (1-4)
p
Partition number (1-4): 1
Then , you need to follow the fdisk, calculate the size of each partition. After you finish all the partitioning, use w to write to disk.
The partition plan can be different. Personally, I choose 20G for '/'
, then 40G for '/home'
.
mkfs.ext4 /dev/sdxY
The /
(root) partition must be mounted first. If the root partition’s name is sdxR. Do:
mount /dev/sdxR /mnt
The general procedure is to first create the mount point, and then mount the partition to it.
mkdir -p /mnt/home
mount /dev/sdxB /mnt/home
use wifi-menu to connect to a wireless network:
wifi-menu
You may want to edit the mirrorlist file and place your preferred mirror first.
vi /etc/pacman.d/mirrorlist
If you want, you can delete all other lines but leave your favourite one. For example, I leave 3 US servers and a NZ server.
After change the file, use:
pacman -Syyu
To refresh all package lists.
The base system is installed using the pacstrap script.
pacstrap -i /mnt base base-devel
genfstab -U -p /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstab
Warning: The fstab file should always be checked after genering it. If you encounter errors running genfstab or later in the install process, do not run genfstab; just edit the fstab file.
chroot into your newly installed system:
arch-chroot /mnt /bin/bash
vi /etc/locale.gen
Un comment en_US.UTF-8 UTF-8 or other locale. Before locaes can be enabled, they must be generated:
locale-gen
Create /etc/locale.conf
, where LANG refers to the first column of an uncommented entry in /etc/locale.gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
Export the chosen locale:
export LANG=en_US.UTF-8
Available time zones and subzones can be found in the /usr/share/zoneinfo/Zone/subZone
directories.
ln -s /usr/share/zoneinfo/Zone/SubZone /etc/locatime
Use UTC time
hwclock --systohc --utc
Define a name replace the ‘myhostname’ below:
echo myhostname > /etc/hostname
Add the same hostname to /etc/hosts:
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost myhostname
::1 localhost.localdomain localhost myhostname
Install iw
and wpa-supplicant
which you will need to connect to a network:
pacman -S iw wpa_supplicant
using wifi-menu
install dialog
, which is required for wifi-menu
:
pacman -S dialog
Next time you start the system, use wifi-menu to connect to the Internet.
Set the root password with
passwd
Install the grub package, to have search for other installed operating system, install os-prober in addition:
pacman -S grub os-prober
Install the bootloader to the drive Arch was installed to.
grub-install --target=i386-pc --recheck /dev/sda
Automatically generate grub.cfg:
grub-mkconfig -o /boot/grub/grub.cfg
exit
reboot