https://github.com/anaskhan96/litfs
A FUSE file system in Go extended with persistent file storage
https://github.com/anaskhan96/litfs
filesystem fs fuse persistence
Last synced: 9 months ago
JSON representation
A FUSE file system in Go extended with persistent file storage
- Host: GitHub
- URL: https://github.com/anaskhan96/litfs
- Owner: anaskhan96
- License: mit
- Created: 2018-01-18T19:50:40.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-11-03T14:04:34.000Z (about 5 years ago)
- Last Synced: 2025-03-24T07:48:53.228Z (9 months ago)
- Topics: filesystem, fs, fuse, persistence
- Language: Go
- Homepage:
- Size: 309 KB
- Stars: 124
- Watchers: 7
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# litfs

This FUSE filesystem, apart from providing the normal file I/O operations, implements persistence by emulating a single binary Unix file as disk and performing read/writes on it.
## Build and Run
```bash
go get github.com/anaskhan96/litfs
cd $GOPATH/src/github.com/anaskhan96/litfs
go run main.go data # data/ is the directory on which to mount the filesystem on
```
Run `umount ` to unmount the filesystem.
## File System Characteristics
- Create, remove a directory
- Create, remove, read from, and write to files inside a directory
- Copy, move the contents of a file to another, across directories
## Persistence Implementation
`disklib/sda` is the created binary file emulating a disk. Keeping a block size of `4096` bytes:
- A serialized form of the tree representation of the filesystem is stored in the first block
- A structure containing two components - a bitmap indicating free and allocated blocks in the filesystem and an integer containing the lowest free block at the moment - is serialized and stored in the second block
- File data is stored from the third block onwards, with a block as a whole being allocated to/deallocated from the file
---
This project was built under the course *Unix Systems Programming* at *PES University*.