Dedicated desktop database volume snapshots
Use a new, dedicated, locally mounted APFS volume on macOS or an NTFS drive on Windows for a new desktop installation. Reserve the whole volume for this database. An OS snapshot includes every file on the volume. Keep the normal desktop configuration, credentials, capture receipts and revocation history on the separate account disk. The running physical backup remains available for an existing default installation. A database-only recovery copy stays inactive until the operator conducts an isolated restore drill. Checkpoint contract
Select storage and grant capture
Mount the dedicated volume at a stable mount point or drive letter. Give the desktop account permission to create its database directory there. For Windows, require a local fixed drive and restrict writes to the desktop owner and trusted OS administrators. For macOS, enable volume ownership. From the new desktop account run:
lychd desktop volume select-storage --root "<volume mount point or drive root>"
lychd desktop install
lychd desktop volume register
Selection creates LychD-Postgres on the volume and an independent storage binding under the normal desktop PostgreSQL management directory. Registration confirms the live endpoint's data directory and system identifier using PostgreSQL and issues a new grant. External tablespaces, redirected WAL, special files and nested mounts are outside this profile. Losing the selection or its revocation history requires operator reconciliation. Keep both outside the snapshot and retain later tombstones when recovering the account disk.
Capture
On Windows 11, check Test-Path "$env:SystemRoot/System32/diskshadow.exe" before downtime and reserve a free drive letter. Microsoft lists Windows 11 for DiskShadow; the installed VSS provider must accept the persistent no-writers context and local drive exposure. The hosted requestor and standard-account readback receipts cover Windows Server 2025. Qualify the workstation build separately. Microsoft DiskShadow requirements
Stop the Vessel with lychd stop and leave the registered database running. Prepare the operator's snapshot utility and read-only mount procedure before starting downtime. Run lychd desktop volume capture as the desktop owner. The command checks the live cluster, stops PostgreSQL under the desktop management lock, checks physical shutdown and writes a fresh cut marker. Keep its terminal open until it reports completion.
- macOS. Use an installed, authorized per-volume snapshot utility such as Carbon Copy Cloner 7. In CCC select the dedicated volume identified by the command, create a protected snapshot, and mount that snapshot. In Disk Utility select the same volume, show APFS snapshots and copy the new snapshot UUID. Enter that UUID in the capture terminal. The reader resolves the mounted snapshot through the parent volume's
diskutilinventory and checks the read-only mount. The protected snapshot remains under the operator's retention policy. Apple's snapshot system calls require superuser authority and an additional entitlement. Apple API · Apple snapshot inspection · CCC protected snapshots · CCC creation and mounting - Windows. The Windows edition ships the producer at
$edition\runtime\Lib\site-packages\lychd\system\desktop\volume_vss.ps1. In a source checkout it issrc/lychd/system/desktop/volume_vss.ps1. The storage operator copies the script to an administrator-controlled directory, compares that copy against the independently trusted revision and reviews it there. From an already elevated Windows PowerShell console, run./volume_vss.ps1 -Volume <registered-guid> -Cut <cut-guid>. This one-shot producer checks the cold request and volume, uses DiskShadow's persistent no-writers context, exposes the new shadow as a local drive, and writes VSS's volume, snapshot, provider and device inventory under a fresh administrator-ownedProgram Files/LychD-Volume-<cut-guid>directory. Enter the resulting shadow ID in the desktop terminal. The ordinary account reads the protected receipt, verifies the drive's kernel device mapping and read-only flag, then reads the cluster with its existing file ACLs. Keep the drive exposure and producer receipt for restore. After the retention period, follow the exact-ID retirement procedure below. Requestor privileges · DiskShadow · Local shadow exposure
The capture checks the new marker, offline control identifier and cold cluster state inside that snapshot, restarts PostgreSQL, then writes the seal on the account disk. Save the capture UUID and JSON receipt. It records the provider, snapshot and volume identities, clean PostgreSQL cut, free bytes before and after, database pause including operator interaction, and elapsed capture time. Space usage can change later as live pages diverge. PostgreSQL file-system backup
Interrupted capture and retention
An ordinary error or Ctrl-C before sealing runs cleanup and attempts to restart PostgreSQL. A killed process, disconnected disk or sudden shutdown can leave the source stopped and its one-time request on disk. Close the operator's producer and make sure the capture command has exited. Remount the original volume and compare its UUID with the storage registration. lychd desktop status checks the registered cluster. For an interrupted, unsealed request, inspect LychD-Postgres/native-data/.lychd-cut-<cut-guid> and, on Windows, <volume-root>/.lychd-volume-request-<cut-guid>. Only remove regular marker files whose exact cut UUID matches the interrupted command and whose contents are the registered volume UUID. Leave database files and other cuts alone. If PostgreSQL is stopped, run lychd desktop start. Start a new capture to obtain a new cut and seal.
The seal resides at volume-authority/capture-<cut-guid>.json under the desktop account's original PostgreSQL management directory. grant.json and the revoked-<generation>.json tombstones belong to that same independent store. On Windows the OS producer retains its inventory at %ProgramFiles%/LychD-Volume-<cut-guid>/snapshot.json. Keep that file administrator-owned and read-only to the desktop account for the full retention period. lychd desktop volume revoke withdraws LychD restore authority for the generation. The OS snapshot, exposure and any previously exported copies have their own lifetimes.
When retiring a Windows capture, the elevated operator reads its protected inventory and looks up that exact Win32_ShadowCopy.ID, then checks its VolumeName, ProviderID and device against the receipt. Use unexpose {<snapshot-guid>} in DiskShadow to withdraw the local exposure by shadow ID. When the snapshot's retention period ends, delete shadows id {<snapshot-guid>} removes that one shadow. Requery the same ID to confirm its absence before removing the single per-cut request directory. If creation was interrupted before the receipt was written, inspect the dedicated volume's VSS inventory against the operator's creation output and retain ambiguous entries for review. A drive letter alone cannot identify the original shadow. Unexpose by shadow ID · Delete one shadow ID
Unexposing the Windows shadow makes the recorded drive mapping unusable. Re-exposing the same surviving snapshot on the original letter can restore access if its kernel device identity still matches. Deleting it, replacing its drive mapping or losing its protected receipt makes the sealed capture unavailable to this restore command. An unmounted APFS snapshot must be mounted read-only again; a deleted APFS snapshot requires another retained backup. Keep an independently verified portable backup for loss of the source medium.
Recover a committed row on a disposable installation
- Before capture, use an authenticated
psqlconnection to the dedicatedpostgresdatabase and commitCREATE TABLE volume_drill (value text PRIMARY KEY); INSERT INTO volume_drill VALUES ('captured');. Run the capture. Once it restarts PostgreSQL, commitINSERT INTO volume_drill VALUES ('later');on the live source. Reserve these names for the disposable drill. - Keep the recorded APFS snapshot mounted or the VSS snapshot accessible. Create an empty private recovery parent off the captured volume. Give only the desktop account filesystem access. Run
lychd desktop volume restore --capture <cut-guid> --destination "<recovery-parent>". Restore reads the current off-volume grant, rechecks the native snapshot and cold PostgreSQL identity, copies the cluster to a fresh directory, and compares SHA-256 of every file. A successful copy hasverified.jsonalongsidecluster. - In the disposable drill, choose a free second loopback port, for example 55433. Use the matching PostgreSQL 18 tools and existing test credential. Start only the recovered cluster with
pg_ctl -D "<fresh-copy>/cluster" -w -l "<fresh-copy>/drill.log" -o "-h 127.0.0.1 -p 55433 -c unix_socket_directories=" start. Connect withpsql -h 127.0.0.1 -p 55433 -U <database-owner> -d postgresand verifySHOW data_directory,SELECT system_identifier FROM pg_control_system()andSELECT value FROM volume_drill ORDER BY value. Expect exactlycapturedfrom this new directory. Stop the recovered server withpg_ctl -D "<fresh-copy>/cluster" -w -m fast stop. - Run
lychd desktop volume revoke. Repeat the restore with the old cut and require refusal. Register a fresh generation against the original live cluster and require the old cut to fail again. In a disposable replacement-volume trial, unmount the source after shutting it down, mount a different volume at its former location and require the selection to fail before touching a database. Retain the UUIDs, provider/version, OS build, exact requestor permissions, timing, space measurements and query results with the platform receipt.
The dedicated volume workflow runs the APFS disk-image registration and missing-snapshot refusal on a hosted Mac. Its separate Windows Server job creates a disposable NTFS VHD, starts the CLI as a standard account, runs the fixed producer as the elevated runner and checks the restored row and revoked grant. An APFS positive capture requires an authorized producer on the qualification host. Native creation, the account's read access to its snapshot, the measured pause and row recovery require the actual OS, provider and storage. Follow desktop qualification for the current evidence boundary.