{"id":22124194,"url":"https://github.com/federicoponzi/vfat-rs","last_synced_at":"2026-02-07T06:02:47.821Z","repository":{"id":162659451,"uuid":"449451827","full_name":"FedericoPonzi/vfat-rs","owner":"FedericoPonzi","description":"A FAT32 filesystem implementation written in rust.","archived":false,"fork":false,"pushed_at":"2025-10-04T16:55:37.000Z","size":310,"stargazers_count":1,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T18:33:20.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FedericoPonzi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-01-18T21:22:43.000Z","updated_at":"2025-10-04T16:55:40.000Z","dependencies_parsed_at":"2024-06-03T15:39:39.622Z","dependency_job_id":"a79ef679-837c-4994-83b7-c16efa3053d7","html_url":"https://github.com/FedericoPonzi/vfat-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FedericoPonzi/vfat-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoPonzi%2Fvfat-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoPonzi%2Fvfat-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoPonzi%2Fvfat-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoPonzi%2Fvfat-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FedericoPonzi","download_url":"https://codeload.github.com/FedericoPonzi/vfat-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoPonzi%2Fvfat-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29187945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T05:07:31.176Z","status":"ssl_error","status_checked_at":"2026-02-07T05:06:15.227Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-12-01T15:46:51.043Z","updated_at":"2026-02-07T06:02:47.778Z","avatar_url":"https://github.com/FedericoPonzi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VFAT / FAT32\n\nA simple VFAT implementation written in rust, and mostly tested against Linux's vfat driver.\n\nIt aims to be straightforward to understand and easy to use in a custom kernel.\n\nIt supports all the basic operations:\n\n* File and directory creation,\n* File reading and writing,\n* Directory and file deletion.\n\nIt needs better support for reusing deleted space. Deletion updates the entry's metadata in the directory and marks it\nas deleted,\nbut it's never garbage collected (this would be done by a defrag tool) nor reused.\n\nCheck the issues for missing features.\n\n## no_std\n\nThis component was first developed with `no_std` in mind. `std` is supported behind a feature flag, and it is used\nfor integration testing.\n\n## Using it in your kernel\n\nThe exported apis are in the api module. The OS should provide:\n\n* An implementation for the `TimeManagerTrait`. This is used for timestamping file creation and update.\n* An implementation for the device trait. This is used to interact with the disk.\n* Alloc support. It is mostly used to allocate some vec and strings, it might be put behind a feature flag later on.\n\n## Run example\n\nTo run the example, first create a vfat fs using the script `tests/setup.sh`. This script:\n\n* creates a vfat fs,\n* mounts it,\n* writes a bunch of files and directories (using your kernel's driver)\n* unmounts it.\n\nThis file is also used for running integration tests. It needs sudo access for `mount` and `unmount` commands.\n\nThen, you're ready to run the example file using:\n\n```bash\ncargo run --example simple --features std\n```\n\n## Testing\n\nTo run the setup.sh script, I've added an exception for my user in the sudoers file:\n\n```\nfponzi ALL=(ALL) NOPASSWD: /usr/bin/mount,/usr/bin/umount\n```\n\nOn Github actions (CI) it just works because the user has passwordless sudo.\n\nThen all tests can be run with `cargo test`. Each test in vfat.rs will create and delete a vfat filesystem.\n\n### Some vfat related utilities\n\nYou can check whether the file contains a valid MBR via `gdisk`:\n\n```bash\n$ gdisk -l fat32.fs\n```\n\nand you can get info about the filesystem with `fdisk`:\n\n```\n$ fdisk -l fat32.fs\n```\n\nSome simple script to flush fs changes:\n\n```\nsudo umount /mnt/test\nsudo mount -o loop,offset=$((2048*512)) /tmp/irisos_fat32/fat32.fs /mnt/test/\nls -l /mnt/test\n```\n\nCheck the changes:\n\n```shell\n# find loop device:\nsudo losetup -a | grep fat\n/dev/loop51: [66306]:8300622 (/tmp/irisos_fat32/fat32.fs), offset 1048576\n# sanity check:\nsudo dosfsck -r -l -v -r /dev/loop13\n```\n\nTo mount with `777` permission:\n\n```\nsudo mount -o loop,offset=$((2048*512)),uid=1000,gid=1000,dmask=0000,fmask=0001 fat32.fs /mnt/test/\n```\n\n## Useful docs:\n\n* https://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html\n* Exfat specification: https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification#1-introduction\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericoponzi%2Fvfat-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedericoponzi%2Fvfat-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericoponzi%2Fvfat-rs/lists"}