Question about ubimkvol vs. mkfs.ubifs

Artem Bityutskiy dedekind at infradead.org
Mon Apr 7 03:27:22 EDT 2008


Hi,

On Sun, 2008-04-06 at 16:53 -0700, Bruce_Leonard at selinc.com wrote:
> This is probably a basic question but I'll admit to being lost.  I'm 
> relatively new to kernel coding and up till now I've been focused on the 
> very low level stuff, i.e., making hardware work and LEDs go 
> blinkey-blinkey.  Currently I'm working on a NAND flash driver that I need 
> to tie into UBI/UBIFS.  I've got the driver working, I can 
> read/write/erase my flash parts, so the low level stuff that I understand 
> is good. 

Is it a secret what is your flash and what is its size? If it is NAND
I'd recommend you to test it with Adrian's NAND tests:
git://infradead.org/~ahunter/nand-tests.git

> insmod my_flash_driver
> insmod ubi mtd=1
> insmod ubifs
> ubimkvol /dev/ubi0 -m -N ubifs
> mount -t ubifs ubi0:ubifs /mnt/nand

> Once I do all that I can read/write/copy/delete/etc files just fine on the 
> NAND flash.  So, like I said it appears to be working just fine.  But 
> everything I see on the mailing list seems to be saying I should be using 
> mkfs.ubifs.  But if everything works and I'm mounting the device as a 
> UBIFS filesystem, what (if anything) is mkfs.ubifs going to do for me that 
> I don't already have done?

As Hamish explained, you do not have to use mkfs.ubifs if you do not
need it. UBIFS can mount empty volumes just fine. 

In addition to what he said, mkfs.ubifs allows you to tune the
file-system. When you mount an empty volume, UBIFS formats it with
default settings: default journal size, default B-tree fanout, default
compression, etc. With mkfs.ubifs you may define different parameters,
e.g., use zlib instead of lzo, make larger journal, etc.

> Oh, another question.  I've seen reference to an 'fs-test' that's supposed 
> to be part of mtd-utils, but I can't seem to find it anywhere.  Can 
> someone please point me to the sources?  Is it a good test to run?

These are old tests Adrian wrote for JFFS2 and they sit at
mtd-utils.git/tests/fs-tests/. Some of the stress test scripts are
JFFS2-specific - you will notice. But they are easy to fix - just make
them not to run the "gcd_hupper" program. This is the only
JFFS2-specific thing.

Yes, I think this is a good idea to run them. Specifically, we are
extensively using the integrity test for UBIFS.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list