This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

制作Ubifs文件系统时,-F选项无法使用

参考论坛上的《Ubifs文件系统的制作和启动.pdf》制作镜像文件,之前的步骤都正常。生成镜像时:

mkfs.ubifs -F -q -r /home/usr/rootfs_2_0_1 -m 2048 -e 126976 -c 2047 -o ubifs.img

此时提示-F选项无法使用。此时的打印如下

mkfs.ubifs: invalid option -- 'F'
Usage: mkfs.ubifs [OPTIONS] target
Make a UBIFS file system image from an existing directory tree

Examples:
Build file system from directory /opt/img, writting the result in the ubifs.img file
mkfs.ubifs -m 512 -e 128KiB -c 100 -r /opt/img ubifs.img
The same, but writting directly to an UBI volume
mkfs.ubifs -r /opt/img /dev/ubi0_0
Creating an empty UBIFS filesystem on an UBI volume
mkfs.ubifs /dev/ubi0_0

Options:
-r, -d, --root=DIR build file system from directory DIR
-m, --min-io-size=SIZE minimum I/O unit size
-e, --leb-size=SIZE logical erase block size
-c, --max-leb-cnt=COUNT maximum logical erase block count
-o, --output=FILE output to FILE
-j, --jrn-size=SIZE journal size
-R, --reserved=SIZE how much space should be reserved for the super-user
-x, --compr=TYPE compression type - "lzo", "favor_lzo", "zlib" or
"none" (default: "lzo")
-X, --favor-percent may only be used with favor LZO compression and defines
how many percent better zlib should compress to make
mkfs.ubifs use zlib instead of LZO (default 20%)
-f, --fanout=NUM fanout NUM (default: 8)
-k, --keyhash=TYPE key hash type - "r5" or "test" (default: "r5")
-p, --orph-lebs=COUNT count of erase blocks for orphans (default: 1)
-D, --devtable=FILE use device table FILE
-U, --squash-uids squash owners making all files owned by root
-l, --log-lebs=COUNT count of erase blocks for the log (used only for
debugging)
-v, --verbose verbose operation
-V, --version display version information
-g, --debug=LEVEL display debug information (0 - none, 1 - statistics,
2 - files, 3 - more details)
-h, --help display this help text

将-F参数去掉的话,会继续提示-q参数不可用。将上述两个参数都去掉才能生成镜像。对于8168,这样的镜像是否可用?

参考http://www.360doc.com/content/14/1015/18/18578054_417224516.shtml使用了最新版本的mtd-utils,结果还是一样

参考http://www.qiyangtech.com/news/arm-development-board-faq2-c0eji0c9yhybra01.html检查了mkfs.ubifs工具和文件系统的路径,未发现异常。

mtd-utils的版本:mtd-utils-1.5.2

库版本分别是e2fsprogs-1.42.13,zlib-1.2.8,lzo-2.06

ubuntu版本:10.04 LTS

ubuntu内核版本是2.6.32

  • 你好,

    你使用的是文档里面链接里面最新的工具,还是就是文档里面使用的工具版本?会否是版本匹配问题。

    ubuntu10.04应该是没有问题的。现在的问题和你使用的芯片也没有直接关系。

  • 谢谢关注!

    论坛pdf资料里提到的链接,并没有一个确定的版本号。自己找的另外一个链接,也就是主贴提到的那个网址。版本号号称是1.5.2

  • 更换了一下版本

    zlib-1.2.5

    lzo-2.06

    e2fsprogs-1.42

    mtd-utils-1.5.1

    不过问题依旧

  • 问题找到了:mkfs.ubifs和ubinize用法不对。之前没有加"./",这样使用的就是本机的mkfs.ubifs和ubinize。加上"./"后,问题解决

    使用的命令参数如下

    ./mkfs.ubifs -F -q -r /home/cx/DVRRDK_04.00.00.03/target/rootfs_2_0_1 -m 2048 -e 126976 -c 2047 -o ubifs.img

    ./ubinize -o ubi.img -m 2048 -p 128KiB ubinize.cfg

    可以用-V参数来确认mkfs.ubifs的版本

    本机版本:mkfs.ubifs -V

    Version 1.3

    要使用的版本:./mkfs.ubifs -V
    mkfs.ubifs 1.5.2