I installed Redhat 6.4 on KVM Server. Right Now there is only One Disk /dev/vda. Now I need to add extra Disk like /dev/vdb I tried adding New Volume but it is not showing when I do fdisk -l
How to add extra Volumes to existing running VMs
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
You can use the
virsh option mentioned above (probably faster, in fact) or you can use the "Add Hardware" option in
virt-manager to either add new space or assign existing space.
Simply open the VM, go to "Details" (top left), and select "Add Hardware" (bottom left):
Storage is the default type of hardware, so it should already be selected by default.
FWIW, since it's a new disk, if the guest is Linux, you probably want to add it as VirtIO instead of IDE. VirtIO has better performance but non-Linux platforms need special drivers installed to be able to use VirtIO drives.
The GUI is pretty self-explanatory. Since you've already created the
.img file you probably want to select the "managed or existing storage" radio and go browsing for it. After that, it should be visible to the guest.
Adding a virtual disk can be done either using
virt-manager (A graphical interface for KVM) or
virsh edit VM-name
Modify your configuration file as needed and save the configuration file (See your
vda configuration line).
NOTE: You need to reboot the VM so the virtual disk is recognized.
Shutdown your VM using
virsh destroy VM-name and start the vm again using
virsh start VM-name
Once you have logged in to the VM check
fdisk -l as root, otherwise it will not show anything.
mkfs.ext3 /dev/vdb or
mkfs.ext4 /dev/vdb to assign a file system to the virtual disk.