Arc Linux で SD Card の余り領域を使えるようにする
次に 16G の SD Card の使っていない部分を使えるようにしてみた。
参考にしたのは以下のページ。
まずは fdisk コマンドで確認。
[root@alarmpi ~]# fdisk /dev/mmcblk0 Welcome to fdisk (util-linux 2.21.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/mmcblk0: 16.1 GB, 16130244608 bytes 4 heads, 16 sectors/track, 492256 cylinders, total 31504384 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 identifier: 0x000c21e5 Device Boot Start End Blocks Id System /dev/mmcblk0p1 * 2048 194559 96256 c W95 FAT32 (LBA) /dev/mmcblk0p2 194560 3862527 1833984 83 Linux Command (m for help):
2番目のパーティション(/dev/mmcblk0p2)の Start は 194560。これを覚えておく。
次に d コマンドで2番目のパーティションを削除する。
Command (m for help): d Partition number (1-4): 2 Partition 2 is deleted
次に n コマンドで新しくパーティションを作成する。
パーティションタイプは primary で、パーティション番号は 2。
First sector は先に覚えておいた数字。(とは言ったけど、ここでデフォルト値として表示される)
Last sector はデフォルトの値。
Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): p Partition number (1-4, default 2): 2 First sector (194560-31504383, default 194560): 194560 Last sector, +sectors or +size{K,M,G} (194560-31504383, default 31504383): 31504383 Partition 2 of type Linux and of size 15 GiB is set
最後にパーティション情報を w コマンドで書き込む。
Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. [root@alarmpi ~]#
w コマンドには結構時間がかかって約25分で終了。
メッセージにもでてるけど、ここで reboot が必要。
[root@alarmpi ~]# reboot Broadcast message from root@alarmpi on pts/0 (Sun, 14 Oct 2012 09:39:54 +0100): The system is going down for reboot NOW! [root@alarmpi ~]# Connection to alarmpi closed by remote host. Connection to alarmpi closed. iMac-i3-27:raspberry-pi paraches$
リブート後に再度 ssh で繋いで、resize2fs コマンドで設定。
[root@alarmpi ~]# resize2fs /dev/mmcblk0p2 resize2fs 1.42.5 (29-Jul-2012) Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 3913728 (4k) blocks. The filesystem on /dev/mmcblk0p2 is now 3913728 blocks long.
df -h で確認してみる。
[root@alarmpi ~]# df -h Filesystem Size Used Avail Use% Mounted on rootfs 15G 407M 14G 3% / /dev/root 15G 407M 14G 3% / devtmpfs 92M 0 92M 0% /dev tmpfs 92M 0 92M 0% /dev/shm tmpfs 92M 272K 92M 1% /run tmpfs 92M 0 92M 0% /sys/fs/cgroup tmpfs 92M 0 92M 0% /tmp /dev/mmcblk0p1 94M 37M 58M 39% /boot [root@alarmpi ~]#
というわけで、残りの領域も使えるようになったよ!
この後にまだシステムのアップデートとかもあるのだけど、とりあえずここまで。
sudo も入ってなかったりするので、色々と入れたりしなきゃならないものが多い。
あと、ちょっと困っているのは 2012-09-18 バージョンの Arc Linux に /etc/rc.conf がない!ってこと。
このバージョンから systemd を使うようになって無くなっちゃったらしいのだけど、pacman で落としてくるサービスが rc.conf がないよ!ってアラートだしたりして気持ち悪い…。
この辺りをちゃっちゃとできる人じゃないと Arc Linux は使っちゃいけないのかな〜。
素直に「Raspbian "wheezy"」をインストールするべきなのか?
このブログのタイトルにも Debianって入ってることだし!