Fix /slowdisk static-file offload: add reth guard and --keep-directory-symlink
- Add RETH GUARD to clone-backup.sh and clone-node.sh: when the config name contains 'reth', skip the whole /slowdisk static-file symlink offload and extract everything onto the primary disk (equivalent to --no-slowdisk). This matches the already-correct restore-volumes.sh behavior. Reason: reth refuses to start when its static_files directory is a symlink, failing at boot with 'failed to create dir static_files: File exists'. - Add --keep-directory-symlink to all tar extraction options in both scripts for the SLOWDISK path. This allows tar to extract files THROUGH the pre-created directory symlinks instead of trying to mkdir over them (which fails with 'Cannot mkdir: File exists'). This matches the already-correct restore-volumes.sh behavior. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -276,7 +276,7 @@ transfer_volume() {
|
||||
fi
|
||||
|
||||
local folder_size=$(du -sb "$source_folder" 2>/dev/null | awk '{print $1}')
|
||||
local tar_extract_opts="-xf - -C /"
|
||||
local tar_extract_opts="-xf - -C / --keep-directory-symlink"
|
||||
local use_slowdisk=false
|
||||
|
||||
# Check for SLOWDISK mode and detect static files
|
||||
@@ -297,7 +297,9 @@ transfer_volume() {
|
||||
if setup_slowdisk_structure "$key" "$static_size_kb" "${static_paths[@]}"; then
|
||||
use_slowdisk=true
|
||||
# Use --skip-old-files to avoid overwriting existing symlinks/directories
|
||||
tar_extract_opts="-xf - -C / --skip-old-files"
|
||||
# and --keep-directory-symlink so tar extracts THROUGH the pre-created dir symlinks
|
||||
# instead of trying to mkdir over them (which fails with 'Cannot mkdir: File exists')
|
||||
tar_extract_opts="-xf - -C / --skip-old-files --keep-directory-symlink"
|
||||
echo "SLOWDISK structure ready, will extract respecting symlinks"
|
||||
else
|
||||
echo "Warning: Failed to setup SLOWDISK structure, falling back to normal extraction"
|
||||
@@ -457,7 +459,7 @@ transfer_volume_ssh() {
|
||||
fi
|
||||
|
||||
local folder_size=$(du -sb "$source_folder" 2>/dev/null | awk '{print $1}')
|
||||
local tar_extract_opts="-xf - -C /"
|
||||
local tar_extract_opts="-xf - -C / --keep-directory-symlink"
|
||||
|
||||
# Check for SLOWDISK mode and detect static files (same logic as transfer_volume)
|
||||
if check_slowdisk_enabled; then
|
||||
@@ -475,7 +477,9 @@ transfer_volume_ssh() {
|
||||
echo "Setting up SLOWDISK structure on target..."
|
||||
# Setup slowdisk structure on remote
|
||||
if setup_slowdisk_structure "$key" "$static_size_kb" "${static_paths[@]}"; then
|
||||
tar_extract_opts="-xf - -C / --skip-old-files"
|
||||
# and --keep-directory-symlink so tar extracts THROUGH the pre-created dir symlinks
|
||||
# instead of trying to mkdir over them (which fails with 'Cannot mkdir: File exists')
|
||||
tar_extract_opts="-xf - -C / --skip-old-files --keep-directory-symlink"
|
||||
echo "SLOWDISK structure ready, will extract respecting symlinks"
|
||||
else
|
||||
echo "Warning: Failed to setup SLOWDISK structure, falling back to normal extraction"
|
||||
@@ -513,6 +517,15 @@ main() {
|
||||
# Set up cleanup trap
|
||||
trap cleanup_all_ports EXIT INT TERM
|
||||
|
||||
# RETH GUARD: reth refuses to start when its static_files directory is a symlink.
|
||||
# Match restore-volumes.sh: skip the whole /slowdisk static-file symlink offload
|
||||
# for reth nodes and extract everything onto the primary disk.
|
||||
if [[ "$1" == *reth* ]]; then
|
||||
echo "WARNING: $1 contains 'reth' — static-file symlink offload disabled (reth broke whole-dir symlinks)"
|
||||
echo " All volumes will be extracted onto the primary disk (equivalent to --no-slowdisk)"
|
||||
NO_SLOWDISK=true
|
||||
fi
|
||||
|
||||
setup_ssh_multiplex
|
||||
|
||||
# the following sysctls are critical for high-latency networks
|
||||
|
||||
Reference in New Issue
Block a user