[Novalug] virsh cheat sheet?

William Morse wmorse@americancouncils.org
Thu Aug 29 17:21:13 EDT 2013


Aha! "Use kpart to get the device nodes" - If I understand this correctly, I can use kpartx to mount the target drive on the image file and stuff it with my OS image, and then do the same to the first 1MB to get an MBR in place. I can then use a windows repair disk to force updating the MBR in case it perceives some change in the hardware. This could work:

Thanks, Derek!




From: Derek LaHousse [mailto:dlahouss@mtu.edu] 
Sent: Thursday, August 29, 2013 2:41 PM
To: William Morse
Cc: novalug@calypso.tux.org
Subject: Re: [Novalug] virsh cheat sheet?

Create a disk image that is 1MB + 100GB.  Use fdisk to partition it into a single partition, starting at 1MB (because it makes the math easier, you could use sector 63).  Use kpart to get the device nodes.  Now overwrite the new partition with your clone of the disk.
Then, overwrite the first 446 bytes with windows bootloader, or potentially run a recovery disk and "repair" it.

On Thu, Aug 29, 2013 at 2:14 PM, William Morse <wmorse@americancouncils.org> wrote:
OK, but here is my problem: my entire disk has a huge linux partition (800gb ?) that I do not want or need to virtualize. The win7 partition I want to virtualize is only about 100GB.

What I would really like is to construct a MBR that allows a VM to boot that win7 image.  The only thing I can think to do is to create a vm with a drive that is slightly bigger than my image and somehow overwrite the image at the point where the mbr indicates the OS starts. However, I have no idea how to actually do this this...

-William Morse

-----Original Message-----
From: novalug-bounces@calypso.tux.org [mailto:novalug-bounces@calypso.tux.org] On Behalf Of The Doctor
Sent: Thursday, August 29, 2013 1:56 PM
To: novalug@calypso.tux.org
Subject: Re: [Novalug] virsh cheat sheet?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/28/2013 12:26 PM, William Morse wrote:
> But is there a way to fuse a fabricated MBR with a raw partition image
> to act together as a disk image?

Yes.  Rip an image of the entire disk (/dev/sda) instead of just a partition (/dev/sda1).  A good example of this is the Raspbian
(http://www.raspbian.org/) disk image.

- --
The Doctor [412/724/301/703] [ZS]
Developer, Project Byzantium: http://project-byzantium.org/

PGP: 0x807B17C1 / 7960 1CDC 85C9 0B63 8D9F  DD89 3BD8 FF2B 807B 17C1
WWW: https://drwho.virtadpt.net/

If you're racing through life, you're racing to the end.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlIfiwQACgkQO9j/K4B7F8GtbQCeIqWHSJs+TWIONpZA5ukCQ7Z/
QBYAoOlaOCjWk/NUyv3tQqKY8GH9Z08c
=cr06
-----END PGP SIGNATURE-----
_______________________________________________
Novalug mailing list
Novalug@calypso.tux.org
http://calypso.tux.org/mailman/listinfo/novalug
_______________________________________________
Novalug mailing list
Novalug@calypso.tux.org
http://calypso.tux.org/mailman/listinfo/novalug




More information about the Novalug mailing list