ArticleslgStudy

science

UBIFS

UBIFS is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand UBIFS rather than just read about it. In short: UBIFS (UBI File System, more fully Unsorted Block Image File System) is a flash file system for unmanaged flash memory devices. UBIFS works on top of an UBI (unsorted block image) layer, which is itself on top of a memory technology device (MTD) layer.

Key takeaways

  • UBIFS belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect UBIFS to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of UBIFS from memory before moving on to harder problems.

Reference excerpt

UBIFS (UBI File System, more fully Unsorted Block Image File System) is a flash file system for unmanaged flash memory devices. UBIFS works on top of an UBI (unsorted block image) layer, which is itself on top of a memory technology device (MTD) layer. The file system is developed by Nokia engineers with help of the University of Szeged, Hungary. Development began in earnest in 2007, with the first stable release made to Linux kernel 2.6.27 in October 2008.

Two major differences between UBIFS and JFFS2 are that UBIFS supports write caching, and UBIFS errs on the pessimistic side of free space calculation. UBIFS tends to perform better than JFFS2 for large NAND flash memory devices. This is a consequence of the UBIFS design goals: faster mounting, quicker access to large files, and improved write speeds. UBIFS also preserves or improves upon JFFS2's on-the-fly compression, recoverability and power fail tolerance. UBIFS's on-the-fly data compression allows zlib (deflate algorithm), LZO or Zstandard. UBIFS stores indexes in flash whereas JFFS2 stores filesystem indexes in memory. This directly impacts the scalability of JFFS2 as the tables must be rebuilt every time the volume is mounted. Also, the JFFS2 tables may consume enough system RAM that some images may be unusable.

UBI UBI (Unsorted Block Images) is an erase block management layer for flash memory devices. UBI serves two purposes, tracking NAND flash memory bad blocks and providing wear leveling. Wear leveling spreads the erases and writes across the entire flash device. UBI presents logical erase blocks to higher layers and maps these to physical erase blocks. UBI was written specifically for UBIFS so that UBIFS does not have to deal with wear leveling and bad blocks. However, UBI may also be useful with squashfs and NAND flash; squashfs is not aware of NAND flash bad blocks. UBI's documentation explains that it is not a complete flash translation layer (FTL). Although a FTL also handles bad blocks and wear leveling, the interface a FTL provides is a block device with small (typically 512 bytes) sectors that can be written completely independently. In contrast, UBI's interface directly exposes erase blocks and programmable pages (which are different sizes, and much larger than typical block device sectors), and filesystems that use UBI must be aware of the sizes and restrictions on how blocks must be erased before being written. UBI is in some ways analogous to a Logical Volume Manager. In typical usage, rather than partitioning flash into fixed regions, a single UBI device spans the entire flash (except for perhaps a few pages in fixed locations reserved for the bootloader), and multiple volumes are created within the UBI device. This allows wear-leveling to be spread across the whole flash, even if some volumes are written more frequently than others. UBI volumes can be static (which contain a whole file or image written once and protected by CRC-32 by UBI) or dynamic (which contain a read-write filesystem that is responsible for its own data integrity). The only filesystem that directly supports UBI is UBIFS, but using gluebi it's possible to emulate a MTD device, which can then be used to run other flash filesystems like JFFS2 and YAFFS, and using ubiblk it's possible to emulate block devices, which can run common filesystems like Ext4.

Fastmap UBI was augmented in Linux 3.7 with fastmap support. Fastmap maintains an on-disk version of information previously created in memory by scanning the entire flash device. The code falls back to the previous mechanism of a full scan on failures and older UBI systems will simply ignore the fastmap information.

See also List of file systems Comparison of file systems JFFS2

References

External links Home page University of Szeged: UBIFS Archived 28 September 2013 at the Wayback Machine UBIFS experiments on the XO Laptop (One Laptop per Child) UBIFS file system

Worked examples

Example 1 — a first encounter with UBIFS

Start with the simplest possible case. Write down what UBIFS claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to UBIFS before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about UBIFS ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of UBIFS

In research
UBIFS appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses UBIFS in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
UBIFS is common in secondary-school and first-year university syllabi. It links to neighbouring topics Embedded Linux, Flash file systems supported by the Linux kernel, Free special-purpose file systems, so understanding it makes those chapters shorter.
In everyday life
Look for UBIFS outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “UBIFS” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study UBIFS in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what UBIFS means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain UBIFS out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is UBIFS in simple terms?

UBIFS (UBI File System, more fully Unsorted Block Image File System) is a flash file system for unmanaged flash memory devices. UBIFS works on top of an UBI (unsorted block image) layer, which is itself on top of a memory technology device (MTD) layer.

Why does UBIFS matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study UBIFS?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on UBIFS.

Tags

  • Embedded Linux
  • Flash file systems supported by the Linux kernel
  • Free special-purpose file systems

Keep exploring