<http://tomowatanabe.hatenablog.com/entry/2013/12/15/202806>
ここを参考にして、
ubuntu-saucy-13.10-armhf-3.8.13-bone30.img.xz
をSDに焼く。
i$ sudo dd bs=1m if=/Users/toshifumi/BeagleBoneBlack/ubuntu-saucy-13.10-armhf-3.8.13-bone30.img of=/dev/rdisk3
5分で焼けた。
BBBにいれてBootボタンを押しながら起動。
シリアルコンソールでログインOK。
$ ifconfig
eth0 Link encap:Ethernet HWaddr d0:ff:50:08:dd:33
inet addr:192.168.111.107 Bcast:192.168.111.255 Mask:255.255.255.0
inet6 addr: fe80::d2ff:50ff:fe08:dd33/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:95 errors:0 dropped:0 overruns:0 frame:0
TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19865 (19.8 KB) TX bytes:3244 (3.2 KB)
Interrupt:56
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1184 (1.1 KB) TX bytes:1184 (1.1 KB)
etherもつながっています。
uEnv.txtを編集して再起動。Bootボタンを押さずにUbuntuが立ち上がりました。
mmcpart=2
bootfile=zImage <---- 追加
optargs=fixrtc
uenvcmd=i2c mw 0x24 1 0x3e; kd=0; if test $mmcdev -eq 1; then mmc dev 0; if mmc
rescan; then kd=1; fi; mmc dev 1; fi; setenv mmcroot /dev/mmcblk${kd}p${mmcpart} ro
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${bootdir}/dtbs/${fdtfile}
loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}/${bootfile}
mmcboot=echo Booting from mmc ...; run mmcargs; bootz ${kloadaddr} - ${fdtaddr} <---- 追加
そして、2GBから4GBに拡張。
作業は参考ページと同じ。
$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 3.6G 296M 3.2G 9% /
/dev/root 3.6G 296M 3.2G 9% /
devtmpfs 248M 4.0K 248M 1% /dev
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 50M 216K 50M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 248M 0 248M 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/mmcblk0p1 1004K 490K 514K 49% /boot/uboot
ubuntu@ubuntu-armhf:~$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 1.8G 244M 1.5G 15% /
/dev/root 1.8G 244M 1.5G 15% /
devtmpfs 248M 4.0K 248M 1% /dev
none 50M 224K 50M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 248M 0 248M 0% /run/shm
/dev/mmcblk0p1 1004K 480K 524K 48% /boot/uboot
今はまだサイズが1.8GBになってますので、fdiskで拡張します
ubuntu@ubuntu-armhf:~$ sudo fdisk /dev/mmcblk0
ommand (m for help): p
Disk /dev/mmcblk0: 4023 MB, 4023386112 bytes
4 heads, 16 sectors/track, 122784 cylinders, total 7858176 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: 0x80008000
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 4095 1024 1 FAT12
/dev/mmcblk0p2 4096 3751935 1873920 83 Linux
Command (m for help): d
Partition number (1-4): 2
Command (m for help): p
Disk /dev/mmcblk0: 4023 MB, 4023386112 bytes
4 heads, 16 sectors/track, 122784 cylinders, total 7858176 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: 0x80008000
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 4095 1024 1 FAT12
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):
Using default value 2
First sector (4096-7858175, default 4096):
Using default value 4096
Last sector, +sectors or +size{K,M,G} (4096-7858175, default 7858175):
Using default value 7858175
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.
ここまで来たら、先のBootボタンを押しながらリブートします
ubuntu@ubuntu-armhf:~$ sudo reboot
起動したら再び
sshで接続してログイン後、resizeコマンドを叩きます
ubuntu@ubuntu-armhf:~$ sudo fdisk /dev/mmcblk0
Command (m for help): p
Disk /dev/mmcblk0: 4023 MB, 4023386112 bytes
4 heads, 16 sectors/track, 122784 cylinders, total 7858176 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: 0x80008000
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 4095 1024 1 FAT12
/dev/mmcblk0p2 4096 7858175 3927040 83 Linux
Command (m for help): q
ubuntu@ubuntu-armhf:~$ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.42 (29-Nov-2011)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 981760 blocks long.
ubuntu@ubuntu-armhf:~$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 3.7G 246M 3.3G 7% /
/dev/root 3.7G 246M 3.3G 7% /
devtmpfs 248M 4.0K 248M 1% /dev
none 50M 224K 50M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 248M 0 248M 0% /run/shm
/dev/mmcblk0p1 1004K 480K 524K 48% /boot/uboot
ubuntu@ubuntu-armhf:~$