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

來源:互聯網
上載者:User

(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

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 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...............

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.