In this tutorial s hows you how to add additional disk storage to a KVM VM using virsh command line option on Linux.
![]() Qemu Img Convert To Qcow2 Portable To AllThis format has the advantage of being simple and easily exportable to all other emulators.However, QEMU image format (qcow2) the most versatile format.
Qemu Img Convert To Qcow2 How To Add AdditionalTry qcow2 format. The syntax is as follows: sudo qemu-img create -f qcow2 ubuntu-box2-vm-disk1-5G 5G Step 2 Attach the disk to the virtual machine Before you attache the disk to your VM, find out current disk name. Login to your VM and type the following command: df OR sudo fdisk -l grep Disk devvda-z Sample outputs: Disk devvda: 40 GiB, 42949672960 bytes, 83886080 sectors So my VM has devvda with 40GiB size. To attach newly created ubuntu-box1-vm-disk1-5G image, you must use a devvdb. If you already have a devvdb disk you need to change vdb to a free device like devvdc and so on. Disk attached successfully Be Careful: With just a few keystrokes, fdisk can wipe out part or all of your hard disk or working partition. Make sure you use correct device names with the fdisk command. Step 3 Partitioning the disk drive in VM Now the guest named ubuntu-box1 now has a hard disk device called devvdb. ![]() Sample session from the fdisk command: Fig.01: Partition the drive with fdisk command in VM To format the new partition with the ext4 file system, enter: sudo mkfs.ext4 devvdb1 Sample outputs: Fig.02: Format devvdb1 it as ext4 Finally, you need to create a mount directory: sudo mkdir disk2 And mount the disk on the guest: sudo mount devvdb1 disk2 Edit the file etcfstab sudo vi etcfstab And update it as follows so that devvdb1 get mounted across reboot persistently: devvdb1 disk2 ext4 defaults 0 0 Save and close the file. And there you have it, the guest VM now has an additional virtualized file-based storage device under KVM Linux-based system. Get the latest tutorials on SysAdmin, LinuxUnix, Open SourceDevOps topics: RSS feed or Weekly email newsletter Share to Twitter Facebook. Comment Name Email Website Use HTML.,. Qemu Img Convert To Qcow2 Password Login OnNext FAQ: How to disable ssh password login on Linux to increase security Previous FAQ: How to rename KVM virtual machine (VM) domain with virsh command 2020 nixCraft Privacy ToS ContactEmail Search Sponsored by Linode.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |