Preface
A quick installation based …
Preface
A quick installation based on Arch wiki - Beginners' Guide
WITHOUT NETWORK CONFIGURATION
(INSTALL IN VIRTUAL MACHINE USING DHCP).
YOU NEED TO SETUP THE NETWORK OF THE MACHINE FIRST.
Network
Network configuration - ArchWiki
Partition
# lsblk
- Check you are partitioning on the right disk.
- (assume
/dev/sda
here)
# cgdisk /dev/sda
- Partition Table
- GPT -
ef02
(BIOS boot partition) =>/dev/sda1
- 1M
- MUST be the first partition of the disk.
IMPORTANT!! Set to BIOS Boot partition for grub2
.
- / - 8300 (Linux filesystem) =>
/dev/sda2
- swap - 8200 (Linux swap) =>
/dev/sda3
- home - 8302 (Linux /home) =>
/dev/sda4
- GPT -
- Write -> yes
- QUIT
- Partition Table
# lsblk
- Check if the partition scheme of the disk is right.
Create Filesystem
# mkfs.ext4 /dev/sda2
ext4
for/
# mkfs.ext4 /dev/sda4
ext4
forhome
# mkswap /dev/sda3 && swapon /dev/sda3
swap
forswap
Mount partitionis
# mount /dev/sda2 /mnt
# mkdir /mnt/home && mount /dev/sda4 /mnt/home
Select a mirror
# vi /etc/pacman.d/mirrorlist
- Choose a mirror site that is the nearest from your machine
- Copy it to the top of this mirrorlist.
Install the base system
# pacstrap /mnt base base-devel
Generate fstab
# genfstab -p /mnt > /mnt/etc/fstab
# vi /mnt/etc/fstab
- Check if the fstab is right.
Chroot and configure the base system
# arch-chroot /mnt /bin/bash
- After chroot, use bash.
Locale & Keymap
# vi /etc/locale.gen
- Select needed encoding and uncomment them.
- en_US.UTF-8 UTF-8
- zh_TW.UTF-8 UTF-8
# locale-gen
# echo "LANG=en_US.UTF-8" > /etc/locale.conf
# echo "KEYMAP=us" > /etc/vconsole.conf
Timezone & Hardclock & Hostname
# ln -s /usr/share/zoneinfo/Asia/Taipei /etc/localtime
# hwclock --systohc --utc
# echo "$myhostname" > /etc/hostname
Configure the network (DHCP)
# systemctl enable dhcpcd.service
- I use DHCP for the virtual machine.
- For static IP and wireless, Check the Official Guide
Create an initial ramdisk environment
- If you won't modify
/etc/mkinitcpio.conf
, you can just skip this step. # mkinitcpio -p linux
after modified/etc/mkinitcpio.conf
Set User
# passwd
- set root password.
# useradd -m $user
- add a user with home directory.
# passwd $user
- set the password for the user.
Install and configure a bootloader
# pacman -S grub
# vi /etc/default/grub
- For a bug of grub I've met.
- Add
GRUB_DISABLE_SUBMENU=y
at the end of/etc/default/grub
-
# grub-mkconfig -o /boot/grub/grub.cfg
- Generate the configuration file of grub
If you didn't add the
GRUB_DISABLE_SUBMENU=y
mentioned above
you would get error message and fail here.
- Generate the configuration file of grub
-
# grub-install --target=i386-pc --recheck /dev/sda
If you didn't mark the GPT partition (1007KiB)
as aBIOS Boot Partition
you would get error message and fail here.
the solution is in GRUB - ArchWiki
After installation
# exit
# umount -R /mnt
- unmount the partitions
# reboot
References
Share
Donation
如果覺得這篇文章對你有幫助, 除了留言讓我知道外, 或許也可以考慮請我喝杯咖啡, 不論金額多寡我都會非常感激且能鼓勵我繼續寫出對你有幫助的文章。
If this blog post happens to be helpful to you, besides of leaving a reply, you may consider buy me a cup of coffee to support me. It would help me write more articles helpful to you in the future and I would really appreciate it.
Related Posts
- Font Config in Arch Linux
- Setup PPPoE Wired Network in Arch Linux
- 用 ntfs-3g 自動 mount Windows 裡的 D 槽
- Unzip 7zip file by p7zip on Arch Linux
- pacman mirrorlist - Taiwan vs. Taiwan (Province of China)