U-Boot中ubi和ubifs命令的使用

来源:互联网 发布:网络口语 编辑:程序博客网 时间:2024/06/05 08:11

(1)查看MTD分区表U-Boot$mtdpartsmtdparts variable not set, see 'help mtdparts'no partitions defineddefaults:mtdids : nand0=nandflash0mtdparts: mtdparts=nandflash0:1536k(bootloder),512k(params),4m(kernel),16m(safefs),-(rootfs)

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

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

(4)挂载分区 U-Boot$ubifsmount safefsUBIFS: recovery neededUBIFS: recovery deferredUBIFS: mounted UBI device 0, volume 0, name "safefs"UBIFS: mounted read-onlyUBIFS: 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: LZOUBIFS: reserved for root: 0 bytes (0 KiB)

(5)查看分区的内容 U-Boot$ubifsls

3840 Tue Apr 20 07:42:09 2010 bin 480 Fri Aug 28 02:32:54 2009 dev 2416 Thu Jan 01 00:18:47 1970 etc 5464 Tue Apr 20 07:54:28 2010 lib 480 Tue Apr 20 07:42:01 2010 mnt 160 Fri Aug 28 01:37:57 2009 opt 224 Tue Apr 20 09:19:29 2010 tmp 160 Fri Aug 28 01:37:57 2009 sys 736 Thu Feb 26 07:25:19 2009 var 608 Fri Aug 28 02:32:54 2009 usr 296 Fri Aug 28 01:37:57 2009 boot 224 Tue Apr 20 07:42:01 2010 home 160 Fri Aug 28 01:37:57 2009 proc 2528 Tue Sep 14 08:50:07 2010 sbin 160 Fri Aug 28 01:37:57 2009 root 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 readmeLoading file 'readme' to addr 0x80008000 with size 52 (0x00000034)...DoneU-Boot$md 8000800080008000: 65666173 66207366 6120726f 4c206c6c safefs for all L80008010: 32334350 42203035 6472616f 200a2e73 PC3250 Boards..80008020: 20202020 32202020 2d303130 302d3730 2010-07-080008030: 0a0a0a31 00000000 00000000 00000000 1...............

原创粉丝点击