OS関連
目次
Raspbery Pi 2BへのFedora 21 Remixの導入と設定手順。
配布元サイトよりイメージをダウンロードする。
Pi2B-Fedora-Xfce-armhfp-21-5-20150217-1-sda.raw.xz
Linuxの導入された端末を使用して、インストールイメージをメディアに書き込む。
1. メディアを端末に接続
2. fdiskコマンドにて接続したメディアの名称を確認
fdisk -l ディスク /dev/sdb: 31.9 GB, 31914983424 バイト ヘッド 255, セクタ 63, シリンダ 3880 Units = シリンダ数 of 16065 * 512 = 8225280 バイト セクタサイズ (論理 / 物理): 512 バイト / 512 バイト I/O size (minimum/optimal): 512 bytes / 512 bytes ディスク識別子: 0x00000000 デバイス ブート 始点 終点 ブロック Id システム /dev/sdb1 1 3880 31162004 c W95 FAT32 (LBA)
3. メディアにイメージを書き込む
xzcat Pi2B-Fedora-Xfce-armhfp-21-5-20150217-1-sda.raw.xz > /dev/sdb
timedatectl set-timezone Asia/Tokyo
localectl set-keymap jp106
/etc/inittabは存在するが、設定は以下のコマンドにて行う。
systemctl set-default multi-user.target
systemctl set-default graphical.target
systemctlコマンドにてホスト名を設定する。
hostnamectl set-hostname [HOSTNAME]
上記の手順にてメディアにイメージを書き込むと、システム領域は2GBととなり実用に堪えることができない。
以下の手順にて領域の拡張を行う。
# parted
(parted) print モデル: SD TEAM (sd/mmc) ディスク /dev/mmcblk0: 31.7GB セクタサイズ (論理/物理): 512B/512B パーティションテーブル: msdos ディスクフラグ: 番号 開始 終了 サイズ タイプ ファイルシステム フラグ 1 1049kB 513MB 512MB primary fat16 lba 2 513MB 1025MB 512MB primary linux-swap(v1) 3 1025MB 2048MB 2048MB primary ext4
(parted) rm 3 Error: Partition(s) 3 on /dev/mmcblk0 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. Ignore/Cancel? Ignore
(parted) print 〜中略〜 番号 開始 終了 サイズ タイプ ファイルシステム フラグ 1 1049kB 513MB 512MB primary fat16 lba 2 513MB 1025MB 512MB primary linux-swap(v1)
(parted) mkpart primary 1025MB 31GB Error: Partition(s) 3 on /dev/mmcblk0 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. Ignore/Cancel? Ignore
(parted) print 〜中略〜 番号 開始 終了 サイズ タイプ ファイルシステム フラグ 1 1049kB 513MB 512MB primary fat16 lba 2 513MB 1025MB 512MB primary linux-swap(v1) 3 1025MB 31.0GB 30.0GB primary ext4
(parted) quit
# reboot
容量を増やしたパーティションに対してファイルシステムの拡張を行い、全容量を使用できるようにする。
# resize2fs /dev/mmcblk0p3
systemctlコマンドにて制御を行う。
systemctl start [SERVICE NAME]
systemctl restart [SERVICE NAME]
systemctl stop [SERVICE NAME]
systemctl stop firewalld.service
systemctl disable firewalld.service