Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1228381
  • 博文数量: 479
  • 博客积分: 12240
  • 博客等级: 上将
  • 技术积分: 4999
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-24 17:12
文章分类

全部博文(479)

文章存档

2014年(1)

2013年(1)

2012年(1)

2011年(95)

2010年(177)

2009年(167)

2008年(16)

2007年(21)

分类: 嵌入式

2010-09-16 13:11:26



(1)查看MTD分区表U-Boot$mtdparts
mtdparts variable not set, see 'help mtdparts'
no partitions defined

defaults:
mtdids : nand0=nandflash0
mtdparts: mtdparts=nandflash0:1536k(bootloder),512k(params),4m(kernel),16m(safef
s),-(rootfs)

(2)载入默认分区表  U-Boot$mtdparts default

(3)激活分区 U-Boot$ubi part safefs
Creating 1 MTD partitions on "nand0":
0x000000600000-0x000001600000 : "mtd=3"
device_name0:mtd=3
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
scanning error 0
UBI: attached mtd1 to ubi0
UBI: MTD device name: "mtd=3"
UBI: MTD device size: 16 MiB
UBI: number of good PEBs: 127
UBI: number of bad PEBs: 1
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 0
UBI: total number of reserved PEBs: 127
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 4/1

查看当前激活的分区:
U-Boot$ubi part
Device 0: nand0, partition safefs

(4)挂载分区 U-Boot$ubifsmount safefs
UBIFS: recovery needed
UBIFS: recovery deferred
UBIFS: mounted UBI device 0, volume 0, name "safefs"
UBIFS: mounted read-only
UBIFS: file system size: 14192640 bytes (13860 KiB, 13 MiB, 110 LEBs)
UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
UBIFS: reserved for root: 0 bytes (0 KiB)

(5)查看分区的内容 U-Boot$ubifsls
<DIR> 3840 Tue Apr 20 07:42:09 2010 bin
<DIR> 480 Fri Aug 28 02:32:54 2009 dev
<DIR> 2416 Thu Jan 01 00:18:47 1970 etc
<DIR> 5464 Tue Apr 20 07:54:28 2010 lib
<DIR> 480 Tue Apr 20 07:42:01 2010 mnt
<DIR> 160 Fri Aug 28 01:37:57 2009 opt
<DIR> 224 Tue Apr 20 09:19:29 2010 tmp
<DIR> 160 Fri Aug 28 01:37:57 2009 sys
<DIR> 736 Thu Feb 26 07:25:19 2009 var
<DIR> 608 Fri Aug 28 02:32:54 2009 usr
<DIR> 296 Fri Aug 28 01:37:57 2009 boot
<DIR> 224 Tue Apr 20 07:42:01 2010 home
<DIR> 160 Fri Aug 28 01:37:57 2009 proc
<DIR> 2528 Tue Sep 14 08:50:07 2010 sbin
<DIR> 160 Fri Aug 28 01:37:57 2009 root
<LNK> 11 Tue Sep 14 08:24:07 2010 linuxrc
              706 Wed Sep 15 08:47:30 2010 burn.usb
               52 Wed Jun 30 06:30:21 2010 readme
              697 Wed Sep 15 08:47:43 2010 burn.cf
              664 Wed Sep 15 08:47:17 2010 burn.sd

(6)查看某个文件 U-Boot$ubifsload 80008000 readme
Loading file 'readme' to addr 0x80008000 with size 52 (0x00000034)...
Done
U-Boot$md 80008000
80008000: 65666173 66207366 6120726f 4c206c6c safefs for all L
80008010: 32334350 42203035 6472616f 200a2e73 PC3250 Boards..
80008020: 20202020 32202020 2d303130 302d3730 2010-07-0
80008030: 0a0a0a31 00000000 00000000 00000000 1...............


阅读(6357) | 评论(0) | 转发(3) |
给主人留下些什么吧!~~