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

蜗牛哦 2016-11-18 09:17:37
环境: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
...全文
599 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
蜗牛哦 2016-11-28
  • 打赏
  • 举报
回复
我现在改了被挂载分区的类型为ext3格式,因为ext3格式是journal型格式,数据稳定性比ext2强得多
  • 打赏
  • 举报
回复
用数据库来保存? 而且你这个为什么挂不上就要格式化?那之前的东西不都没了? 弄个循环10次如果挂得上就跳出循环。或者可能因为某些东西没初始化好,在循环中加个sleep?
万能启动u盘制作工具 FbinstTool v1.6 2010年9月更新 www.zzmxkj.cn Get From http://www.burgloader.com/bbs/index.php?topic=54.0 http://www.burgloader.com/bbs/index.php?topic=131.0 FbinstTool 1.602 测试版 for fbinst 1.6 【2010-09-15】 1.修正读取buldr内置菜单的一个小bug 2.修正版本号 3.根据bean大师的提示,完善“设置mbr参数”功能 【2010-09-10】 1.可以在win64位系统下使用 2.修正了备份分区表的一个bug(zxw提出) 3.拖入新的buldr时可以选择是否保留原buldr的内置菜单及prefix值 【2010-09-04】 1。添加右键打包文件夹为fba 2。右键fba解开到当前目录 3。右键ud里面的buldr可以修改prefix参数 4。添加直接编辑buldr的内置菜单(buldr 需是v5m及以上版本) 【2010-08-25】 修正bc12060101发现fbinst菜单的bug fbinst 1.6 正式版 v1: 支持windows vista/7(需要提升至管理员权限),现在格式化后会remount分区,不需要弹出u盘。 support windows vista/7 (needs to run as administrator). It'd remount partition after format, no need to eject flash disk. v2: * 支持大的文件列表。当前缺省值是32640,最大可支持456960。 * 增加缺省启动文件。如果fb里没有配置菜单fb.cfg,则自动启动buldr。 * 支持使用盘符来表示设备,比如: fbinst F: info fbinst F: format (hdN)的形式依然支持,不过使用盘符更加直观。 * Support large file list. Default size is 32640, maximum size is 456960. * Support default boot file. If there is no fb.cfg, it'd boot buldr automatically. * Support the use of drive letter to represent disk drive. For example: fbinst F: info fbinst F: format v3: * 缺省列表使用最大值456960。 * format命令增加参数--chs,强制使用chs模式。这可以用于某些不能自动检测模式的bios。 * info命令新增输出format options,显示格式化参数。 格式化参数只有-p,-e,-l,--zip, --chs, --max-sectors的值,没有数据分区格式化的参数(它们无法自动检测)。而且,如果某一数值和缺省值相同时,将不会显示。-l里显示的数值将上调到510的倍数(实际保存的数值是以扇区为单位的)。 这个版本里磁盘存储结构有较大改变,测试时请用附件里的buldr。附件里的grldr是比较旧的版本,如果需要最新版本的话,请使用#39里chenall的链接。 * Default list size set to 456960 * Add option --chs for format command, which force the boot loader to use chs mode. This option is useful for buggy BIOS that can't detect lba/chs mode properly. * Add "format options" output for info command, it shows the format option used to create the fb structure. Only -p,-e,-l,--zip, --chs, --max-sectors options are shown, options related to the data partition are not shown as they can't be detected properly. If some value is same as default, it's not shown. Moreover, the val

1,318

社区成员

发帖
与我相关
我的任务
社区描述
主要是开发驱动技术
社区管理员
  • 驱动程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧