尝试将 jffs2 映像挂载到虚拟块设备中,如下所示本指南
步骤如下,总结如下:
sudo mknod /tmp/mtdblock0 b 31 0
sudo modprobe mtdblock
sudo modprobe mtdram total_size=265536 erase_size=256 # actual total_size used in the command is different as per need
sudo modprobe jffs2
sudo dd if=/home/myuser/Downloads/jffs2File of=/tmp/mtdblock0
sudo mkdir /media/jffs2-extracted
sudo mount -t jffs2 /tmp/mtdblock0 /media/jffs2-extracted
最后一步 ( mount
) 出现错误,并且 中没有安装任何内容/media/jffs2-extracted
。我dmesg
可以看到这些消息(和类似的消息)重复了几次:
jffs2_scan_eraseblock(): Magic bitmask 0x#### not found at 0x########: 0x#### instead
Old JFFS2 bitmask found at 0x You cannot use older JFFS2 filesystems with newer kernels
然后我加大了指挥erase_size
力度sudo modprobe mtdram total_size=265536 erase_size=256
,重复的错误jffs2_scan_eraseblock(): Magic bitmask 0x#### not found at 0x########: 0x#### instead
就消失了;但这一次出现了这个错误:
Old JFFS2 bitmask found at 0x You cannot use older JFFS2 filesystems with newer kernels
Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
如何找出erase_size
在命令中使用的正确值?是相对于total_size
inmodeprobe mtdram
吗?如果是这样,我该如何erase_size
计算total_size
?