WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] messed up partition table on img file

To: James Pifer <jep@xxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] messed up partition table on img file
From: John Haxby <john.haxby@xxxxxxxxxx>
Date: Wed, 24 Jun 2009 13:50:07 +0100
Cc: Xen List <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 24 Jun 2009 05:54:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1245847423.30528.31.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <1245847423.30528.31.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2
On 24/06/09 13:43, James Pifer wrote:
I have a domU that uses a disk img but it won't boot. The partition
table seems to be messed up.

If I do:
# /sbin/fdisk -ul disk0
You must set cylinders.
You can do this from the extra functions menu.

Disk disk0: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes

  Device Boot      Start         End      Blocks   Id  System
disk0p1              63     1574369      787153+  82  Linux swap / Solaris
disk0p2         1574370    83875364    41150497+  83  Linux
Partition 2 has different physical/logical endings:
      phys=(1023, 254, 63) logical=(5220, 254, 63)


I can mount the partition like this:
mount -o loop,offset=806077440 -t ext3 disk0 tmp

Ideally I'd like to fix the img so it can boot. Otherwise, I could
rebuild it now that I know I can actually get at the data.

Any suggestions on fixing the img file?


If memory serves, pygrub looks for the partition with the grub stuff on it by looking for a partition with the bootable flag set and if it doesn't find one it uses the first partition. In this case that means it's going to try to boot off the swap partition.

Try 'a' in fdisk to toggle the boot flag on the second partition.

jch

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>