{"id":50844110,"url":"https://github.com/suhteevah/ext4-rw","last_synced_at":"2026-06-14T08:05:28.916Z","repository":{"id":349504889,"uuid":"1199735362","full_name":"suhteevah/ext4-rw","owner":"suhteevah","description":"no_std ext4 filesystem with read/write support in Rust","archived":false,"fork":false,"pushed_at":"2026-06-08T08:05:32.000Z","size":64,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T10:06:50.751Z","etag":null,"topics":["bare-metal","embedded","ext4","filesystem","no-std","operating-system","osdev","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suhteevah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-02T16:49:04.000Z","updated_at":"2026-06-08T08:05:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/suhteevah/ext4-rw","commit_stats":null,"previous_names":["suhteevah/ext4-rw"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suhteevah/ext4-rw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fext4-rw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fext4-rw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fext4-rw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fext4-rw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhteevah","download_url":"https://codeload.github.com/suhteevah/ext4-rw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fext4-rw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34313617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bare-metal","embedded","ext4","filesystem","no-std","operating-system","osdev","rust"],"created_at":"2026-06-14T08:05:28.148Z","updated_at":"2026-06-14T08:05:28.909Z","avatar_url":"https://github.com/suhteevah.png","language":"Rust","funding_links":["https://www.paypal.me/baal_hosting","https://paypal.me/baal_hosting"],"categories":[],"sub_categories":[],"readme":"# ext4-rw\n\n[![no_std](https://img.shields.io/badge/no__std-yes-blue)](https://rust-embedded.github.io/book/)\n[![crates.io](https://img.shields.io/crates/v/ext4-rw.svg)](https://crates.io/crates/ext4-rw)\n[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](LICENSE-MIT)\n\nA `no_std` ext4 filesystem implementation in Rust with full read and write support.\n\nDesigned for bare-metal, embedded, and OS development environments where the standard\nlibrary is not available. Requires only `alloc`.\n\n## Features\n\n- **Superblock** parsing and serialization with full ext4 field support\n- **Block group descriptor** table management (32-bit and 64-bit modes)\n- **Inode** reading and writing with extent tree support\n- **Extent tree** traversal (leaf and multi-level index nodes)\n- **Directory** entry parsing, creation, lookup, and linear iteration\n- **Bitmap** allocation for blocks and inodes (single, contiguous runs, free ranges)\n- **High-level API**: mount, read files, write files, create directories, list directories\n- **`BlockDevice` trait** for pluggable storage backends (NVMe, virtio-blk, RAM disk, etc.)\n- **`no_std`** compatible -- only depends on `alloc` and `log`\n- **64-bit** block number support (INCOMPAT_64BIT)\n\n## Usage\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\next4-rw = \"0.1\"\n```\n\nImplement the `BlockDevice` trait for your storage backend:\n\n```rust\nuse ext4_rw::{Ext4Fs, BlockDevice, Ext4Error};\n\nstruct RamDisk {\n    data: Vec\u003cu8\u003e,\n}\n\nimpl BlockDevice for RamDisk {\n    fn read_bytes(\u0026self, offset: u64, buf: \u0026mut [u8]) -\u003e Result\u003c(), Ext4Error\u003e {\n        let start = offset as usize;\n        let end = start + buf.len();\n        buf.copy_from_slice(\u0026self.data[start..end]);\n        Ok(())\n    }\n\n    fn write_bytes(\u0026self, offset: u64, buf: \u0026[u8]) -\u003e Result\u003c(), Ext4Error\u003e {\n        // For a real implementation, write to your backing store\n        Ok(())\n    }\n}\n\n// Mount and use the filesystem\nlet disk = RamDisk { data: load_disk_image() };\nlet mut fs = Ext4Fs::mount(disk).expect(\"failed to mount ext4\");\n\n// Read a file\nlet data = fs.read_file(b\"/etc/hostname\").expect(\"read failed\");\n\n// Write a file\nfs.write_file(b\"/output.txt\", b\"Hello from ext4-rw!\").expect(\"write failed\");\n\n// Create a directory\nfs.mkdir(b\"/mydir\").expect(\"mkdir failed\");\n\n// List directory contents\nlet entries = fs.list_dir(b\"/\").expect(\"list failed\");\nfor entry in \u0026entries {\n    println!(\"{} (inode {})\", entry.name_str(), entry.inode);\n}\n\n// Persist metadata changes\nfs.sync_metadata().expect(\"sync failed\");\n```\n\n## Limitations\n\n- **No journaling**: journal replay is not implemented. Mount only clean filesystems.\n- **No HTree**: directory lookup is linear scan (fine for small/medium directories).\n- **No legacy block map**: only extent-based files are supported (standard for ext4).\n- **No checksums**: metadata checksums are not verified or computed.\n- **No encryption**: encrypted inodes are not supported.\n- **Extent tree splitting**: files larger than 4 extents in the root node are not yet supported for writes.\n\nThese are planned for future releases.\n\n## Minimum Supported Rust Version\n\nRust 1.70 or later.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT License ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n## Contributing\n\nContributions are welcome! Please open an issue or pull request on\n[GitHub](https://github.com/suhteevah/ext4-rw).\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n---\n\n## Support This Project\n\nIf you find this project useful, consider buying me a coffee! Your support helps me keep building and sharing open-source tools.\n\n[![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?logo=paypal)](https://www.paypal.me/baal_hosting)\n\n**PayPal:** [baal_hosting@live.com](https://paypal.me/baal_hosting)\n\nEvery donation, no matter how small, is greatly appreciated and motivates continued development. Thank you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhteevah%2Fext4-rw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhteevah%2Fext4-rw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhteevah%2Fext4-rw/lists"}