Arch Linux インストール(パーティション編)

さて、先週はWifiでネットワークにつなげるまでできたよね。

今日は、続きをやっていくよ。

 

HDDのパーティション分割を行うよ。

WindowsだとCドライブだとかDドライブだとか見たことあるかな?

これは、1つのHDDをCドライブとDドライブに分割して

CドライブにはOSを入れる、

Dドライブにはユーザーデータを入れるとか

使う用途によって分割しておくと便利なんだ。

 

パーティションについては、以下の記事が詳しいので

分からない人は読んで欲しい。

 

eng-entrance.com

 

今回は、個人で使用するPCなのでシンプルに

最低限のパーティション分割にしようと思う。

 

  1. EFI システムパーティション:200M(FAT32)
  2. 残り全部(Ext4

という2つに分割するよ。

 

(※スワップ領域はメモリが8Gあるので不要らしい、後でスワップファイルとして設定できるので今回は作らない)

 

下記コマンドを入力してくれ。

赤い文字の部分が入力したコマンドだよ。

(そのままエンター)のところはdefaultのままでいいので、

何も入力せずにエンターキーを押すよ。

 

# sgdisk --zap-all /dev/sda
Creating new GPT entries
GPT data structures destroyed! you may now partition the disk using fdisk or
other utilities.

# fdisk -l
Disk / dev/sda : 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes/ 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sdb: 3.7 GiB, 3965190144 bytes, 7744512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0058f1e5

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 7744511 7742464 3.7G c W95 FAT32 (LBA)

Disk /dev/loop0: 442.1 MiB, 463548416 bytes, 905368 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

# gdisk /dev/sda
GPT fdisk (gDisk) version 1.0.3

Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present

Creating new GPT entries.

Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y

Command (? for help): n
Partition number (1-128, default 1): 1
First sector (34-250069646, default = 2048) or {+-}size{KMGTP};(そのままエンター)
Last sector (2048-250069646, default = 250069649) or {+-}size{KMGTP}: +200M
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): ef00
Changed type of partition to 'EFI System'

Command (? for help): n
Partition number (2-128, default 2):(そのままエンター)
First sector (34-250069646, default = 411648) or {+-}size{KMGTP}:(そのままエンター)
Last sector (411648-250069646, default = 250069646) or {+-}size{KMGTP}:(そのままエンター)
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Tnter = 8300):(そのままエンター)
Changed type of partition to 'Linux filesystem'

Command (? for help): w

Final checkes 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.

 

よし、これでパーティションの分割ができた。

次は、フォーマットを行うよ。

 

# mkfs.fat -F32 /dev/sda1

# mkfs.ext4 /dev/sda2

 

次は、マウントを行うよ。

 

# mount /dev/sda2 /mnt

# mkdir /mnt/boot

# mount /dev/sda1 /mnt/boot

 

次は、ミラーリストを編集するよ。

ミラーリストというのはパッケージをダウンロードするとき、どこのサイトから 行うかを記述しているものだ。海外のサーバーだとダウンロードが遅いので日本のサーバーに変更するよ。

 

# vi /etc/pacman.d/mirrorlist

上記ファイルの中で「jaist」という行を探して上に持ってくる。

上にあるほど優先順位が高いんだ。

 

次は、時間を合わすよ。

# timedatectl set-ntp true

 

さて、いよいよインストールだ。

続きは来週(ってTVかよ!)