DR NAS NFSv4.2 Linux lab, 2026-10-04

Original learning experiment, not a production runbook. The driver is root-only
and refuses non-Linux, non-tmpfs root, absent disposable marker, existing exports,
existing rpcbind/mountd or active nfsd threads. It creates only a temporary /run
tree and its own export/mount/services inside a diskless disposable guest.
No host disks or enterprise data are attached. Numeric identities 20001, 20002,
25000 and 65534 are synthetic values, not an enterprise identity configuration.
The export permits only 127.0.0.1; NFS listens on 127.0.0.1:20490. Guest user NAT
has no forwarded ports. A fresh temporary host share holds inputs and reports.

Thirteen groups passed twice with Alpine 3.24.2, Linux 6.18.52-0-virt aarch64,
nfs-utils 2.6.4-r6, util-linux 2.42.3-r1 and Python 3.14.8. The actual mount
reports NFSv4.2, TCP and sec=sys. Client and server share one kernel. No separate
host, enterprise identity/ACL, Kerberos, RPC TLS, injected network fault, crash,
performance benchmark or business consumer runs. RPO/RTO numbers in the course
are fictional scenario inputs, not measured recovery results. The lab uses RAM:
sync and matching hashes do not demonstrate survival of power loss.

Recorded macOS bootstrap
boot.py and guest.py retain the recorded /tmp/dr-nas-nfs-work path. For replay,
choose a NEW empty temporary directory and change both helpers' w paths. Do not
overwrite an existing execution. Put setup.sh and run.py in its share/ directory.
The tested emulator is installed UTM QEMU 7.2.0; this is not a latest-version
recommendation. qemu-launch.c loads the framework without starting or changing
UTM user VMs. Recorded compilation:
clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk qemu-launch.c -Wl,-rpath,/Applications/UTM.app/Contents/Frameworks -o qemu-launch
Copy the executable into the selected work directory and review framework paths.
A conventional qemu-system-aarch64 executable could replace the loader/framework
arguments, but that alternative bootstrap was not executed here.

Acquire ISO/checksum from acquisition.json URLs over HTTPS. Compare the ISO
SHA-256 against both official checksum and recorded hash; stop on mismatch.
This run reused the earlier verified ISO after rehashing; signature verification
is not claimed. Extract boot/vmlinuz-virt and boot/initramfs-virt with an ISO
reader (macOS bsdtar was used). The recorded kernel is EFI zboot: read
struct.unpack_from('<II', kernel_bytes, 8) for offset,length, gzip-decompress that
payload, check [56:60] equals b'ARM\x64', and compare the resulting SHA-256 with
acquisition.json.kernelExtraction.uncompressedSha256. Save as boot/Image.
Do not apply this format-specific extraction blindly to another kernel.

Run boot.py. It logs into the ephemeral guest, mounts only the temporary share
and runs setup.sh. Inspect share/setup.txt and require successful installation
and /run/dr-nfs-disposable. The setup loads nfsd and nfs modules. Official Alpine
v3.24 repositories may resolve different packages on a later replay; record
actual versions instead of relabelling them as the recorded execution.
python3 guest.py 'python3 /mnt/dr/run.py --output /mnt/dr/evidence.json > /mnt/dr/run.txt 2>&1' 90
Require DR_DONE remote status :0 plus passed=13, failed=0 and failure=null in
the report. The helper prints remote status; its own exit code alone is not a
success assertion. Repeat into distinct evidence/log files after inspecting
cleanup. It may take longer than the first run because NFS maintains state.
Do not restart solely because observation timed out; inspect the same VM.

Expected observations
1 Local tmpfs and sentinel before mounting.
2 Actual nfs4 mount with vers=4.2 and sec=sys; local sentinel hidden.
3 Client UID 0 creates with server UID/GID 65534 under root_squash.
4 Client root receives errno 13 on server root:root 0700 private folder.
5 Client UID 20001 retains server UID/GID 20001 under root_squash.
6 UID 20001 writes its private directory; UID 20002 gets errno 13.
7 Temporary name changes to published name through rename.
8 Second UID reads 23 bytes with expected SHA-256.
9 Two different filenames contain one instruction ID; no consumer is run.
10 Unmount exposes original local sentinel; remote file stays on server.
11 Read-only export rejects creation with errno 30 after unmount/re-export/mount.
12 all_squash maps UID 20001 to configured server UID/GID 25000.
13 Owned client mount/export/services/tree removed and NFS port released.

Cleanup and scope
The script unmounts its exact client path, removes its exact export, stops nfsd
threads only after the initial no-existing-service guard, and terminates only
its own daemon process groups. It verifies an empty export table, zero nfsd
threads and no client mount. The nfsd control pseudo-filesystem can remain
mounted inside the disposable guest; mountRemoved means the owned NFS client
mount. Inspect service state, issue poweroff and confirm the precise VM PID
recorded in vm.json exited. Recorded PID 66452 was absent after shutdown.
No UTM user VM was stopped. Worksheet tasks were authored but have not been
performed by a human group. Independent review and representative application,
identity, protection and recovery acceptance remain outstanding.
