Last active
August 29, 2015 14:25
-
-
Save mikemccracken/57d09924dfc94b0cc358 to your computer and use it in GitHub Desktop.
test creating vgs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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