ArchLinux ; インストール #2 ディスクのパーティショニング (このページ)
ArchLinux ; インストール #3 インストール時の初期設定
はファイルシステムにext4を使用しています
btrfsファイルシステムにインストールする場合は下記ページに纏めてあります
ArchLinux ; インストール #4 btrfsでのインストール方法
1. Arch Linux をインストールするディスクのパーティショニング
今回はUEFI モード、パーティションテーブルをGPTにするのでコマンドはgdiskを利用する
現在のディスク情報を確認
root@archiso~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 1G 1 loop /run/archiso/airootfs
sda 8:0 0 40G 0 disk
sr0 11:0 1 1.2G 0 rom /run/archiso/bootmnt
NAME 行の sda が、ディスク全体を表すデバイス名でこのsdaにパーティショニングを行います
今回はEFIパーティションとArch Linux 用パーティションを作成しswapパーティションは作成しません
以前は、スワップ用にパーティションを一つ作って、それをスワップとして割り当てていましたが、現在は 「スワップファイル」 を使うことができるため、スワップ用のパーティションは作らなくても使用できます。
「スワップファイル」は、スワップ用に任意のサイズのファイルを一つ作成しておいて、その領域をスワップとして使う方法で、作成・削除・リサイズができます。
GPT の場合
root@archiso~ # gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.10
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries in memory.
・o コマンドで、空のパーティションテーブルを作成
Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): Y
・EFI システムパーティションを作成
n コマンドで、パーティションを追加
Command (? for help): n
Partition number (1-128, default 1): [Enter]
First sector (34-62914526, default = 2048) or {+-}size{KMGTP}: [Enter]
Last sector (2048-62914526, default = 62912511) or {+-}size{KMGTP}: +512M
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): ef00
Changed type of partition to 'EFI system partition'
・Arch Linux 用パーティションを作成
n コマンドで、パーティションを追加
Command (? for help): n
Partition number (2-128, default 2): [Enter]
First sector (34-62914526, default = 1050624) or {+-}size{KMGTP}: [Enter]
Last sector (1050624-62914526, default = 62912511) or {+-}size{KMGTP}: [Enter]
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): 8300
Changed type of partition to 'Linux filesystem'
・パーティションテーブルをディスクに書き込み
wコマンドを使用します
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.
gdisk /dev/sda 1.93s user 5.47s system 4% cpu 2:50.87 total
2. 各パーティションのフォーマット
・EFI システムパーティションのフォーマット
root@archiso~ # mkfs.vfat -F32 /dev/sda1
mkfs.fat 4.2 (2021-01-31)
・Arch Linux 用パーティションのフォーマット
Linux で使えるファイルシステムにはext4 、XFSなどがありますが安定したext4を利用する
root@archiso~ # mkfs.ext4 /dev/sda2
mke2fs 1.47.4 (6-Mar-2025)
Creating filesystem with 10354176 4k blocks and 2588672 inodes
Filesystem UUID: a1d71112-d3a2-4fd3-8f93-19f5487961d1
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624
Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done
3.Arch Linux をインストール
3.1 ネットに接続
インストールするファイル(パッケージ)は、ネットからダウンロードする必要があるので、まずは、インストールシステム上でネットに接続する必要があります。有線 LAN の場合は、起動時に自動で接続される場合がほとんど
接続確認
root@archiso~ # ping -c 4 archlinux.jp
PING archlinux.jp (160.16.119.98) 56(84) bytes of data.
64 bytes from tk2-235-27344.vs.sakura.ne.jp (160.16.119.98): icmp_seq=1 ttl=53 time=13.5 ms
64 bytes from tk2-235-27344.vs.sakura.ne.jp (160.16.119.98): icmp_seq=2 ttl=53 time=14.3 ms
64 bytes from tk2-235-27344.vs.sakura.ne.jp (160.16.119.98): icmp_seq=3 ttl=53 time=13.5 ms
64 bytes from tk2-235-27344.vs.sakura.ne.jp (160.16.119.98): icmp_seq=4 ttl=53 time=14.4 ms
--- archlinux.jp ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 13.473/13.930/14.431/0.440 ms
3.2 時刻設定
ネットからパッケージをダウンロードする際、パソコンの時刻が正しくないと、ダウンロードできない場合があるので、ネットから時刻を調整する
root@archiso~ # timedatectl set-ntp true
3.3 パーティションのマウント
・Arch Linux 用パーティションのマウント
root@archiso~ # mount /dev/sda2 /mnt
・EFI システムパーティションのマウント
EFI システムパーティションに、ブートローダーや Linux カーネルをインストールする/mnt/boot にマウントします
root@archiso~ # mkdir /mnt/boot
root@archiso~ # mount /dev/sda1 /mnt/boot
3.4 リポジトリのサーバーを選択
・reflector コマンドを利用する場合
root@archiso~ # reflector --sort rate --country jp --latest 10 --save /etc/pacman.d/mirrorlist
・ミラーリストを編集する場合
Pacman Mirrorlist Generator(https://archlinux.org/mirrorlist/)でCountry:Japanのミラーサイトを開くと次の通り
##
## Arch Linux repository mirrorlist
## Generated on 2026-11-22
##
## Japan
#Server = http://mirror.aria-on-the-planet.es/archlinux/$repo/os/$arch
#Server = https://mirror.aria-on-the-planet.es/archlinux/$repo/os/$arch
#Server = http://mirrors.cat.net/archlinux/$repo/os/$arch
#Server = https://mirrors.cat.net/archlinux/$repo/os/$arch
#Server = http://jp.mirrors.cicku.me/archlinux/$repo/os/$arch
#Server = https://jp.mirrors.cicku.me/archlinux/$repo/os/$arch
#Server = http://ftp.tsukuba.wide.ad.jp/Linux/archlinux/$repo/os/$arch
#Server = http://mirror.hashy0917.net/archlinux/$repo/os/$arch
#Server = https://mirror.hashy0917.net/archlinux/$repo/os/$arch
#Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
#Server = https://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
#Server = http://www.miraa.jp/archlinux/$repo/os/$arch
#Server = https://www.miraa.jp/archlinux/$repo/os/$arch
#Server = http://mirror.rain.ne.jp/archlinux/$repo/os/$arch
#Server = https://mirror.rain.ne.jp/archlinux/$repo/os/$arch
#Server = http://ftp.yz.yamagata-u.ac.jp/pub/linux/archlinux/$repo/os/$arch
#Server = https://ftp.yz.yamagata-u.ac.jp/pub/linux/archlinux/$repo/os/$arch
これらの先頭の#を削除し/etc/pacman.d/mirrorlistの最上位に貼り付ける
3.5 パッケージのインストール
最低限必要なのはbase Linux カーネル、ファームウェア、テキストエディタ (CUI) など
その他はあれば便利なツールで後からでも必要な時にインストールできます
root@archiso~ # pacstrap /mnt base base-devel linux linux-firmware networkmanager vi vim nano openssh dhcpcd netctl wget man-db man-pages
3.6 fstabの設定
起動時に自動的にマウントするパーティションなどの情報を、/etc/fstab のファイルに記述します。
root@archiso~ # genfstab /mnt >> /mnt/etc/fstab
fstab ファイルの内容を確認
root@archiso~ # vim /mnt/etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# UUID=a1d71112-d3a2-4fd3-8f93-19f5487961d1
/dev/sda2 / ext4 rw,relatime 0 1
# UUID=8E50-FCEF
/dev/sda1 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
