diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-08-08 19:41:04 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-08-08 19:41:04 -0300 |
commit | f5dff063011a91109085beb743d94c653b08a9c7 (patch) | |
tree | c48771b9dd0ab228cff9485a5e60230a40f498d9 | |
parent | d1d4b7d54838fdda4d38441b450ed6705ef82f90 (diff) | |
download | hydra-f5dff063011a91109085beb743d94c653b08a9c7.tar.gz hydra-f5dff063011a91109085beb743d94c653b08a9c7.tar.bz2 |
Creating disk volumes just if needed
-rwxr-xr-x | share/hydractl/provision | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision index 309e430..1c1c9b9 100755 --- a/share/hydractl/provision +++ b/share/hydractl/provision @@ -48,9 +48,22 @@ read answer # Create volumes. echo "Creating the needed disk volumes..." -pvcreate "$device"3 -vgcreate $vg "$device"3 -lvcreate -L20G -n root $vg + +if ! pvdisplay "$device"3 &> /dev/null; then + echo "Creating physical volume..." + pvcreate "$device"3 +fi + +if ! vgdisplay $vg &> /dev/null; then + echo "Creating volume group..." + vgcreate $vg "$device"3 +fi + +if ! lvdisplay $vg/root &> /dev/null; then + echo "Creating logical volume..." + lvcreate -L20G -n root $vg +fi + vgchange -a y $vg # Garbage. |