[Q] Why using UBIFS?

Search This thread

TheSSJ

Senior Member
  • Feb 25, 2010
    1,725
    2,246
    Hi,

    I recently got to know, that my tab is using UBIFS as file system...what are the advantages compared to the normal ext2-ext4?

    I thought about migrating to the ext filesystems, but if someone tells me that UBIFS is better, I'd stay on UBIFS...

    Regards
     

    Jin^eLD

    Member
    Nov 18, 2012
    14
    3
    Hi,

    Hi,

    I recently got to know, that my tab is using UBIFS as file system...what are the advantages compared to the normal ext2-ext4?

    I thought about migrating to the ext filesystems, but if someone tells me that UBIFS is better, I'd stay on UBIFS...

    Regards

    the problem running ext2/3/4 on flash is - sooner or later you will kill the flash. One might not notice it say, on a USB stick, when data is just copied from one place to another occasionally, but things look different if you use it as your root file system where things get written onto it all the time.

    I am sure there are more of them around, I am only familiar wit JFFS2 and UBIFS, both are designed for flash media and implement wear leveling routines to make sure that the flash lasts longer.

    JFFS2 is somewhat old now, UBIFS is newer and from what I know - better.

    I use devices with UBIFS at work and it proved itself very robust, during development I often simply plug off mains without a clean shutdown and I still never ran into a file system corruption or anything like that. So, good to know that our tablets use it :)

    Kind regards,
    Jin
     

    TheSSJ

    Senior Member
  • Feb 25, 2010
    1,725
    2,246
    Thanks for the clarification. Another question:

    Does any kernel support UBIFS or do I normally need to insmod the corresponding module?
     

    kuisma

    Senior Member
    Jun 30, 2009
    360
    214
    Sweden
    whiteboard.ping.se
    I recently got to know, that my tab is using UBIFS as file system...what are the advantages compared to the normal ext2-ext4?

    I thought about migrating to the ext file systems, but if someone tells me that UBIFS is better, I'd stay on UBIFS...

    Different things, different usages.

    • UBIFS, YAFFS2 etc are file systems for NAND flash devices. Those memories are not block devices.
    • EXT3, EXT4, VFAT etc are file systems for block devices, and can not use non block devices such as NAND flash devices.
    To be able to use a block device file system on a NAND device, you'll need a Flash Translation Layer (FTL). In every USB memory stick, SSD, SDcard etc, you are viewing the NAND flash via such a translation integrated into the device itself, hence you are able to format is using an ordinary file system such as FAT or EXT4. In GNU/Linux (hence Android as well), you've got such a translation layer in the MTD device (look in /proc/mtd).
     

    Jin^eLD

    Member
    Nov 18, 2012
    14
    3
    Thanks for the clarification. Another question:

    Does any kernel support UBIFS or do I normally need to insmod the corresponding module?


    Theoretically it should be doable if you compile the ubifs modules for your kernel, I did not try that yet, when I was using it for some non tablet ARM9 boxes I simply compiled it into the kernel:
    CONFIG_MTD_UBI=y
    CONFIG_MTD_UBI_WL_THRESHOLD=4096
    CONFIG_MTD_UBI_BEB_RESERVE=1
    CONFIG_UBIFS_FS=y
    CONFIG_UBIFS_FS_XATTR=y


    Different things, different usages.

    • UBIFS, YAFFS2 etc are file systems for NAND flash devices. Those memories are not block devices.
    • EXT3, EXT4, VFAT etc are file systems for block devices, and can not use non block devices such as NAND flash devices.
    To be able to use a block device file system on a NAND device, you'll need a Flash Translation Layer (FTL). In every USB memory stick, SSD, SDcard etc, you are viewing the NAND flash via such a translation integrated into the device itself, hence you are able to format is using an ordinary file system such as FAT or EXT4. In GNU/Linux (hence Android as well), you've got such a translation layer in the MTD device (look in /proc/mtd).

    It turned out that TrekStor Ventos 9.7 tablet uses ext4 file systems, does that mean that this is because of the way how they integrated the flash?
    As far I know that for USB sticks / SDcards you can not get around the FTL, would be interesting if this is also the case for the Ventos tablet or if switching to UBIFS would be possible there. Main problem with FTL in my opinion is, that it is usually optimized for specific use cases and mostly those use cases do not include write patters that you have when the device is used as a root file system. That's where UBIFS does a much better job at preserving the flash.
     

    kuisma

    Senior Member
    Jun 30, 2009
    360
    214
    Sweden
    whiteboard.ping.se
    It turned out that TrekStor Ventos 9.7 tablet uses ext4 file systems, does that mean that this is because of the way how they integrated the flash?
    Somewhere you'll need the FTL. If using MMC technology, it's in the memory device itself.

    As far I know that for USB sticks / SDcards you can not get around the FTL, would be interesting if this is also the case for the Ventos tablet or if switching to UBIFS would be possible there.
    If FTL in software, such as in the MTD case, this would be possible, yes.

    Main problem with FTL in my opinion is, that it is usually optimized for specific use cases and mostly those use cases do not include write patters that you have when the device is used as a root file system. That's where UBIFS does a much better job at preserving the flash.
    Android places its root file system in RAM, not in flash.

    The FTL is what differs the flash memory (SSDs, MMCs etc) vendors from each other. Some manufacturers priorities read speed, other write speed, and yet other random access etc. Some uses more spare chips extending the life of the device, at the cost of a more expensive unit. Other throttles the write speed to guarantee the functionality during the warranty period. Basically you'll get what you pay for.
     

    Jin^eLD

    Member
    Nov 18, 2012
    14
    3
    Android places its root file system in RAM, not in flash.

    Oh.. OK, I did not know that, I'm still quite new to Android. So far I've been playing around with ARM9 devices, building root file systems with OpenEmbedded, but just starting with Android now.

    The FTL is what differs the flash memory (SSDs, MMCs etc) vendors from each other. Some manufacturers priorities read speed, other write speed, and yet other random access etc. Some uses more spare chips extending the life of the device, at the cost of a more expensive unit. Other throttles the write speed to guarantee the functionality during the warranty period. Basically you'll get what you pay for.

    -> "Basically you'll get what you pay for."

    That's what I fear :) I had very positive experiences with UBIFS so I'd rather rely on it doing the job than on an FTL, which I know nothing about, that is used in my el-cheapo tablet.
     

    kuisma

    Senior Member
    Jun 30, 2009
    360
    214
    Sweden
    whiteboard.ping.se
    Oh.. OK, I did not know that, I'm still quite new to Android. So far I've been playing around with ARM9 devices, building root file systems with OpenEmbedded, but just starting with Android now.
    Also, once booted, it remounts root as read-only, so I wouldn't worry too much about wear leveling. ;)

    -> "Basically you'll get what you pay for."

    That's what I fear :) I had very positive experiences with UBIFS so I'd rather rely on it doing the job than on an FTL, which I know nothing about, that is used in my el-cheapo tablet.
    Sure, if you know what you are doing, controlling the FTL, and you can optimize the performance for the particular task you are using the device for. Buying a ready-to-use device using an integrated FTL, and the manufacturer have no other choice than adjusting the FTL parameters for the average customer usage. Still, in most cases I would say this is good enough and the risk of manually creating an even worse profile is quite likely for a noob such as myself.
     
    Last edited:

    TheSSJ

    Senior Member
  • Feb 25, 2010
    1,725
    2,246
    Different things, different usages.

    • UBIFS, YAFFS2 etc are file systems for NAND flash devices. Those memories are not block devices.

    Oh, this explains why I got a corrupted recovery by dumping /dev/block/mtdblock3 on my uImage/ubifs powered tab...It worked when I dumped /dev/mtd/mtd3 though...

    Thanks for the explanation!
     

    AndroidGeek18

    Member
    Nov 4, 2014
    20
    0
    Quezon City
    Hi,

    I recently got to know, that my tab is using UBIFS as file system...what are the advantages compared to the normal ext2-ext4?

    I thought about migrating to the ext filesystems, but if someone tells me that UBIFS is better, I'd stay on UBIFS...

    Regards


    Hey bro, you said youll migrate to ext4 if it is better. How can you that? Ive been searching for a way to format my ubifs phone to ext4. I hope you can help me :D
     

    Top Liked Posts

    • There are no posts matching your filters.
    • 2
      I recently got to know, that my tab is using UBIFS as file system...what are the advantages compared to the normal ext2-ext4?

      I thought about migrating to the ext file systems, but if someone tells me that UBIFS is better, I'd stay on UBIFS...

      Different things, different usages.

      • UBIFS, YAFFS2 etc are file systems for NAND flash devices. Those memories are not block devices.
      • EXT3, EXT4, VFAT etc are file systems for block devices, and can not use non block devices such as NAND flash devices.
      To be able to use a block device file system on a NAND device, you'll need a Flash Translation Layer (FTL). In every USB memory stick, SSD, SDcard etc, you are viewing the NAND flash via such a translation integrated into the device itself, hence you are able to format is using an ordinary file system such as FAT or EXT4. In GNU/Linux (hence Android as well), you've got such a translation layer in the MTD device (look in /proc/mtd).
    Our Apps
    Get our official app!
    The best way to access XDA on your phone
    Nav Gestures
    Add swipe gestures to any Android
    One Handed Mode
    Eases uses one hand with your phone