BPI-M2+(H2) 운영체제(OS) 설치

OS/Banana Pi /BPI-Bit 2018.07.21 10:24 Posted by 파란크리스마스

출처

OS 이미지 다운로드

2018-05-04-ubuntu-16.04-mate-desktop-v1.1-bpi-m2p-sd-emmc.img.zip

OS 이미지 SD 메모리에 복사

SD 메모리 복사 프로그램인 Etcher를 이용해서 OS 이미지를 복사합니다.

버튼[Select image] 선택하고, 파일 선택 창에서 다운 받은 OS 이미지 선택

OS 이미지를 복사할 SD 메모리 선택하기 위해서 버튼[Select drive] 선택

버튼[Flash!] 선택해서 복사 시작

SD 확장

SD 확장전 용량확인

$ df -l
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root        6993924 4796496   1842152  73% /
devtmpfs          408148       0    408148   0% /dev
tmpfs             510744     380    510364   1% /dev/shm
tmpfs             510744    7500    503244   2% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs             510744       0    510744   0% /sys/fs/cgroup
tmpfs             102152      32    102120   1% /run/user/1000
/dev/mmcblk0p1    261868    6648    255220   3% /media/pi/BPI-BOOT

SD FDisk

pi@bpi-iot-ros-ai:~$ sudo fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.27.1).
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: 14.9 GiB, 15931539456 bytes, 31116288 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
Disklabel type: dos
Disk identifier: 0x8ef6c070

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1      204800   729087   524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      729088 14940159 14211072  6.8G 83 Linux

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-31116287, default 2048): 729088    
Last sector, +sectors or +size{K,M,G,T,P} (729088-31116287, default 31116287): 

Created a new partition 2 of type 'Linux' and of size 14.5 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: 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).

pi@bpi-iot-ros-ai:~$ sudo shutdown -r now

SD 확장

$ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.42.13 (17-May-2015)
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 3798400 (4k) blocks long.

SD 확장 확인

$ df -l
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root       14958272 4577560   9706060  33% /
devtmpfs          408148       0    408148   0% /dev
tmpfs             510744     196    510548   1% /dev/shm
tmpfs             510744    7504    503240   2% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs             510744       0    510744   0% /sys/fs/cgroup
tmpfs             102152      28    102124   1% /run/user/1000
/dev/mmcblk0p1    261868    6648    255220   3% /media/pi/BPI-BOOT

How to burn Linux image to eMMC

출처 : How to burn Linux image to eMMC
bpi-copy command

이미지 복원

이미지 복원이 완료되면 SD 메모리를 제거하고 재부팅

$ sudo dd if=2018-05-04-ubuntu-16.04-mate-desktop-v1.1-bpi-m2p-sd-emmc.img of=/dev/mmcblk1 bs=10MB
765+1 records in
765+1 records out
7650410496 bytes (7.7 GB, 7.1 GiB) copied, 1054.11 s, 7.3 MB/s

eMMC 용량 확인

pi@bpi-iot-ros-ai:~$ uname -a
Linux bpi-iot-ros-ai 3.4.39-BPI-M2P-Kernel #1 SMP PREEMPT Wed May 2 11:02:30 CST 2018 armv7l armv7l armv7l GNU/Linux
pi@bpi-iot-ros-ai:~$ sudo fdisk -l
Disk /dev/mmcblk0: 7.3 GiB, 7818182656 bytes, 15269888 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
Disklabel type: dos
Disk identifier: 0x8ef6c070

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1      204800   729087   524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      729088 14940159 14211072  6.8G 83 Linux


Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 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 /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 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