OverlayFS是一种堆叠文件系统。如图:(图片源自网络)
如果系统的软件包空闲空间不够,则需要扩容。
本文的方案是在固件包上进行扩容。
在镜像文件后面增加空数据,比如增加5GB:
dd if=/dev/zero bs=1G count=5 >> 固件.img
此时查看固件文件大小,可看出文件大小增加了5G。
现在执行分区命令:
parted 固件.img
查看分区情况,以确定需要扩容的分区号:
print
此时如果报错(没报错则请忽略): Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
OK/Cancel?
则输入OK,敲回车。
如果紧接着报警告(没报则请忽略):Warning: Not all of the space available to xx.img appears to be used, you
can fix the GPT to use all of the space (an extra xx blocks) or continue with the current setting?
Fix/Ignore?
则输入Fix,敲回车。
以上图为例,应选择300M的分区号,比如是2:
resizepart 2 100%
最后退出:
quit
即完成了扩容。