LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

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

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
jefro
Guru
 
Registered: Mar 2008
Posts: 11,590

Rep: Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419
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
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian
Posts: 727

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: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=513451

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

Rep: Reputation: 0
You might want to try qemu-img convert -O raw diskimage.qcow2 /dev/mydevice

http://en.wikibooks.org/wiki/QEMU/Im...hysical_device
 
  


Reply


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 03:15 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration