- 論壇徽章:
- 0
|
準備做一個kvm客戶機,但是fdisk分區(qū)後,發(fā)現(xiàn)目錄無法被識別
執(zhí)行了以下命令:
生成磁盤映像
dd if=/dev/zero of=hda_16G.img bs=4096 count=4000000
分區(qū)
fdisk -C 16065 -H 255 -S 63 hda_16G.img
n
p
4
2048
20000000(取中間值,留出空間給安裝程序)
w
losetup -o 1048576 /dev/loop0 hda_16G.img
mkfs.ext3 -m 0 /dev/loop0
mount /dev/loop0 /mnt/rootfs
將Centos安裝ISO解壓後拷貝到掛載的磁盤映像里。
cp -r /root/cdrom/* /mnt/rootfs
losetup -d /dev/loop0
umount /mnt/rootfs/
最后用virt-install 安裝CentOS客戶機
virt-install -v -n centos1 -r 1024 --vcpus=2 --accelerate --os-type=linux -l /home/ks/bootdisk --disk path=/home/ks/bootdisk/hda_16G.img --virt-type=kvm --nographic -w bridge:br0 --extra-args='console=tty0 console=ttyS0,115200n8 root=/dev/ram init=/init'
但是安裝提示:
|An error occured finding the │
│ installation image on your │
│ hard drive. Please check your │
│ images and try again. |
發(fā)現(xiàn)原ISO目錄里的目錄 images 和 Packages
被識別成了文件,從而導致images和Packages里面的安裝映像及包無法被讀取。
這個是不是fdisk的bug啊。 |
|