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

[Xen-users] Problems with pygrub: ValueError: unable to open file

To: "Xen Users" <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-users] Problems with pygrub: ValueError: unable to open file
From: "Michael Paesold" <mpaesold@xxxxxx>
Date: Thu, 23 Mar 2006 20:58:58 +0100
Delivery-date: Thu, 23 Mar 2006 20:00:32 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
I am currently struggling with getting pygrub to work. I am using unstable
9327:cf89e8f0831b with 2.6.16-rc6-git3 on CentOS 4 (although the kernel
version should not matter here).

I dedicated the partition /dev/sdb1 to a virtual machine, used fdisk to
sub-partition this into partitions again. Finally I used dmsetup (device
mapper) to temporarily make the partitions available to format and mount
them, and install the guest OS (linux) from a backup archive.

Using a regular xm config, I can happily boot the guest and it works
perfectly (mounts all partitions and just works). I use disk = [
'phy:sdb1,sda,w' ].

When I use bootloader = "/root/pygrub" instead, I get the following trace
when trying to do xm create:

Traceback (most recent call last):
 File "/root/pygrub", line 258, in ?
   cf = get_config(file, isconfig)
 File "/root/pygrub", line 121, in get_config
   fs = fstype.open_fs(fn, offset)
 File "/usr/lib/python2.3/site-packages/grub/fsys/ext2/__init__.py", line
35, in open_fs
   return Ext2Fs(fn, offset = offset)
ValueError: unable to open file
Error: Boot loader didn't return any data!

I checked the values of fn and offset:
fn = /dev/sdb1
offset = 512

This seems perfectly ok, considering the output of fdisk:

Disk /dev/sdb1: 15.0 GB, 15011103744 bytes
255 heads, 63 sectors/track, 1824 cylinders, total 29318562 sectors
Units = sectors of 1 * 512 = 512 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/sdb1p1   *           1      208844      104422   83  Linux
/dev/sdb1p2          208845     2313359     1052257+  82  Linux swap
/dev/sdb1p3         2313360    29302559    13494600   83  Linux

One sector is indeed 512 bytes, so the offset of one sector into /dev/sdb1
seems perfectly ok.

Additionally I tried to copy the partition to an image file with dd. Result: exactly the same error as above. Now, using lomount gives this error: "vm1.img: File too
large".
Copying only the first gigabyte into the image (the boot partition is only
100 mb) makes lomount work (mounts the boot partition correctly), but pygrub
will still say "ValueError: unable to open file" in Ext2Fs, even for the
truncated image file.

Please, help me find and fix this problem.

Best Regards,
Michael Paesold

--
Michael Paesold | Emerion WebHosting Gmbh
mpaesold gmx at | http://www.emerion.com




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