From c7c46dc15da980fb36731abdce4600408e4a9eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20L=C3=B6vqvist?= Date: Wed, 4 Mar 2026 22:18:11 +0100 Subject: [PATCH] Added manual experiment file --- test/Manual experiment.md | 82 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 test/Manual experiment.md diff --git a/test/Manual experiment.md b/test/Manual experiment.md new file mode 100644 index 0000000..2116220 --- /dev/null +++ b/test/Manual experiment.md @@ -0,0 +1,82 @@ +## Manual experiment + +> [!NOTE] +> This manual experiment shows how we can do the testing (teardown not included). Note that we don't need the `losetup`-stuff, we know where everything is. + +### Compile +```sh +gcc fs-watcher.c json-writer.c -o fa2json +``` +### Create image file +```sh +mktemp /tmp/fa2json-test-XXXXXX.img +``` + +```text +/tmp/fa2json-test-UrwpOb.img +``` + +```sh +truncate -s 10M /tmp/fa2json-test-UrwpOb.img +``` + +```sh +mkfs.ext4 /tmp/fa2json-test-UrwpOb.img +``` + +```text +mke2fs 1.47.3 (8-Jul-2025) +Discarding device blocks: done +Creating filesystem with 10240 1k blocks and 2560 inodes +Filesystem UUID: 035c508e-dec0-4a21-a4d1-1efb6fa72415 +Superblock backups stored on blocks: + 8193 + +Allocating group tables: done +Writing inode tables: done +Creating journal (1024 blocks): done +Writing superblocks and filesystem accounting information: done +``` + + +### Create mount point + +```sh +mktemp -d /tmp/fa2json-mnt-XXXXXX +``` + +```text +/tmp/fa2json-mnt-ts2Dik +``` + +### Mount loop device +```sh +sudo mount /tmp/fa2json-test-UrwpOb.img /tmp/fa2json-mnt-ts2Dik/ +``` + +> [!NOTE] +> In a different terminal I now ran - but we could do this after `chown` or possibly `chown` + `sync`? +> ```sh +> fa2json /tmp/fa2json-mnt-ts2Dik +> ``` + +### Let current user own file system +```sh +sudo chown $(id -u) /tmp/fa2json-mnt-ts2Dik/ +``` + +#### `fa2json` output +```json +{"ts": [1772658052, 704412412, 386988, 865842867], "name": "/tmp/fa2json-mnt-ts2Dik/.", "mask": 1073741828} +``` + +### Touch marker +```sh +touch /tmp/fa2json-mnt-ts2Dik/MARKER +``` + +#### `fa2json` output +```json +{"ts": [1772658064, 151070715, 387000, 312501190], "name": "/tmp/fa2json-mnt-ts2Dik/MARKER", "mask": 256} +{"ts": [1772658064, 151099105, 387000, 312529600], "name": "/tmp/fa2json-mnt-ts2Dik/MARKER", "mask": 12} +``` \ No newline at end of file