LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-13-2015, 10:45 AM   #1
theosys
LQ Newbie
 
Registered: May 2009
Location: Austria
Distribution: Debian, openSUSE, (K)Ubuntu
Posts: 11

Rep: Reputation: 0
Howto recreating a partition table in a virtual disk?


The goal is to start an allready installed windows7 with KVM. To do this I've found this documentation:

use-a-real-windows-7-partition-in-virtualbox-kvm-vmware-player

A prerequisite is to create a virtual disk only containing a partition table. This partition table should point to real partitions on the disc. This is the currently used partition table:

Code:
~# fdisk -l /dev/sda

Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x16a708a6

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1              63     80324     80262  39,2M de Dell Utility
/dev/sda2  *        81920  25767935  25686016  12,3G  7 HPFS/NTFS/exFAT
/dev/sda3        25767936 557957119 532189184 253,8G  7 HPFS/NTFS/exFAT
/dev/sda4       557959166 976771071 418811906 199,7G  5 Extended
/dev/sda5       557959168 573581311  15622144   7,5G 82 Linux swap / Solaris
/dev/sda6       573583360 976771071 403187712 192,3G 83 Linux
The problem is, that this real partition table starts at sector 63. But when I want to create this partition table with "fdisk" it will start at sector 2048. I tried allready a lot, but was not able to create a partition table that points to the correct entry points of the real partitions.

Does anybody know, how I can create a valid, virtual partition table that works?

According to the document the partition table is valid, when I can mount the real partition with

Code:
mount /dev/md0p2 /mnt -oro
But this gives me only the following output:

Code:
~# mount /dev/md0p2 /mnt -oro 
mount: wrong fs type, bad option, bad superblock on /dev/md0p2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
Any help would be apreciated.
 
Old 03-15-2015, 12:06 PM   #2
theosys
LQ Newbie
 
Registered: May 2009
Location: Austria
Distribution: Debian, openSUSE, (K)Ubuntu
Posts: 11

Original Poster
Rep: Reputation: 0
In the meantime I found the answer. The tool "gpart" helped me to find the entry points of each partition. Now this works.

But now I've another problem. When I try to start windows with kvm, a black text window opens and it says: "booting from disk..."
But then nothing happens. What does that error message mean?
 
  


Reply

Tags
clone, kvm, partitions



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
Copying partition table to new disk sewerurchin Linux - Desktop 4 12-15-2012 06:17 PM
USB flash disk partition disappeared as well as partition table openmind Linux - Newbie 3 02-17-2011 05:20 PM
recreating overwritten partition table mastahyeti Linux - Hardware 2 05-30-2010 06:01 AM
howto dump partition table that larger than 2TB? edenCC Linux - Server 3 02-23-2009 11:28 AM
Disk doesn't contain a valid partition table expatCM Linux - Hardware 9 10-01-2007 02:38 AM

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

All times are GMT -5. The time now is 04:45 PM.

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