1 nand scrub

这个命令会擦除坏块信息,将坏块标识成好的,但此时这个坏块有潜在有危险,在特定条件下仍会造成数据的丢失,所以应该谨慎使用.

Run U-boot and then use the following commands to clean the NAND device.

  1. Run the command nand bad to generate a list of the blocks on the device that the driver believes to be bad. Keep a copy of this list—it will be used later to remark the bad blocks manually.

  2. For each of the bad blocks on the list, run: nand dump <block-number>

  3. If the output of the dump command looks like "real" data, then it is safe to assume that it is a good block. If the block is all zeros (both in-band and out-of-band) then it is very likely to be a genuinely bad block. Keep a record of all the blocks that are genuinely bad.

  4. Run nand scrub to erase ALL of the blocks on the NAND device. This will also set most of the bad blocks to "good".

  5. Run nand bad again to obtain a revised list of bad blocks. Compare this list with the list of "genuinely bad" blocks (that is, blocks containing all zeros), obtained at step 3.

  6. For each block on the "genuinely bad" list that is no longer marked as bad by nand bad, run nand markbad &lt;block-number&gt;

Simply running nand scrub without first identifying which blocks are genuinely bad (using nand bad and nand markbad commands, as described above) will silently convert soft bad blocks to false good blocks, which will cause unrecoverable problems with reading and writing data.

2 mtdparts

The mtdparts command offers an easy to use and powerful interface to define the contents of the environment variable of the same name that can be passed as boot argument to the Linux kernel:

=> help mtdparts
mtdparts
- list partition table
mtdparts delall
- delete all partitions
mtdparts del part-id
- delete partition (e.g. part-id = nand0,1)
mtdparts add <mtd-dev> <size>[@<offset>] [<name>] [ro]
- add partition
mtdparts default
- reset partition table to defaults

大家都知道nand flahs 是有坏块的,假设有两个分区P1(block0,block1),P2(block2,block3,)假设要写一个数据(大小为2block),则会写到P1的block0,block1上.

但此时,如果block1为坏块,则数据会写至block0,block2,跳过坏块block1,但此时数据横跨两个区.

为了避免这种情况,可以使用这个命令:mtdparts.此时uboot 会进行边界检查,上例这种情况数据只会写到block0中,不会写至block2中.

几个Uboot命令的更多相关文章

  1. 1.ok6410移植bootloader,移植u-boot,学习u-boot命令

    ok6410移植u-boot 既然是移植u-boot当然首先需要u-boot源码,这里的u-boot代码是由国嵌提供的. 一.配置编译u-boot A. 解压 u-boot 压缩文件 B. 进入解压生 ...

  2. U-Boot命令大全(功能参数及用法)

    U-Boot上电启动后,按任意键可以退出自动启动状态,进入命令行. U-Boot 2010.03 (Sep 25 2011 - 16:18:50)     DRAM: 64 MB     Flash: ...

  3. uboot命令分析+实现【转】

    转自:http://xouou.iteye.com/blog/2150061 先贴一个重要结构,位于uboot/include/command.h,这个结构代表每个uboot命令 struct cmd ...

  4. 编译u-boot命令和u-boot常用命令

    一.编译u-boot命令 1.配置开发板 #make TQ2440_config 2.编译 #make all 3.交叉编译器是crosstools_3.4.5_softfloat” 使用4.3.3版 ...

  5. bootargs中的环境变量说明和一些常用的uboot命令

    bootargs中的环境变量说明和一些常用的uboot命令 一些常见的uboot命令:Help [command]在屏幕上打印命令的说明Boom [addr]启动在内存储器的内核Tftpboot通过t ...

  6. Uboot mmc命令解析&NAND flash uboot命令详解

    转载:http://blog.csdn.net/simonjay2007/article/details/43198353 一:mmc的命令如下: 1:对mmc读操作 mmc read addr bl ...

  7. securecrt中进入uboot命令行时,出现无法键入任何指令的问题解决方法

    securecrt中进入uboot命令行时,出现无法键入任何指令的问题解决方法 可能出现以下几种情况 1.securecrt在创建连接时,忘记取消勾选流控: 2.usb转串口线坏了3.uboot有问题 ...

  8. uboot命令(1):mmc命令

    版权声明 更新:2017-06-07博主:LuckyAlan联系:liuwenvip163@163.com声明:吃水不忘挖井人,转载请注明出处! 1 文章介绍 今天在进行Android分区修改的时候发 ...

  9. Uboot命令U_BOOT_CMD分析

    其中U_BOOT_CMD命令格式如下: U_BOOT_CMD(name,maxargs,repeatable,command,"usage","help") 各 ...

  10. Uboot 命令行 介绍

    背景 基本上,本文转载自:<ARM板移植Linux系统启动(五)Uboot命令行> 上次说到uboot的启动方式,最后会使用autoboot(自主模式)尝试引导kernel,如果失败或者被 ...

随机推荐

  1. Java——(四)Collection之Set集合TreeSet类

    ------Java培训.Android培训.iOS培训..Net培训.期待与您交流! ------- TreeSet类 TreeSet是SortedSet接口的实现类,正如SortedSet名字所暗 ...

  2. SQL server 如何修改登录名和密码

    No :1 启动SQL Server Management Studio,用windows登录进入: No :2 在左侧对象资源处理器中找到根节点,也就是你安装sqlserver时注册的服务器名称.然 ...

  3. oracle服务器端-登陆

    由于的的操作系统是windows server版本,所以想装服务器端的server版本,一般的oracle都有'scott'用户,但是貌似服务器端的没有该用户,我用以下方式登陆: sqlplus / ...

  4. MySQL性能测试工具之mysqlslap使用详解

    mysqlslap是mysql自带的基准测试工具,优点:查询数据,语法简单,灵活容易使用.该工具可以模拟多个客户端同时并发的向服务器发出查询更新,给出了性能测试数据而且提供了多种引擎的性能比较.msq ...

  5. angularjs 遇到Error: [$injector:unpr] Unknown provider: tdpicnews-serviceProvider <- tdpicnews-service <- tdpic-controller 错误

    define(['modules/tdpic-module', 'services/news-service', 'utilities/cryto'], function (app) { 'use s ...

  6. 40个DBA日常维护的SQL脚本--1113

    from itpub --1.查询碎片程度高的表--条件为什么block>100,因为一些很小的表,只有几行数据实际大小很小,但是block一次性分配就是5个(11g开始默认一次性分配1M的bl ...

  7. iOS 常见错误:CALayer position contains NaN: [14 nan]

    Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contai ...

  8. 通用数据挖掘[ZZ]

    一.什么是数据挖掘?许多人认为数据挖掘更像是一门哲学,或数学的组成部分,而不是业务需求的实际解决方案.您可以从采用的各种定义中看出这一点,例如:“数据挖掘是对非常大型的数据进行的研究和分析,采用自动或 ...

  9. Windows 8 / 8.1 禁用驱动签名最详细图文教程

    Windows 8 鼠标右上角/右下角弹出边栏,选择“设置” 点击“更改电脑设置”: 选择“常规”,右侧拖到底,点击“高级启动”-“立即重启”: 稍后进入恢复页面,选择“疑难解答” 进入疑难解答后,选 ...

  10. Servlet监听器类型

    ------------------------serlvet对象监听器------------------------------------------- request监听器(ServletRe ...