https://github.com/errornointernet/overmask
Add a writeable overlay on top of read-only files
https://github.com/errornointernet/overmask
immutable mask overlay overlayfs read-only
Last synced: 9 months ago
JSON representation
Add a writeable overlay on top of read-only files
- Host: GitHub
- URL: https://github.com/errornointernet/overmask
- Owner: ErrorNoInternet
- License: lgpl-3.0
- Created: 2023-07-19T04:22:17.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-15T12:29:18.000Z (over 1 year ago)
- Last Synced: 2024-11-15T13:31:10.051Z (over 1 year ago)
- Topics: immutable, mask, overlay, overlayfs, read-only
- Language: Rust
- Homepage:
- Size: 184 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# overmask
Add a writeable overlay on top of read-only files
## Installation
Nix flake: `github:ErrorNoInternet/overmask`
AUR: https://aur.archlinux.org/packages/overmask
COPR: https://copr.fedorainfracloud.org/coprs/errornointernet/packages
### cargo
```sh
$ git clone https://github.com/ErrorNoInternet/overmask
$ cd overmask
$ cargo install --path .
```
## Usage
```sh
# required for the virtual block device (/dev/nbd*)
$ sudo modprobe nbd
# create (empty) files to store data in
$ touch overlay_file mask_file
# device mode:
# read from /dev/sda, but redirect all writes to overlay_file and
# use mask_file to keep track of what has been written so that
# future reads would be from overlay_file instead of /dev/sda
$ overmask -s /dev/sda -o overlay_file -m mask_file dev
# you can now send arbitrary write commands to the virtual block device
$ sudo dd if=/dev/zero of=/dev/nbd0
# and all the zeros would be in overlay_file instead of /dev/sda
```