MTD partition size limit

Alexander Bykov kozyavk at gmail.com
Fri Feb 26 10:57:24 EST 2021


Hi.
Do I understand correctly that If I want to use MTD/UBI/UBIFS on a raw
NAND device I must partition it in chunks of less than 2GB each?
I'm trying to install the latest linux kernel on an old Allwinner A10
tablet which has 8GB NAND attached.

erase_flash works.

ubiformat fails with
libmtd: error!: cannot seek mtd1 to offset -2147483648

ubiattach fails with error 22 (Invalid argument)

I spent a couple of days trying to figure it out by googling around
but I couldn't.
There are  topics on your mailing list which suggest that there was
such a limitation a decade ago.
https://linux-mtd.infradead.narkive.com/FZMzDabu/partition-size-limit-of-ubifs
https://linux-mtd.infradead.narkive.com/zoKaKZMU/3gb-limit-2-gb-limit
But on the other hand I couldn't find other information about MTD/UBI
size limitations on your site or on the Internet. And there are a
couple of examples where 4GB partitions were suggested:
https://linux-sunxi.org/Mainline_NAND_Howto#Define_NAND_partitions_in_DTS
https://groups.google.com/g/linux-sunxi/c/PxMmiCe0Deg?pli=1

Before this attempt to install a modern OS I'd been using a prebuilt
Debian server image made by the other person.
It uses 3.4-3.6 kernel with MTD driver from Allwinner (AFAIK). This
driver exposes only the block interface to the NANAD device but it
works just fine. This tablet has been doing his little work at my home
24/7 for the last 5 or so years without a single (noticeable) FS
failure.
I don't know, maybe it uses some FTL inside?
Now, with a modern kernel and new MTD driver I can't use a simple
block device because it has four bad blocks and mkfs.ext4 just fails
to format it.

Thanks.



More information about the linux-mtd mailing list