**作者:张华 发表于:2016-11-04版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明(http://blog.csdn.net/quqi99)**#!/bin/bashRELEASE='yakkety'MOUNTPOINT="/tmp/nbd-${RANDOM}"DISK_DEV=/dev/nbd0
BOOT_DEV=/dev/nbd0p1
ROOT_DEV=/dev/nbd0p2
PASSWORD='password'IMG_DISK_SIZE=8G
BASE_MAC="52:54:74:b7:10:"NETWORK="192.168.123."qemu-img create-fqcow2 /images/guest.qcow2${IMG_DISK_SIZE}modprobe nbd max_part=16qemu-nbd -c${DISK_DEV}/images/guest.qcow2
fdisk${DISK_DEV}<< EOF
n,p,1,\n,+256M
n,p,2,\n,\n
w
EOF
fdisk-l${DISK_DEV}|grep dev
mkfs.ext2 -LBOOT${BOOT_DEV}mkfs.ext4 -LROOT${ROOT_DEV}mkdir -p${MOUNTPOINT}/boot
mou
...
继续阅读
(71)