Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

copy existing partition to an image file...for use with Xen

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
dvh
Apprentice
Apprentice
Posts: 179
Joined: Wed Dec 31, 2003 8:09 pm
Location: Chandler, AZ

copy existing partition to an image file...for use with Xen

  • Quote

Post by dvh » Sun Sep 26, 2010 2:26 am

I have a current partition that contains a solid 32-bit gentoo system (single partition for entire system, including boot). I would like to copy this partition to an image file so that it can be portable, used as a Xen DomU. I have searched this forum, and the larger web for help. The closest I have come is this link:

http://forums.gentoo.org/viewtopic-t-55 ... +disk.html

This link is old, so I am hoping that something has changed in the last couple of years. in essence, the advice is to use "dd" to copy the partition to an image file (easy, I can do this) and then use qemu-img to convert it to whatever format I want (again, easy, I can do it). but I need the image to be bootable by Xen, and it does not appear that "dd" will do the job.

Is there any straightforward way to convert an existing partition into a bootable image file?

-dvh
Top
suicidal_orange_II
Apprentice
Apprentice
Posts: 299
Joined: Sat Sep 04, 2004 11:39 am

  • Quote

Post by suicidal_orange_II » Sun Sep 26, 2010 2:54 am

I've never used Xen but if you can boot a CD or iso in it with the disk image as the primary hard drive you could probably chroot into the file/drive and run grub to make it bootable? I would assume the script adds some kind of partition table to the dd'd image, and grub would add itself to the blank bootloader section.

Hope that helps :)
Top
dvh
Apprentice
Apprentice
Posts: 179
Joined: Wed Dec 31, 2003 8:09 pm
Location: Chandler, AZ

  • Quote

Post by dvh » Sun Sep 26, 2010 6:42 pm

Thanks for replying. I had thought about doing something like you suggested. Also, I thought maybe I could copy a currently working image that does boot, then completely replace the image contents using some form of copy from the existing partition. But surely I cannot be the first who want to do this. isn't there a cleaner way?

-dvh
Top
dvh
Apprentice
Apprentice
Posts: 179
Joined: Wed Dec 31, 2003 8:09 pm
Location: Chandler, AZ

  • Quote

Post by dvh » Sun Oct 10, 2010 11:38 pm

I have managed to boot a Xen VM using my disk image, because Xen holds the kernel within the Dom0 domain. once the VM is running, it would seem simple to install grub. but when I run grub, and try to set the root like this:

Code: Select all

grub> root (hd0)

Error 21: Selected disk does not exist

grub> 
you can see that hd0 is not the right designator. anybody know what the correct syntax here might be?

-dvh
Top
Post Reply

4 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic