# USB08_8G Raspberry Pi controller-like write test — 2026-07-29

## Identity and baseline

- Host: `srv-rpi00.local`
- Block device: `/dev/sdc`, partition `/dev/sdc1`
- Canonical label: `USB08_8G`
- Model: `USB Flash Drive`
- Serial: `20111009140821671DA2`
- Capacity: 7.5 GiB
- FAT UUID: `46A9-9922`
- FAT geometry: 512-byte sectors, 4096-byte clusters, two FATs
- The partition was unmounted before and after the test.
- Baseline read-only `fsck.vfat` completed without reported errors.

## Controller-like write and publication test

Four 8,388,864-byte payloads were written to a dedicated
`CODEX_USB_TEST` directory using 16, 32, 64, and 96 KiB write requests.
For each payload the test:

1. wrote a temporary file;
2. called `fsync()` on the file;
3. atomically renamed the temporary file;
4. called `fsync()` on the containing directory;
5. reread the complete file and compared SHA-256;
6. unmounted and remounted the FAT volume read-only; and
7. reread and compared SHA-256 again.

All four sizes passed. Every file was exactly 8,388,864 bytes and every
write-side and post-remount read-side digest was:

`074A4D31F1FD009C285F03D4CC723284DA05D7AE849B4FC0A96DBBD5D59AFE9A`

## SCSI durability barrier

With the filesystem unmounted, `sg_sync /dev/sdc` issued the standard SCSI
SYNCHRONIZE CACHE command. The drive rejected it:

```text
Synchronize cache failed: Illegal request, Invalid field in parameter list
sg_sync failed: Illegal request, Invalid field in parameter list
```

This independently reproduces the controller's image-save finalization
failure. The drive performs ordinary FAT writes, rename, reread, and
unmount/remount persistence correctly, but does not implement the SCSI cache
command required by the current USBX/FileX durability policy. USBX translates
that transport result to `FX_IO_ERROR (0x90)`.

## Cleanup and final state

Only the dedicated `CODEX_USB_TEST` directory and its four generated files
were removed. A read-only remount confirmed the directory was absent and the
original files remained:

- `MainPid 2026-07-29 14-29.txt`
- `W00.wav`
- `W01.wav`

Final read-only `fsck.vfat` completed without reported errors and returned the
volume to its baseline count of four files and 95 used clusters. `USB08_8G`
was left unmounted on the Pi.

## Disposition

The flash media and FAT filesystem work for conventional host writes. The
drive is not fully compatible with the controller's strict USB durability
workflow because it rejects SCSI SYNCHRONIZE CACHE. The Controller A failure
is therefore reproduced as a drive-command compatibility limitation, not as
an inability to store or reread the payload.
