Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


Search this Thread
Old 05-22-2011, 09:45 AM   #1
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian
Posts: 738

Rep: Reputation: 29
qemu, qcow2 -> hard disk

is there a way to write/unpack .qcow2 hard disk image directly to real hard drive in Linux?

(I know it's possible to unpack .qcow2 to .raw and then dd to drive, but I'd like to skip .raw since its large)
Old 05-22-2011, 11:50 AM   #2
Registered: Mar 2008
Posts: 11,747

Rep: Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445
I'd boot the image to qemu an dd it or clonezilla/tar/cp it to some place.

While in qemu you could blank free space to reduce expanded size.

It might be possible to use qemuimage then port the output to someplace but I never did it or heard of it.
Old 05-22-2011, 02:02 PM   #3
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian
Posts: 738

Original Poster
Rep: Reputation: 29
it seems very hard to access the physical drive directly from qemu. besides its extremely sloow (qemu-sparc).

I already did wipe free space, so qcow2 image is quite small.
would be nice to pipe qemu-img output directly to dd, is that possible?

edit: I tried this as a test:
qemu-img convert -O raw /home/debian/qemuimage.qcow2 |dd of=test

however it didn't work. the problem is in qemu-img, how to redirect its output?
dd seems to accept piping just fine

edit2: it seems they will never add that feature:

Last edited by qrange; 05-22-2011 at 02:41 PM.
Old 05-01-2013, 11:25 PM   #4
Registered User
Registered: Dec 2006
Posts: 6

Rep: Reputation: 1
You might want to try qemu-img convert -O raw diskimage.qcow2 /dev/mydevice
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Qemu- hard disk emulation hamedn Linux - Software 2 04-10-2010 08:34 AM
Copy of IBM Server hard disk data to Another USB External Hard disk mazharcdn Linux - Server 2 09-02-2009 12:41 AM
qemu: use physical hard disk (host drives) - dangerous? gernonimo Linux - Software 10 09-18-2008 07:44 PM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM

All times are GMT -5. The time now is 02:54 PM.

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