2014年8月10日日曜日

BBBの容量

容量の変更

DebianのSDイメージをmicroSDに書き込んだ直後ではパーティションがぎちぎちでapt-get updateも通らない。

パーティションサイズを増やす必要がある。
ここを参照して作業。
ただし、Debian (BeagleBone, BeagleBone Black - 2GB SDを使った場合は、resize2fsは最初から入っているのでインストールする必要なし。
(というか容量の余裕がなくて、#apt-get install system-config-lvmができない)
root@beaglebone:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          1.6G  1.5G     0 100% /
udev             10M     0   10M   0% /dev
tmpfs           100M  504K   99M   1% /run
/dev/mmcblk0p2  1.6G  1.5G     0 100% /
tmpfs           249M     0  249M   0% /dev/shm
tmpfs           249M     0  249M   0% /sys/fs/cgroup
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           100M     0  100M   0% /run/user
/dev/mmcblk0p1   96M   70M   27M  73% /boot/uboot
root@beaglebone:~# fdisk /dev/mmcblk0
Command (m for help): p
Disk /dev/mmcblk0: 15.7 GB, 15720251392 bytes
4 heads, 16 sectors/track, 479744 cylinders, total 30703616 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: 0x00000000
        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *        2048      198655       98304    e  W95 FAT16 (LBA)
/dev/mmcblk0p2          198656     3481599     1641472   83  Linux
Command (m for help): q
root@beaglebone:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          1.6G  1.5G     0 100% /
udev             10M     0   10M   0% /dev
tmpfs           100M  504K   99M   1% /run
/dev/mmcblk0p2  1.6G  1.5G     0 100% /
tmpfs           249M     0  249M   0% /dev/shm
tmpfs           249M     0  249M   0% /sys/fs/cgroup
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           100M     0  100M   0% /run/user
/dev/mmcblk0p1   96M   70M   27M  73% /boot/uboot
root@beaglebone:~# fdisk /dev/mmcblk0
Command (m for help): p
Disk /dev/mmcblk0: 15.7 GB, 15720251392 bytes
4 heads, 16 sectors/track, 479744 cylinders, total 30703616 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: 0x00000000
        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *        2048      198655       98304    e  W95 FAT16 (LBA)
/dev/mmcblk0p2          198656     3481599     1641472   83  Linux
Command (m for help): d
Partition number (1-4): 2
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 (198656-30703615, default 198656):
Using default value 198656
Last sector, +sectors or +size{K,M,G} (198656-30703615, default 30703615):
Using default value 30703615
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@beaglebone:~# sudo reboot
Broadcast message from root@beaglebone (pts/0) (Thu May 15 02:32:38 2014):
The system is going down for reboot NOW!
root@beaglebone:~#
リブート後、resize2fsを実行

root@beaglebone:~# sudo resize2fs /dev/mmcblk0p2


0 件のコメント: