System.img 太大了

hi,我在生成system.img发现文件太大了,但是实际只有6.9G,为什么会这么大呢?
方法如下:

sudo BOARDID=3834  FAB=400 BOARDSKU=0008 BOARDREV=G.5 CHIP_SKU="00:00:00:A0"  ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash --massflash 5 jetson-agx-thor-devkit internal

查看system.img如下:
jyh@jyh-ThinkPad-T14p-Gen-3:~/work/Linux_for_Tegra$ ll bootloader/system.img -lh
-rw-r–r-- 1 root root 55G Nov 24 15:01 bootloader/system.img

May I know how do you know “it is actually 6.9G”?

看Linux_for_tegra/rootfs目录下的大小


另外也可以系统烧录之后可以看到

Some listings are for exact byte size, e.g., “ls -a”. Others are “human” adjusted for either powers of 10 (e.g., 10 GB is “10 x 10^9” exactly), or powers of 2 in groups of 1024 (e.g., 10 GiB which is “10 x 1024^3”; “1024” is “KiB”, “1024x1024” is “MiB”, and “1024x1024x1024” is “GiB”). The summary you see as 6.9G is not an exact size, at least not down to the last byte. Only use “ls -l” on files to see exact size.

When a filesystem is created (system.img is a sparse filesystem; system.img.raw is a raw filesystem) there are also overhead bytes to support the ext4 filesystem. Between blocks and sectors not all bytes of the disk spanned by the partition go to files, and free bytes change, while used bytes may also change in some way. system.img.raw must be the exact size of the partition, and in the case of a 4096 byte block size used in Thor, this means your system.img.raw size must be an exact multiple of 4096 bytes (as measured by “ls -l system.img.raw”).

If you want to see what is actually there you can loopback mount system.img.raw and run various statistics on that.

Hi,

Please check what is the result of

ls -lh tools/kernel_flash/images/external/system.img

on your host PC BSP directory.

This is the true system image got flashed to your board.

hi,bootloader/system.img在make massflash package也会生成,高达55G,
我在JetPack5 and JetPack6 上并没有遇到这个问题,只有JetPack7遇到了这个问题,难道不是软件bug吗?

Please note that the workflow to generate the system.img and system.img.raw getting changed in Jetpack 7.
The main reason is that we don’t sparse the system image to reduce the flashing time.

Yes, we know the size of bootloader/system.img is 55GB as it is specified by the ROOTFSSIZE and it is a logical size reading by ls -lh. You can simply run the du -hs <Linux_for_Tegra>/bootloader/system.img and you will get the actual physical size on disk which should be much smaller than 55GB.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.