Bug 450728

Summary: dies if a swap partition is marked bootable
Product: [Fedora] Fedora Reporter: Bill Nottingham <notting>
Component: xennerAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: berrange, rvokal, xen-maint
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-23 16:19:08 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Bill Nottingham 2008-06-10 14:39:45 EDT
Description of problem:

As swap partitions use the same ID as old Solaris partitions.

Version-Release number of selected component (if applicable):

Comment 1 Gerd Hoffmann 2008-06-12 15:14:31 EDT
Can you provide a log? (/var/log/libvirt/qemu/<name>.log when using libvirt,
stderr otherwise).  Probably it is pygrub failing to find a kernel on the guest
Comment 2 Bill Nottingham 2008-06-12 15:41:31 EDT
[root@nostromo images]# pygrub -i /var/lib/libvirt/images/test.img 
Traceback (most recent call last):
  File "/usr/bin/pygrub", line 648, in <module>
    fs = fsimage.open(file, get_fs_offset(file))
  File "/usr/bin/pygrub", line 117, in get_fs_offset
    offset += get_solaris_slice(file, offset)
  File "/usr/bin/pygrub", line 80, in get_solaris_slice
    raise RuntimeError, "Invalid disklabel magic"
RuntimeError: Invalid disklabel magic
Comment 3 Gerd Hoffmann 2008-06-23 03:20:11 EDT
Ok, so it actually is pygrub failing.  It isn't xenner specific, trying with xen
itself will fail the very same way.

It also isn't very surprising because pygrub uses the bootable flag to figure
the partition it should get the kernel from.  IMHO that isn't a bug.  Why is the
boot flag set on the swap partition in the first place?
Comment 4 Bill Nottingham 2008-06-23 11:20:10 EDT
Left over from playing with a usb stick, IIRC.

Why is it not a bug? Shouldn't it just ignore the partition and continue?
Comment 5 Gerd Hoffmann 2008-06-23 12:04:24 EDT
Ignoring the partition would break booting solaris guests.
Just fix the active flag.
Comment 6 Bill Nottingham 2008-06-23 12:10:14 EDT
How would it break booting a solaris guest if you just logged the disklabel
error and continued? If they don't have a valid solaris boot, it would still
then fail.
Comment 7 Gerd Hoffmann 2008-06-23 16:19:08 EDT
Ignoring the swap partition (by id) would break solaris guests, this is what I
assumed you meant.

Well, continue with what?  pygrub doesn't scan all partitions, trying to guess
which one is the boot partition.  It expects the boot flag being set on the boot
partition and looks only at that one.
Comment 8 Bill Nottingham 2008-06-23 16:22:36 EDT
Hm, OK. However, you can have multiple partitions with the boot flag, so I
wonder if that's enough.