xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* pygrub gives "raise RuntimeError("Unable to find partition containing kernel")"
@ 2019-05-19  9:05 Kevin Buckley
  2019-05-19  9:05 ` [Xen-devel] " Kevin Buckley
  2019-06-15  9:37 ` Kevin Buckley
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Buckley @ 2019-05-19  9:05 UTC (permalink / raw)
  To: xen-devel

Hi there,

just came to try and boot a VM using the Xen i've building under LFS
and saw this in the bootloader log after the boot had failed:

# cat /media/sda5/root/bootloader.3.log
Using <class 'grub.GrubConf.Grub2ConfigFile'> to parse /boot/grub/grub.cfg
Traceback (most recent call last):
  File "/usr/lib/xen/bin/pygrub", line 928, in <module>
    raise RuntimeError("Unable to find partition containing kernel")
RuntimeError: Unable to find partition containing kernel

Having found this

  https://tipstricks.itmatrix.eu/pygrub-unable-to-find-partition-containing-kernel/

which mentions this

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=745419

the suggestion appears to be that this had been fixed in Xen, back in 2015 ?

Just in case I have missed something, here's what I have
as regards the VBD image I am trying to boot

# parted -s /dev/vg_xen_vbds/lv_4g_01 unit s print free
Model: Linux device-mapper (linear) (dm)
Disk /dev/dm-0: 8388608s
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start  End       Size      Type     File system  Flags
        63s    2047s     1985s              Free Space
 1      2048s  8388607s  8386560s  primary  ext4         boot

and here are the first 512 bytes of the image:

# dd if=/dev/vg_xen_vbds/lv_4g_01 of=first512 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000748337 s, 684 kB/s
root@flat36:~# xxd first512
0000000: eb63 9010 8ed0 bc00 b0b8 0000 8ed8 8ec0  .c..............
0000010: fbbe 007c bf00 06b9 0002 f3a4 ea21 0600  ...|.........!..
0000020: 00be be07 3804 750b 83c6 1081 fefe 0775  ....8.u........u
0000030: f3eb 16b4 02b0 01bb 007c b280 8a74 0302  .........|...t..
0000040: 8000 0080 0068 1000 0008 fa90 90f6 c280  .....h..........
0000050: 7502 b280 ea59 7c00 0031 0080 0100 0000  u....Y|..1......
0000060: 0000 0000 fffa 9090 f6c2 8074 05f6 c270  ...........t...p
0000070: 7402 b280 ea79 7c00 0031 c08e d88e d0bc  t....y|..1......
0000080: 0020 fba0 647c 3cff 7402 88c2 52bb 1704  . ..d|<.t...R...
0000090: 8027 0374 06be 887d e817 01be 057c b441  .'.t...}.....|.A
00000a0: bbaa 55cd 135a 5272 3d81 fb55 aa75 3783  ..U..ZRr=..U.u7.
00000b0: e101 7432 31c0 8944 0440 8844 ff89 4402  ..t21..D.@.D..D.
00000c0: c704 1000 668b 1e5c 7c66 895c 0866 8b1e  ....f..\|f.\.f..
00000d0: 607c 6689 5c0c c744 0600 70b4 42cd 1372  `|f.\..D..p.B..r
00000e0: 05bb 0070 eb76 b408 cd13 730d f6c2 800f  ...p.v....s.....
00000f0: 84d0 00be 937d e982 0066 0fb6 c688 64ff  .....}...f....d.
0000100: 4066 8944 040f b6d1 c1e2 0288 e888 f440  @f.D...........@
0000110: 8944 080f b6c2 c0e8 0266 8904 66a1 607c  .D.......f..f.`|
0000120: 6609 c075 4e66 a15c 7c66 31d2 66f7 3488  f..uNf.\|f1.f.4.
0000130: d131 d266 f774 043b 4408 7d37 fec1 88c5  .1.f.t.;D.}7....
0000140: 30c0 c1e8 0208 c188 d05a 88c6 bb00 708e  0........Z....p.
0000150: c331 dbb8 0102 cd13 721e 8cc3 601e b900  .1......r...`...
0000160: 018e db31 f6bf 0080 8ec6 fcf3 a51f 61ff  ...1..........a.
0000170: 265a 7cbe 8e7d eb03 be9d 7de8 3400 bea2  &Z|..}....}.4...
0000180: 7de8 2e00 cd18 ebfe 4752 5542 2000 4765  }.......GRUB .Ge
0000190: 6f6d 0048 6172 6420 4469 736b 0052 6561  om.Hard Disk.Rea
00001a0: 6400 2045 7272 6f72 0d0a 00bb 0100 b40e  d. Error........
00001b0: cd10 ac3c 0075 f4c3 9d7c 0200 0000 8020  ...<.u...|.....
00001c0: 2100 832a a00a 0008 0000 00f8 7f00 0000  !..*............
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.

I am able to boot the VM using the Xen 4.4 from a Ubuntu 14 system,
but the Xen I built under LFS (which was taken from commit cb70a26
as per my earlier posts about building on systems that may not have
a "python") gives me the "Unable to find partition containing kernel" error

Any clues?
Kevin

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Xen-devel] pygrub gives "raise RuntimeError("Unable to find partition containing kernel")"
  2019-05-19  9:05 pygrub gives "raise RuntimeError("Unable to find partition containing kernel")" Kevin Buckley
@ 2019-05-19  9:05 ` Kevin Buckley
  2019-06-15  9:37 ` Kevin Buckley
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Buckley @ 2019-05-19  9:05 UTC (permalink / raw)
  To: xen-devel

Hi there,

just came to try and boot a VM using the Xen i've building under LFS
and saw this in the bootloader log after the boot had failed:

# cat /media/sda5/root/bootloader.3.log
Using <class 'grub.GrubConf.Grub2ConfigFile'> to parse /boot/grub/grub.cfg
Traceback (most recent call last):
  File "/usr/lib/xen/bin/pygrub", line 928, in <module>
    raise RuntimeError("Unable to find partition containing kernel")
RuntimeError: Unable to find partition containing kernel

Having found this

  https://tipstricks.itmatrix.eu/pygrub-unable-to-find-partition-containing-kernel/

which mentions this

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=745419

the suggestion appears to be that this had been fixed in Xen, back in 2015 ?

Just in case I have missed something, here's what I have
as regards the VBD image I am trying to boot

# parted -s /dev/vg_xen_vbds/lv_4g_01 unit s print free
Model: Linux device-mapper (linear) (dm)
Disk /dev/dm-0: 8388608s
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start  End       Size      Type     File system  Flags
        63s    2047s     1985s              Free Space
 1      2048s  8388607s  8386560s  primary  ext4         boot

and here are the first 512 bytes of the image:

# dd if=/dev/vg_xen_vbds/lv_4g_01 of=first512 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000748337 s, 684 kB/s
root@flat36:~# xxd first512
0000000: eb63 9010 8ed0 bc00 b0b8 0000 8ed8 8ec0  .c..............
0000010: fbbe 007c bf00 06b9 0002 f3a4 ea21 0600  ...|.........!..
0000020: 00be be07 3804 750b 83c6 1081 fefe 0775  ....8.u........u
0000030: f3eb 16b4 02b0 01bb 007c b280 8a74 0302  .........|...t..
0000040: 8000 0080 0068 1000 0008 fa90 90f6 c280  .....h..........
0000050: 7502 b280 ea59 7c00 0031 0080 0100 0000  u....Y|..1......
0000060: 0000 0000 fffa 9090 f6c2 8074 05f6 c270  ...........t...p
0000070: 7402 b280 ea79 7c00 0031 c08e d88e d0bc  t....y|..1......
0000080: 0020 fba0 647c 3cff 7402 88c2 52bb 1704  . ..d|<.t...R...
0000090: 8027 0374 06be 887d e817 01be 057c b441  .'.t...}.....|.A
00000a0: bbaa 55cd 135a 5272 3d81 fb55 aa75 3783  ..U..ZRr=..U.u7.
00000b0: e101 7432 31c0 8944 0440 8844 ff89 4402  ..t21..D.@.D..D.
00000c0: c704 1000 668b 1e5c 7c66 895c 0866 8b1e  ....f..\|f.\.f..
00000d0: 607c 6689 5c0c c744 0600 70b4 42cd 1372  `|f.\..D..p.B..r
00000e0: 05bb 0070 eb76 b408 cd13 730d f6c2 800f  ...p.v....s.....
00000f0: 84d0 00be 937d e982 0066 0fb6 c688 64ff  .....}...f....d.
0000100: 4066 8944 040f b6d1 c1e2 0288 e888 f440  @f.D...........@
0000110: 8944 080f b6c2 c0e8 0266 8904 66a1 607c  .D.......f..f.`|
0000120: 6609 c075 4e66 a15c 7c66 31d2 66f7 3488  f..uNf.\|f1.f.4.
0000130: d131 d266 f774 043b 4408 7d37 fec1 88c5  .1.f.t.;D.}7....
0000140: 30c0 c1e8 0208 c188 d05a 88c6 bb00 708e  0........Z....p.
0000150: c331 dbb8 0102 cd13 721e 8cc3 601e b900  .1......r...`...
0000160: 018e db31 f6bf 0080 8ec6 fcf3 a51f 61ff  ...1..........a.
0000170: 265a 7cbe 8e7d eb03 be9d 7de8 3400 bea2  &Z|..}....}.4...
0000180: 7de8 2e00 cd18 ebfe 4752 5542 2000 4765  }.......GRUB .Ge
0000190: 6f6d 0048 6172 6420 4469 736b 0052 6561  om.Hard Disk.Rea
00001a0: 6400 2045 7272 6f72 0d0a 00bb 0100 b40e  d. Error........
00001b0: cd10 ac3c 0075 f4c3 9d7c 0200 0000 8020  ...<.u...|.....
00001c0: 2100 832a a00a 0008 0000 00f8 7f00 0000  !..*............
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.

I am able to boot the VM using the Xen 4.4 from a Ubuntu 14 system,
but the Xen I built under LFS (which was taken from commit cb70a26
as per my earlier posts about building on systems that may not have
a "python") gives me the "Unable to find partition containing kernel" error

Any clues?
Kevin

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xen-devel] pygrub gives "raise RuntimeError("Unable to find partition containing kernel")"
  2019-05-19  9:05 pygrub gives "raise RuntimeError("Unable to find partition containing kernel")" Kevin Buckley
  2019-05-19  9:05 ` [Xen-devel] " Kevin Buckley
@ 2019-06-15  9:37 ` Kevin Buckley
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Buckley @ 2019-06-15  9:37 UTC (permalink / raw)
  To: xen-devel

Bit more on this:

I created a different VBD-backed VM, containing an Ubuntu 14045 install,
on a CentOS 6.10 host, with Xen 4.10, and a 4.9.127 kernel, where the VM
boots up fine.

Back in my LinuxFromScratch environment I still see the bootloader lig
error message as before

Using <class 'grub.GrubConf.Grub2ConfigFile'> to parse /boot/grub/grub.cfg
Traceback (most recent call last):
  File "/usr/lib/xen/bin/pygrub", line 928, in <module>
    raise RuntimeError("Unable to find partition containing kernel")
RuntimeError: Unable to find partition containing kernel

Here's the partition table of the VBD

Model: Linux device-mapper (linear) (dm)
Disk /dev/dm-1: 8388608s
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number  Start     End       Size      Type      File system     Flags
        63s       2047s     1985s               Free Space
 1      2048s     3207167s  3205120s  primary   ext4
        3207168s  3209213s  2046s               Free Space
 2      3209214s  8386559s  5177346s  extended
 5      3209216s  3581951s  372736s   logical   linux-swap(v1)
        3581952s  3582494s  543s                Free Space
 6      3584000s  8386559s  4802560s  logical   ext4
        8386560s  8388607s  2048s               Free Space


I did though, think to try the folliwing

# /usr/lib/xen/bin/pygrub --debug --offset=1048576 --list-entries
/dev/vg_xen_vbds/lv_4g_02
Using <class 'grub.GrubConf.Grub2ConfigFile'> to parse /boot/grub/grub.cfg
Traceback (most recent call last):
  File "/usr/lib/xen/bin/pygrub", line 907, in <module>
    chosencfg = run_grub(file, entry, fs, incfg["args"])
  File "/usr/lib/xen/bin/pygrub", line 625, in run_grub
    g = Grub(file, fs)
  File "/usr/lib/xen/bin/pygrub", line 249, in __init__
    self.read_config(file, fs)
  File "/usr/lib/xen/bin/pygrub", line 460, in read_config
    self.cf.parse(buf)
  File "/usr/lib/python3.7/site-packages/grub/GrubConf.py", line 376, in parse
    lines = buf.split("\n")
TypeError: a bytes-like object is required, not 'str'
#

which suggests to me that Xen's pygrub is reading the grub.cfg from
within the VBD image but that last line isn't really telling me much.

Note that the Grub installation, from where
/usr/lib/python3.7/site-packages/grub/GrubConf.py"
come, is able to parse a similar grub.cfg when it boots up the LFS
instance hosting my Xen

Kevin

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-15  9:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-19  9:05 pygrub gives "raise RuntimeError("Unable to find partition containing kernel")" Kevin Buckley
2019-05-19  9:05 ` [Xen-devel] " Kevin Buckley
2019-06-15  9:37 ` Kevin Buckley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).