Ubifs mounting error causes kernel panic

yusuf.kaya andasis.com yusuf.kaya at andasis.com
Tue Jan 2 05:35:15 PST 2024


> > ubi0: available PEBs: 0, total reserved PEBs: 360, PEBs reserved for bad PEB handling: 80

> available PEBs can never be 0. You should firstly check this.

But it is also working fine when available PEBs are 0. After that message I think it uses reserved PEBs and creates the volume in correct size (see below lines).  So what is available and reserved PEBS means and how can I understand why my available PEBs are 0 and all goes to reserved? By the way when I try to sum up the PEB and LEB counts I couldn't get the exact results. For example in the rootfs partition below, it says;
Good PEBs: 1748,
Bad PEBs: 4,
Corrupted PEBs: 0,
Available PEBs: 0,
Total reserved PEBs: 1748,
PEBs reserved for bad PEB handling: 76,
(As far as here ok, I understand that there is 1752 PEBs total and 4 of them are bad PEBs, so they wont used. And 76 PEBs also reserved for bad PEB handling just in case, so they wont used either. Then we have 1672 PEBs total for can be used.)
FS size: 200MiB, 1657 LEBs,
Journal size: 8MiB, 72 LEBs
(Here why we have 1657 LEBs remained? Shouldn't we have 1672 PEBs? The infradead says 4-5 PEBs used as flash overhead but there is 15 PEBs difference. And the FS size includes journal size or not?)

/* Rootfs mounting logs begin */
[    3.905750] ubi0: attaching mtd4
[    3.984291] random: fast init done
[    5.345916] ubi0: scanning is finished
[    5.362184] ubi0: attached mtd4 (name "NAND.file-system", size 219 MiB)
[    5.368824] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    5.375717] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    5.382523] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    5.389504] ubi0: good PEBs: 1748, bad PEBs: 4, corrupted PEBs: 0
[    5.395614] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[    5.402855] ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1086286734
[    5.412013] ubi0: available PEBs: 0, total reserved PEBs: 1748, PEBs reserved for bad PEB handling: 76
[    5.476431] UBIFS: parse sync
[    5.480400] UBIFS (ubi0:0): Mounting in unauthenticated mode
[    5.486182] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 241
[    5.536650] UBIFS (ubi0:0): recovery needed
[    5.666057] UBIFS (ubi0:0): recovery completed
[    5.670584] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "NAND.file-system"
[    5.678870] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    5.688811] UBIFS (ubi0:0): FS size: 210399232 bytes (200 MiB, 1657 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[    5.699531] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[    5.705379] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID A820488C-5A5A-496A-8898-D990B0325EDC, small LPT model
[    5.718319] VFS: Mounted root (ubifs filesystem) on device 0:20.
[    5.727175] devtmpfs: mounted
/* Rootfs mounting logs end */


More information about the linux-mtd mailing list