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.

在nand中的一个分区保存数据,为什么出现input/output error?


环境:dm8168 + dvrrdk4.0.2
我现在想在嵌入式linux开发板根目录下新建一个/Userdata目录,然后把/dev/mtdblock7挂载到/Userdata
在/Userdata保存应用程序的配置数据,可是有时候断电再送电 保存在 /Userdata目录的文件打不开
出现input/output error,请问是为什么?
如果这种方法不行,想要在一个分区中保存数据,还有没有其他方法?
下面是我系统启动的时候运行的脚本

mkdir /Userdata
chmod -R 777 /Userdata
mount -t ext2 /dev/mtdblock7 /Userdata -o sync
if [ $? -eq 0 ]
then
echo "this is N time to use"
else
echo "this is first to use"
mkfs.ext2 /dev/mtdblock7
mount -t ext2 /dev/mtdblock7 /Userdata -o sync
fi