ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

v831 dd镜像制做及扩容脚本的使用

2021-10-20 23:01:13  阅读:206  来源: 互联网

标签:v831 help img dd Partition sh Command 制做


准备工作

linux操作系统电脑一台

Windows操作系统电脑一台

读卡器一枚

512M tf卡一张

PhoenixCard v4.26

balenaEtcher

Maix Ⅱ dock

resize.sh

resize_root.sh

烧录镜像

首先获取原始镜像下载站 - Sipeed,解压后使用PhoenixCard 烧录到tf卡中。

然后将tf卡插入linux操作系统电脑中。

导出镜像:sudo dd if=/dev/sdb of=dd.img status=progress

导出dd镜像后,使用fdisk修改分区信息。

~ fdisk dd.img    

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.
#删除分区5
Command (m for help): d 
Partition number (1-5, default 5): 

Partition 5 has been deleted.
#删除分区4
Command (m for help): d
Partition number (1-4, default 4): 4

Partition 4 has been deleted.
#新增分区4
Command (m for help): n
Partition number (4-8, default 4): 
#设置起始扇区
First sector (225792-983036, default 227328): 225792
#设置大小300M
Last sector, +/-sectors or +/-size{K,M,G,T,P} (225792-983036, default 983036): +300M

Created a new partition 4 of type 'Linux filesystem' and of size 299.8 MiB.
删除分区文件系统签名
Partition #4 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: y

The signature will be removed by a write command.
#保存文件
Command (m for help): w
The partition table has been altered.
Syncing disks.

制作dd镜像,将reseze_root.sh,dd.img 放到同一个文件夹中,使用./resize_root.sh ./dd.img ./ v831.img将dd.img转化为v831.img.xz

(base) ~ ❯ ./resize_root.sh ./dd.img ./ v831.img
input_addr=./dd.img,output_addr=./, name is v831.img

you can run xx.sh <intputaddr> <outputaddr> <name> to specify them or use defult
Such as 
dd.sh ./dd.img /root test.img 
or
dd.sh ./dd.img
losetup: /dev/loop404: detach failed: No such device or address

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.


Command (m for help): -: unknown command

Command (m for help): 

Command (m for help): 
Expert command (m for help): Partition number (1-4, default 4): 
New name: 
Partition name changed from '' to 'rootfs'.

Expert command (m for help): Partition number (1-4, default 4): 
New UUID (in 8-4-4-4-12 format): 
Partition UUID changed from 0B8BFEAD-2829-554C-9E98-73EEBA7EB79B to A0085546-4166-744A-A353-FCA9272B8E48.

Expert command (m for help): 
Command (m for help): 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 partx(8).

e2fsck 1.45.7 (28-Jan-2021)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
Backing up journal inode block information.

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure                                           
Pass 3: Checking directory connectivity                                        
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (0, counted=8324).
Fix? yes

Free inodes count wrong (0, counted=1872).                                     
Fix? yes

Padding at end of inode bitmap is not set. Fix? yes


/dev/loop404p4: ***** FILE SYSTEM WAS MODIFIED *****
/dev/loop404p4: 4144/6016 files (0.0% non-contiguous), 42876/51200 blocks
resize2fs 1.45.7 (28-Jan-2021)
Resizing the filesystem on /dev/loop404p4 to 76736 (4k) blocks.
The filesystem on /dev/loop404p4 is now 76736 (4k) blocks long.

Compressing the mirror takes some time, and you can use <progress -m> at other terminals to see progress
all ok,use xz -dc v831.img.xz |sudo dd of=/dev/sdb bs=1M status=progress oflag=direct to create a tf Startup Disk
(base) ~ ❯ 

现在得到了v831.img.xz,将该文件移动到windows操作系统电脑上,通过balenaEtcher烧录到另外一张大一些的卡里

扩容磁盘大小

resize.sh导入到Maix Ⅱ dock中。

执行resize.sh,按照提示进行即可。

标签:v831,help,img,dd,Partition,sh,Command,制做
来源: https://www.cnblogs.com/USTHzhanglu/p/15431249.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有