Skip to content

Instantly share code, notes, and snippets.

@mikemccracken
Last active August 29, 2015 14:25
Show Gist options
  • Save mikemccracken/57d09924dfc94b0cc358 to your computer and use it in GitHub Desktop.
Save mikemccracken/57d09924dfc94b0cc358 to your computer and use it in GitHub Desktop.
test creating vgs
#!/bin/bash
set -ex
dev=$(losetup -f)
file=VGTEST_DELME
vg=TEST_LV
cleanup() {
vgremove -f $vg || true
losetup -d $dev || true
rm -f $file
}
trap cleanup EXIT
rm -rf $file
truncate -s 10G $file
losetup $dev $file
vgcreate -vv $vg $dev && vgremove -f $vg
pvcreate -vv $dev
vgcreate -vv $vg $dev
echo DONE
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment