This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具与软件:
您好!
我通过 DFU 刷新了32GB EMMC。
之后、使用 df 命令检查大小、确认大小约为6GB。
是否有办法使用剩余容量?
您好、Kim、
请说明您是如何为 eMMC 创建 rootfs 映像的?
您好、Liu
$ CD /filesystem
$ dd if=rootfs.ext4 /dev/null bs=1M seek=6000
$ mkfs.ext4 -F rootfs.ext4
$ mkdir mnt_fs
$ sudo mount -t ext4 rootfs.ext4 mnt_fs
$ CD mnt_fs
$ sudo tar xvf ../tisdk-edgeai-image-am62axx-evm.tar.xz
$ CD ...
$ sudo umount_fs
使用上述命令、我创建了一个 ext4文件并执行了 DFU 闪存。
您好、Kim、
从 eMMC 引导 Linux 后、可以使用 resze2fs 命令扩展 eMMC rootfs。 请参阅下面随附的脚本。
您好、Liu、
未显示可用空间。
您好、Liu
脚本不起作用、但我用 resze2fs 命令解决了问题。
谢谢你
您好、Kim、
我从 SDK rootfs 映像获得了该脚本。 它可能不会直接适用于此用例。
您能解释一下如何使用 resze2fs 命令解决问题吗?
您好、Liu、
当执行 parted 时,找不到可用空间,所以我修改了命令 df
FREE_SPACE=`parted /dev/$BOOT_DEV unit '%' print free | grep 'Free Space' | tail -n1 | awk '{print $3}'` if [[ ${FREE_SPACE%.*} -gt 0 ]]; then echo "$FREE_SPACE of /dev/$BOOT_DEV is free. Extending partition #2" echo ",+" | sfdisk -N 2 /dev/$BOOT_DEV --no-reread partprobe resize2fs /dev/$ROOT_PART fi
AVAIL_SPACE=`df -h | tail -n 1 | awk '{print $5}' | sed -e s/%//g ` if [[ ${AVAIL_SPACE} -eq 0 ]]; then echo ",+" | sfdisk -N 2 /dev/mmcblk0 --no-reread > /dev/null 2>&1 partprobe resize2fs /dev/$ROOT_PART > /dev/null 2>&1 fi
此致、
Kim
感谢您分享您的解决方案。