Skip to content

Commit 1b6a991

Browse files
cmd/integration: add mdbx_copy compact in-place one-liner (#21189)
Adds a `## Compact chaindata in-place` section to `cmd/integration/Readme.md` with the `mdbx_copy -c -u` one-liner that compacts the DB in-place using a temp file, then atomically renames it over the original.
1 parent f2616bb commit 1b6a991

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmd/integration/Readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ rm -rf datadir/snapshots/*borch*
164164
erigon snapshots integrity --datadir /erigon-data/ --check=BorCheckpoints
165165
```
166166

167+
## Compact chaindata in-place
168+
169+
```sh
170+
src=<datadir>/chaindata && ./build/bin/mdbx_copy -c -u "$src" "${src}/mdbx.dat.tmp" && mv "${src}/mdbx.dat.tmp" "${src}/mdbx.dat" || rm -f "${src}/mdbx.dat.tmp"
171+
```
172+
167173
## See tables size
168174

169175
```sh

0 commit comments

Comments
 (0)