The status of UBIFS in Linux on top of MLC NAND has never been exactly perfect. And while this entry has now been removed from the FAQ nowadays, the support for UBIFS on top of MLC NAND has now been officially reported as unsupported:

Full thread on patchwork.kernel.org:

So I am now looking for a long term filesystem replacement for a MLC NAND as found on a MIPS Creator CI20:

This is a Samsung K9GBG08UOA NAND flash and it does not appear that there is a way to put this device in SLC mode.

It seems that jffs2 is also not an alternative:

Is there any other alternative filesystem (possibly with comparable performance) ?

  • This is worrying. We have products using MLC nand and UBIFS. It is not required in near future however now upgrading to latest kernel is tricky. – AnkurTank Jun 18 at 13:07
  • 1
    @AnkurTank UBIFS removal patch was send CC to stable@v.k.o so it should be backported at some point. – malat Jun 18 at 13:14
  • oh so do you mean even LTS kernels will also add that patch ? – AnkurTank Jun 18 at 13:23

As of Linux 4.17 there are no file systems that specifically handle MLC NAND.

Ideally the file system would not need to know about the storrage medium because quirks and features should be transparently handled. Of course practically this is not true, but it is the only assumption one can make about future mediums, so it is not surprising that in Linux 4.17 jffs2 is the only file system to check;

> grep -r -A 1 MTD_MLCNANDFLASH *
drivers/mtd/ubi/build.c:    if (mtd->type == MTD_MLCNANDFLASH) {
drivers/mtd/ubi/build.c-        pr_err("ubi: refuse attaching mtd%d - MLC NAND is not supported\n",
--
drivers/mtd/nand/onenand/onenand_base.c:    mtd->type = ONENAND_IS_MLC(this) ? MTD_MLCNANDFLASH : MTD_NANDFLASH;
drivers/mtd/nand/onenand/onenand_base.c-    mtd->flags = MTD_CAP_NANDFLASH;
--
drivers/mtd/nand/core.c:            MTD_NANDFLASH : MTD_MLCNANDFLASH;
drivers/mtd/nand/core.c-    mtd->flags = MTD_CAP_NANDFLASH;
--
drivers/mtd/nand/raw/nand_base.c:   mtd->type = nand_is_slc(chip) ? MTD_NANDFLASH : MTD_MLCNANDFLASH;
drivers/mtd/nand/raw/nand_base.c-   mtd->flags = (chip->options & NAND_ROM) ? MTD_CAP_ROM :
--
drivers/mtd/mtdcore.c:  case MTD_MLCNANDFLASH:
drivers/mtd/mtdcore.c-      type = "mlc-nand";
--
fs/jffs2/fs.c:  if (c->mtd->type == MTD_MLCNANDFLASH)
fs/jffs2/fs.c-      return -EINVAL;
--
include/uapi/mtd/mtd-abi.h:#define MTD_MLCNANDFLASH 8   /* MLC NAND (including TLC) */
include/uapi/mtd/mtd-abi.h-
--
include/uapi/mtd/mtd-abi.h: return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;
include/uapi/mtd/mtd-abi.h-}
--
include/linux/mtd/mtd.h:    return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;
include/linux/mtd/mtd.h-}

and

find fs -maxdepth 1 -type d | wc -l
72

That means only 1 of ~70 file systems care about MLC.

I don't see anything on out-of-tree file systems like zfs either.

  • ⅔ of your answer is a repeat of the code I already inspected from the Linux kernel, and referenced from my question. This is not an answer, but a rephrase. – malat Jul 10 at 12:44
  • @malat you asked if there are Linux file systems supporting MLC NAND, the answer is "no". I gave comprehensive proof via grep output, The important part are the file systems not returned from the grep, no where in your question did you link to this comprehansive test. I'm sorry if "no match" is not to your liking but it's also not in your question and is the answer. – user1133275 Jul 10 at 18:52
  • @malat also technicaly it's 2/34 not 2/3 (lines). – user1133275 Jul 10 at 19:00

If you have the option of including commercial software, Datalight currently still supports MLC. I have no idea how much it costs, or if there's a free-as-in-beer license for non-commercial use.

My only connection is that I'm on their mailing list and attended a couple of webinars. I've never used their products, so apply caveats and grains of salt accordingly. Good luck.

Related links, most-recent first:

up vote -1 down vote accepted

So it seems that two options are possible:

  1. git revert b5094b7f135be and then,
  2. wait for more work on MLC+NAND

    The fact that MLC NANDs are not supported by UBI is not necessarily definitive. I have a branch with all the work we've done to add MLC support to UBI 2. If you have time to invest in it, feel free to take over this work.

    Anyway, the decision to remove this driver is not mine, and this patch allows me to at least compile-test this driver.

Something to try out:

  • ext4 atop the MTD block layer
  • 1
    the lack of wear-levelling in mtdblock, and its horrendous amplification for small writes, rather limits its applicability. that's before the MLC question... I guess the best hope is that the write amplification actually mitigates MLC program disturb :-D. But the lack of wear-levelling would rather worry me for "long term filesystem." – sourcejedi Jul 13 at 12:00

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.