mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
F #2885: Check with yes for zero'ing attributes
This commit is contained in:
parent
5c1dbe9471
commit
0059c29eb6
@ -130,7 +130,7 @@ CLONE_CMD=$(cat <<EOF
|
||||
hostname -f >"${DST_DIR}/.host" || :
|
||||
|
||||
# zero trailing space
|
||||
if [ -n "${ZERO_LVM_ON_CREATE}" ]; then
|
||||
if [ "${ZERO_LVM_ON_CREATE}" = "yes" ]; then
|
||||
LVSIZE=\$(${SUDO} ${LVS} --nosuffix --noheadings --units B -o lv_size "${DEV}" | tr -d '[:blank:]')
|
||||
${DD} if=/dev/zero of="${DEV}" bs=64k \
|
||||
oflag=seek_bytes iflag=count_bytes \
|
||||
|
@ -78,7 +78,7 @@ EOF
|
||||
|
||||
if [ -n "${DS_SYS_ID}" ]; then
|
||||
|
||||
if [ -n "${ZERO_LVM_ON_DELETE}" ]; then
|
||||
if [ "${ZERO_LVM_ON_DELETE}" = "yes" ]; then
|
||||
ssh_exec_and_log "$DST_HOST" "$ZERO_CMD" "Error cleaning $DST_PATH"
|
||||
fi
|
||||
|
||||
|
@ -59,7 +59,7 @@ VG_NAME="vg-one-$DS_SYS_ID"
|
||||
DEV="/dev/${VG_NAME}/${LV_NAME}"
|
||||
|
||||
# Get current LV size
|
||||
if [ -n "${ZERO_LVM_ON_CREATE}" ]; then
|
||||
if [ "${ZERO_LVM_ON_CREATE}" = "yes" ]; then
|
||||
|
||||
LVSIZE_CMD=$(cat <<EOF
|
||||
set -e -o pipefail
|
||||
@ -91,7 +91,7 @@ exclusive "${LOCK}" 120 ssh_exec_and_log "$SRC_HOST" "$RESIZE_CMD" \
|
||||
"Error resizing LV named $LV_NAME"
|
||||
|
||||
# Zero additional space
|
||||
if [ -n "${ZERO_LVM_ON_CREATE}" ]; then
|
||||
if [ "${ZERO_LVM_ON_CREATE}" = "yes" ]; then
|
||||
ZERO_CMD=$(cat <<EOF
|
||||
set -e -o pipefail
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user