1
1
Fork 0

changed kvm scripts

This commit is contained in:
David Starzengruber 2011-03-11 21:00:58 +01:00
parent 5d42f803b1
commit b7f751e05f
2 changed files with 21 additions and 12 deletions

View File

@ -5,6 +5,15 @@
# v0.1
#
# read imagename
if [ -z $1 ]; then
echo 'usage: "browseqcow2 <image.qcow2>"'
exit 1
fi
imagename=$1
# im i root
if [ $(whoami) != "root" ]; then
echo "only root can do this"
@ -20,14 +29,6 @@ if [[ $1 = "--unmount" || $1 = "-u" || $1 = "--umount" ]]; then
exit 0
fi
# read imagename
if [ -z $1 ]; then
echo 'usage: "browseqcow2 <image.qcow2>"'
exit 1
fi
imagename=$1
# load kernel module
modprobe nbd max_part=8

View File

@ -1,8 +1,16 @@
#!/bin/bash
# generating new qcow2 disk
echo "what name should it have?"
read name
if [ -z $1 ]; then
# reading the imagename
echo "what name should it have?"
read name
else
name=$1
fi
qemu-img create -f qcow2 $name.qcow2 8G
# generating the actual image
qemu-img create -f qcow2 $name.qcow2 16G
exit 0