{"id":13812332,"url":"https://github.com/gkostka/lwext4","last_synced_at":"2025-05-14T21:32:40.645Z","repository":{"id":33828248,"uuid":"37526571","full_name":"gkostka/lwext4","owner":"gkostka","description":"ext2/ext3/ext4 filesystem library for microcontrollers","archived":false,"fork":false,"pushed_at":"2024-03-22T03:36:58.000Z","size":3265,"stargazers_count":493,"open_issues_count":26,"forks_count":130,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-11-19T07:38:43.067Z","etag":null,"topics":["embedded","ext2","ext3","ext4","filesystem-library","journal","linux","microcontroller"],"latest_commit_sha":null,"homepage":"http://sourceforge.net/projects/lwext4/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gkostka.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-16T11:39:52.000Z","updated_at":"2024-11-16T11:10:08.000Z","dependencies_parsed_at":"2022-07-14T03:40:29.309Z","dependency_job_id":"96d88f2c-630f-4e28-908e-bd48e0f041fa","html_url":"https://github.com/gkostka/lwext4","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkostka%2Flwext4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkostka%2Flwext4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkostka%2Flwext4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkostka%2Flwext4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gkostka","download_url":"https://codeload.github.com/gkostka/lwext4/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254231271,"owners_count":22036338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","ext2","ext3","ext4","filesystem-library","journal","linux","microcontroller"],"created_at":"2024-08-04T04:00:50.819Z","updated_at":"2025-05-14T21:32:35.625Z","avatar_url":"https://github.com/gkostka.png","language":"C","funding_links":[],"categories":["Storage"],"sub_categories":["Filesystems"],"readme":"[![Join the chat at https://gitter.im/gkostka/lwext4](https://badges.gitter.im/gkostka/lwext4.svg)](https://gitter.im/gkostka/lwext4?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![License (GPL v2.0)](https://img.shields.io/badge/license-GPL%20(v2.0)-blue.svg?style=flat-square)](http://opensource.org/licenses/GPL-2.0)\n[![Build Status](https://travis-ci.org/gkostka/lwext4.svg)](https://travis-ci.org/gkostka/lwext4)\n[![](http://img.shields.io/gratipay/user/gkostka.svg)](https://gratipay.com/gkostka/)\n\n![lwext4](https://cloud.githubusercontent.com/assets/8606098/11697327/68306d88-9eb9-11e5-8807-81a2887f077e.png)\n\nAbout\n=====\n\n\nThe main goal of the lwext4 project is to provide ext2/3/4 filesystem for microcontrollers. It may be an interesting alternative for traditional MCU filesystem libraries (mostly based on FAT32). Library has some cool and unique features in microcontrollers world:\n - directory indexing - fast file find and list operations\n - extents - fast big file truncate\n - journaling transactions \u0026 recovery - power loss resistance\n\nLwext4 is an excellent choice for SD/MMC card, USB flash drive or any other wear\nleveled memory types. However it is not good for raw flash devices.\n\nFeel free to contact me:\nkostka.grzegorz@gmail.com\n\nCredits\n=====\n\nThe most of the source code of lwext4 was taken from HelenOS:\n* http://helenos.org/\n\nSome features are based on FreeBSD and Linux implementations.\n\nKaHo Ng (https://github.com/ngkaho1234):\n* advanced extents implementation\n* xattr support\n* metadata checksum support\n* journal recovery \u0026 transactions\n* many bugfixes \u0026 improvements\n\nLwext4 could be used also as fuse internals. Here is a nice project which uses lwext4 as a filesystem base:\n* https://github.com/ngkaho1234/fuse-lwext4\n\nSome of the source files are licensed under GPLv2. It makes whole\nlwext4 GPLv2 licensed. To use library as a BSD3, GPLv2 licensed source\nfiles must be removed first. At this point there are two files\nlicensed under GPLv2:\n* ext4_xattr.c\n* ext4_extents.c\n\nAll other modules and headers are BSD-3-Clause licensed code.\n\n\nFeatures\n=====\n\n* filetypes: regular, directories, softlinks\n* support for hardlinks\n* multiple blocksize supported: 1KB, 2KB, 4KB ... 64KB\n* little/big endian architectures supported\n* multiple configurations (ext2/ext3/ext4)\n* only C standard library dependency\n* various CPU architectures supported (x86/64, cortex-mX, msp430 ...)\n* small memory footprint\n* flexible configurations\n\nMemory footprint\n------------\n\nAdvanced ext4 filesystem features, like extents or journaling require some memory. \nHowever most of the memory expensive features could be disabled at compile time.\nHere is a brief summary for cortex-m4 processor:\n\n* .text:  20KB - only ext2 fs support , 50KB - full ext4 fs feature set\n* .data:  8KB - minimum 8 x 1KB  block cache, 12KB - when journaling and extents are enabled\n* .stack: 2KB - is enough (not measured precisely)\n\nBlocks are allocated dynamically. Previous versions of library could work without\nmalloc but from 1.0.0 dynamic memory allocation is required. However, block cache\nshould not allocate more than CONFIG_BLOCK_DEV CACHE_SIZE.\n\nSupported ext2/3/4 features\n=====\nincompatible:\n------------\n*  filetype, recover, meta_bg, extents, 64bit, flex_bg: **yes**\n*  compression, journal_dev, mmp, ea_inode, dirdata, bg_meta_csum, largedir, inline_data: **no**\n\ncompatible:\n------------\n*  has_journal, ext_attr, dir_index: **yes**\n*  dir_prealloc, imagic_inodes, resize_inode: **no**\n\nread-only:\n------------\n*  sparse_super, large_file, huge_file, gdt_csum, dir_nlink, extra_isize, metadata_csum: **yes**\n*  quota, bigalloc, btree_dir: **no**\n\nProject tree\n=====\n*  blockdev         - block devices set, supported blockdev\n*  fs_test          - test suite, mkfs and demo application\n*  src              - source files\n*  include          - header files\n*  toolchain        - cmake toolchain files\n*  CMakeLists.txt   - CMake config file\n*  ext_images.7z    - compressed ext2/3/4 100MB images\n*  fs_test.mk       - automatic tests definitions\n*  Makefile         - helper makefile to generate cmake and run test suite\n*  README.md       - readme file\n  \nCompile\n=====\nDependencies\n------------\n* Windows \n\nDownload MSYS-2:  https://sourceforge.net/projects/msys2/\n\nInstall required packages is MSYS2 Shell package manager:\n```bash\n pacman -S make gcc cmake p7zip\n  ```\n  \n* Linux \n\nPackage installation (Debian):\n```bash\n apt-get install make gcc cmake p7zip\n  ```\n \nCompile \u0026 install tools\n------------\n```bash\n make generic\n cd build_generic\n make\n sudo make install\n ```\n\nlwext4-generic demo application\n=====\nSimple lwext4 library test application:\n* load ext2/3/4 images\n* load linux block device with ext2/3/4 part\n* load windows volume with ext2/3/4 filesystem \n* directory speed test\n* file write/read speed test\n\nHow to use for images/blockdevices:\n```bash\n lwext4-generic -i ext_images/ext2 \n lwext4-generic -i ext_images/ext3 \n lwext4-generic -i ext_images/ext4 \n ```\n \nShow full option set:\n```bash\n lwext4-generic --help\n   ```\n\nRun automatic tests\n=====\n\nExecute tests for 100MB unpacked images:\n```bash\n make test\n   ```\nExecute tests for autogenerated 1GB images (only on Linux targets) + fsck:\n```bash\n make test_all\n   ```\nUsing lwext4-mkfs tool\n=====\nIt is possible to create ext2/3/4 partition by internal library tool.\n\nGenerate empty file (1GB):\n```bash\n dd if=/dev/zero of=ext_image bs=1M count=1024\n   ```\nCreate ext2 partition:\n```bash\n lwext4-mkfs -i ext_image -e 2\n   ```\nCreate ext3 partition:\n```bash\n lwext4-mkfs -i ext_image -e 3\n   ```\nCreate ext4 partition:\n```bash\n lwext4-mkfs -i ext_image -e 4\n   ```\nShow full option set:\n```bash\n lwext4-mkfs --help\n   ```\n\nCross compile standalone library\n=====\nToolchains needed:\n------------\n\nLwext4 could be compiled for many targets. Here are an examples for 8/16/32/64 bit architectures.\n* generic for x86 or amd64\n* arm-none-eabi-gcc for ARM cortex-m0/m3/m4 microcontrollers\n* avr-gcc for AVR xmega microcontrollers\n* bfin-elf-gcc for blackfin processors\n* msp430-gcc for msp430 microcontrollers\n\nLibrary has been tested only for generic (amd64) \u0026 ARM Cortex M architectures.\nFor other targets compilation passes (with warnings somewhere) but tests are\nnot done yet. Lwext4 code is written with endianes respect. Big endian\nbehavior also hasn't been tested yet.\n\nBuild avrxmega7 library:\n------------\n```bash\n make avrxmega7\n cd build_avrxmega7\n make lwext4\n ```\n\nBuild cortex-m0 library:\n------------\n```bash\n make cortex-m0\n cd build_cortex-m0\n make lwext4\n ```\n\nBuild cortex-m3 library:\n------------\n```bash\n make cortex-m3\n cd build_cortex-m3\n make lwext4\n ```\n\nBuild cortex-m4 library:\n------------\n```bash\n make cortex-m4\n cd build_cortex-m4\n make lwext4\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkostka%2Flwext4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgkostka%2Flwext4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkostka%2Flwext4/lists"}