[lvm-devel] master - tests: improve lib wipefs_a

David Teigland teigland at sourceware.org
Fri Oct 4 16:08:05 UTC 2019


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a22729a5577689d896ea13a82e6af7f7dde30412
Commit:        a22729a5577689d896ea13a82e6af7f7dde30412
Parent:        414f903cdc161e553100af6ad03e68fbf94617c3
Author:        David Teigland <teigland at redhat.com>
AuthorDate:    Fri Oct 4 11:04:44 2019 -0500
Committer:     David Teigland <teigland at redhat.com>
CommitterDate: Fri Oct 4 11:06:38 2019 -0500

tests: improve lib wipefs_a

in wipefs fallback, use limited dd and mdadm --zero-superblock
to avoid writing to entire dev in case dev space is provisioned
on write.
---
 test/lib/aux.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 8ceb5db..36e1c2b 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -804,7 +804,8 @@ wipefs_a() {
 	if wipefs -V >/dev/null; then
 		wipefs -a "$dev"
 	else
-		dd if=/dev/zero of="$dev" bs=1024 || true
+		dd if=/dev/zero of="$dev" bs=4096 count=8 || true
+		mdadm --zero-superblock "$dev" || true
 	fi
 }
 




More information about the lvm-devel mailing list