Re: file-backed cgd backup question

2023-11-01 Thread Greg Troxel
Paul Ripke writes: >> #!/bin/sh >> >> dd if=/dev/zero of=VND bs=1m count=1 >> cat VND > VND.000 >> vnconfig vnd0 VND >> cat VND > VND.001 >> newfs /dev/rvnd0a >> cat VND > VND.002 >> vnconfig -u vnd0 >> cat VND > VND.003 > > At least this DTRT: > > dd if=VND of=VND.004 iflag=direct That (and th

Re: file-backed cgd backup question

2023-11-01 Thread Paul Ripke
On Sun, Oct 22, 2023 at 09:40:53AM -0400, Greg Troxel wrote: > mlel...@serpens.de (Michael van Elst) writes: > > > g...@lexort.com (Greg Troxel) writes: > > > >>> vnd opens the backing file when the unit is created and closes > >>> the backing file when the unit is destroyed. Then you can access >

Re: file-backed cgd backup question

2023-10-22 Thread Greg Troxel
mlel...@serpens.de (Michael van Elst) writes: > g...@lexort.com (Greg Troxel) writes: > >>> vnd opens the backing file when the unit is created and closes >>> the backing file when the unit is destroyed. Then you can access >>> the file again. > >>Is there a guarantee of cache consistency for writ

Re: file-backed cgd backup question

2023-10-21 Thread Michael van Elst
g...@lexort.com (Greg Troxel) writes: >> vnd opens the backing file when the unit is created and closes >> the backing file when the unit is destroyed. Then you can access >> the file again. >Is there a guarantee of cache consistency for writes before and reads >after? Before the unit is created

Re: file-backed cgd backup question

2023-10-21 Thread Greg Troxel
mlel...@serpens.de (Michael van Elst) writes: > g...@lexort.com (Greg Troxel) writes: > >>I dimly knew this, but keep forgetting. Reading vndconfig(8), it does >>not explain that the normal path leads to incorrect behavior (stale >>reads from file cache even after closing the vnd, mtime). > > vnd

Re: file-backed cgd backup question

2023-10-20 Thread Michael van Elst
g...@lexort.com (Greg Troxel) writes: >I dimly knew this, but keep forgetting. Reading vndconfig(8), it does >not explain that the normal path leads to incorrect behavior (stale >reads from file cache even after closing the vnd, mtime). vnd opens the backing file when the unit is created and clo

Re: file-backed cgd backup question

2023-10-20 Thread Greg Troxel
mlel...@serpens.de (Michael van Elst) writes: > vnd has an optimization where the backing file isn't touched, but > the underlying device is accessed directly. Then file cache and > device aren't in sync and a backup program reading the file might > read stale data. vnd should probably update the

Re: file-backed cgd backup question

2023-10-19 Thread Michael van Elst
w...@netbsd.org (Thomas Klausner) writes: >For a cgd in a file that I mount via vnd+cgd, the file system contents >inside may change, but the actual file on the hard disk outside only >has 'access' time changes. So "smart" backup programs that check >timestamps to find out if they need to re-hash