SWAP領域(パーテーション)設定
要再起動
「parted」と入力
[root@pidora ~]# parted
GNU Parted 3.1
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
「print free」と入力し状態を確認
(parted) print free
Model: SD USD (sd/mmc)
Disk /dev/mmcblk0: 31.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
32.3kB 1049kB 1016kB Free Space
1 1049kB 53.5MB 52.4MB primary fat16 boot, lba
2 53.5MB 31.0GB 30.9GB primary ext4
31.0GB 31.9GB 922MB Free Space
「mkpart primary linux-swap (Number 1のEnd位置) (SDカードサイズEnd位置)」と入力しパーテーションを作成
(parted) mkpart primary linux-swap 31.0GB 31.9GB
(parted) print
Model: SD USD (sd/mmc)
Disk /dev/mmcblk0: 31.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 53.5MB 52.4MB primary fat16 boot, lba
2 53.5MB 31.0GB 30.9GB primary ext4
3 31.0GB 31.9GB 922MB primary
「quit」と入力し終了
(parted) quit
Information: You may need to update /etc/fstab.
「mkswap /dev/mmcblk0p3」と入力し初期化
[root@pidora ~]# mkswap /dev/mmcblk0p3
Setting up swapspace version 1, size = 900092 KiB
no label, UUID=05e0f158-6764-4df9-8370-9106045de295
「swaplabel --label swap /dev/mmcblk0p3」と入力しラベル作成
[root@pidora ~]# swaplabel --label swap /dev/mmcblk0p3
[root@pidora ~]# swaplabel /dev/mmcblk0p3
LABEL: swap
UUID: 05e0f158-6764-4df9-8370-9106045de295
以下を入力しSWAP設定を/etc/fstabへ追記
echo 'LABEL="swap" /dev/mmcblk0p3 swap defaults 0 0' >> /etc/fstab
「swapon /dev/mmcblk0p3」と入力し有効に
[root@pidora ~]# swapon /dev/mmcblk0p3
[root@pidora ~]# free
total used free shared buffers cached
Mem: 445976 173968 272008 836 13596 90272
-/+ buffers/cache: 70100 375876
Swap: 900092 0 900092
「reboot」と入力し再起動し完了
[root@pidora ~]# reboot