LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 04-27-2018, 09:37 PM   #1
nbritton
Member
 
Registered: Jun 2013
Location: Dubuque, IA
Distribution: Red Hat Enterprise Linux, Mac OS X, Ubuntu, Fedora, FreeBSD
Posts: 89

Rep: Reputation: Disabled
lsblk reports qemu-img created disk is only 200k


On Ubuntu 18.04 I created an image with the following command:

Code:
qemu-img create -f qcow2 /var/lib/libvirt/images/image.qcow2 500G;
I then attached it with the following command:

Code:
virsh attach-disk vm_name  --source /var/lib/libvirt/images/image.qcow2 --persistent --target vdb
When I go into the vm and run lsblk, it reports the disk is only 200k.

Code:
root@JQ3XL02:~# virsh console vm_name
root@ubuntu:~# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    253:0    0   30G  0 disk
└─vda1 253:1    0   30G  0 part /
vdb    253:16   0  200K  0 disk
vdc    253:32   0  200K  0 disk
vdd    253:48   0  200K  0 disk
vde    253:64   0  200K  0 disk
vdf    253:80   0  200K  0 disk
vdg    253:96   0  200K  0 disk
root@ubuntu:~# parted /dev/vdb
GNU Parted 3.2
Using /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: /dev/vdb: unrecognised disk label
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 205kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
qemu-img info /var/lib/libvirt/images/image.qcow2 reports:
image: /var/lib/libvirt/images/image.qcow2
file format: qcow2
virtual size: 500G (536870912000 bytes)
disk size: 200K
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
 
Old 04-28-2018, 12:47 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
You can expand the virtual hard drive when you create it or it will remain in a very small state ready to be expanded when needed. I forget the qemu command to do that but in manual. grow maybe?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Size of vm created by qemu-img convert Nick_C Linux - Virtualization and Cloud 14 03-30-2012 05:29 AM
kvm-qemu-img: qcow2 disk image format changes to raw format in RHEL-KVM 5.6 rajivdp Linux - Virtualization and Cloud 2 09-19-2011 11:23 AM
After qemu-img, qemu is not capable to detect the C drive (empty) frenchn00b Linux - General 3 10-18-2009 05:39 AM
Qemu.img to hard drive towjamb Debian 3 04-17-2007 05:33 PM
Mounting a qemu created root disk image Valhalla Linux - Software 4 10-26-2005 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 06:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration