From 3d26cd83b0a05239d6be0eba08e8d4ffc8a936c8 Mon Sep 17 00:00:00 2001 From: Markus Ressel Date: Mon, 6 Nov 2023 23:36:25 +0100 Subject: [PATCH] add --reflink=never to cp on linux --- zfs-inplace-rebalancing.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zfs-inplace-rebalancing.sh b/zfs-inplace-rebalancing.sh index b66a01f..9e6afd4 100755 --- a/zfs-inplace-rebalancing.sh +++ b/zfs-inplace-rebalancing.sh @@ -92,11 +92,12 @@ function rebalance () { if [[ "${OSTYPE,,}" == "linux-gnu"* ]]; then # Linux + # --reflink=never -- force standard copy (see ZFS Block Cloning) # -a -- keep attributes # -d -- keep symlinks (dont copy target) # -x -- stay on one system # -p -- preserve ACLs too - cp -adxp "${file_path}" "${tmp_file_path}" + cp --reflink=never -adxp "${file_path}" "${tmp_file_path}" elif [[ "${OSTYPE,,}" == "darwin"* ]] || [[ "${OSTYPE,,}" == "freebsd"* ]]; then # Mac OS # FreeBSD