Ben, On Wed, Jul 10, 2019 at 5:32 AM Ben Schroeder <klowd92@xxxxxxxxx> wrote: > Why do I see a loss of space when rewriting the same file? Please see my answer below. > Can I use an upgrade scheme with file binary diff as mentioned above - > One that would run correctly with low available space? If the filesystem is full and all nodes are already packed, it can be a challenge. > Can I use an upgrade scheme with UBI volume binary diff? Yes, you can alter a dynamic volume as you wish. But keep NAND odds on mind. So you need to replace whole LEBs. > Sorry for the long mail, I have not found much information about fragmentation > and space loss in UBIFS. Let me know if I forgot any relevant details. I think the root cause of the problem you see is how NAND works. On NAND we write always full pages. So if you ask UBIFS to change one byte of a file or change meta data, it has to waste a full page. Luckily Linux is a modern operating system with a write-cache and upon write-back UBIFS can pack nodes (UBIFS data nodes, inode nodes, etc...) together and wastes less space. But it wastes still a significant amount of space if userspace forces it to persist data. i.e. by using fsync()/fdatasync(). If UBIFS runs out of space the garbage collector will rewrite nodes and pack them tightly together. So, if you have a pre-created UBIFS, nodes are already packed and your update mechanism might force UBIFS to faster than the garbage collector can pack nodes. With that information in mind, do your other questions resolve? -- Thanks, //richard ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/