这里使用两种烧录方式,一种是PhoenixSuit官方烧录,参考MaixII M2dock 烧录系统,第二种是类似树莓派直接烧写镜像的方式。官方的讲解很完善了,这里主要讲第二种。由于win10烧录会导致GPT分区表错误,并且涉及到调整分区,这里将在linux系统下进行。
## 烧录程序
采用流行的Etcher
SDCardFormatter,这里用的win10的软件,根据个人爱好自行选择
sudo fdisk -l,出现如下设备/dev/sdb1        8192 7744511 7736320  3.7G  b W95 FAT32
即挂载成功。
gzip -dc v831.img.gz |sudo dd of=/dev/sdb bs=1M status=progress
烧录完毕后,执行执行sudo fdisk -l,出现如下设备
/dev/sdb1   49152  49663     512  256K Microsoft basic data
/dev/sdb2   49664  61951   12288    6M Microsoft basic data
/dev/sdb3   61952 324095  262144  128M Microsoft basic data
/dev/sdb4  324096 487935  163840   80M Microsoft basic data
即烧录完毕。
sudo fdisk /dev/sdb p n 回车 回车 w)lithromantic@ubuntu:~/Desktop$ sudo fdisk /dev/sdb
Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
GPT PMBR size mismatch (499711 != 7744511) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Command (m for help): p
Disk /dev/sdb: 3.69 GiB, 3965190144 bytes, 7744512 sectors
Disk model: Storage Device  
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: gpt
Disk identifier: AB6F3888-569A-4926-9668-80941DCB40BC
Device      Start    End Sectors  Size Type
/dev/sdb1   49152  49663     512  256K Microsoft basic data
/dev/sdb2   49664  61951   12288    6M Microsoft basic data
/dev/sdb3   61952 324095  262144  128M Microsoft basic data
/dev/sdb4  324096 487935  163840   80M Microsoft basic data
Command (m for help): n
Selected partition 5
First sector (487936-7744508, default 489472): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (489472-7744508, default 7744508): 
Created a new partition 5 of type ‘Linux filesystem‘ and of size 3.5 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
lithromantic@ubuntu:~/Desktop$ 
sudo mkfs -t ext4 /dev/sdb5BusyBox v1.27.2 () built-in shell (ash)
------run profile file-----
   __  ___     _        __   _               
  /  |/  /__ _(_)_ __  / /  (_)__  __ ____ __
 / /|_/ / _ `/ /\ \ / / /__/ / _ \/ // /\ \ /
/_/  /_/\_,_/_//_\_\ /____/_/_//_/\_,_//_\_\ 
 ----------------------------------------------
root@sipeed:/# 
执行fdisk -l,出现
Number  Start (sector)    End (sector)  Size Name
     1           49152           49663  256K env
     2           49664           61951 6144K boot
     3           61952          324095  128M rootfs
     4          324096          487935 80.0M swap
     5          489472         7744508 3542M 
mount /dev/mmcblk0p5 /home/home路径下,可以自行修改。执行df查看效果:root@sipeed:/home# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root               125460     73284     49556  60% /
tmpfs                    29864        12     29852   0% /tmp
none                     29796         0     29796   0% /dev
/dev/mmcblk0p5         3504908     14172   3292980   0% /home
永久挂载:echo /dev/mmcblk0p5 /home ext4 defaults 0 0 >> /etc/fstab
原文:https://www.cnblogs.com/USTHzhanglu/p/14845774.html