Bug 739411

Summary: "partition not bootable" error message when using livecd-iso-to-disk
Product: [Fedora] Fedora Reporter: Mr-4 <mr.dash.four>
Component: livecd-toolsAssignee: Brian Lane <bcl>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: adam.stokes, bcl, bruno, dhuff, Jasper.Hartline, katzj
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-19 20:17:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mr-4 2011-09-18 20:40:34 UTC
Description of problem:
When executing livecd-iso-to-disk script I get the above message even though the partition in question *is* bootable.

Version-Release number of selected component (if applicable):
the latest livecd-tools package from rawhide

How reproducible:
always

Steps to Reproduce:
1. Make sure the partition in question does not end on cylinder boundary - check with fdisk -l and make sure you see something like the following:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         131     1049583   83  Linux
Partition 1 does not end on cylinder boundary.
[...]

2. run livecd-iso-to-disk <iso_file> /dev/sda1

3. The above error message appears and the script refuses to install the image even though the partition *is* bootable.
  
Actual results:
The above error message after which the script refuses to install the specified image even though the partition in question *is* bootable

Expected results:
installation to proceed as normal as the partition in question is bootable

Additional info:
The above error is caused by the following line of the livecd-iso-to-disk script:

fdisk -l /dev/sda | grep /dev/sda1 | awk {'print $2;'}

This, according to the script, is checked against "*" and if anything else is returned, then the function bails out and returns an error, which is wrong! 

In the above scenario the fdisk/grep/awk statement returns "*\n4667", thus messing up the entire installation process. The above statement needs to be altered to reflect this and not return an error.

A quick work-around is just to disable (comment out) the entire function in this script and proceed as normal.

Comment 1 Brian Lane 2011-09-19 16:02:24 UTC
What version of fdisk are you using? Do you have any idea why you are getting "*\n4667" in your case? There shouldn't be a \n after the * and your example output above looks normal.

Comment 2 Mr-4 2011-09-19 16:29:56 UTC
(In reply to comment #1)
> What version of fdisk are you using?
Does it really matter? I've included the "raw" output from "fdisk -l" in my initial report, which is:

---8<---------------
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         131     1049583   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2             <...the rest of my partition table...>
------>8------------

> Do you have any idea why you are getting "*\n4667" in your case?
No idea, but whatever the reason it clearly fools the livecd script to the point that it exits with an error. 

As for the "\n" bit - this is so to indicate that when I execute the following statement (from bash):

fdisk -l /dev/sda | grep /dev/sda1 | awk {'print $2;'}

which is the test condition used in the livecd script to check whether my partition is bootable or not, I get this (in 2 lines of output):

*
4667

and because the above output is included in the "if ... != "*" statement as part of the livecd script, this isn't satisfied simply because "*" is clearly different from "*\n4667" and then obviously the function returns the wrong result even though the partition is bootable.

> There shouldn't be a \n after the * and your example
> output above looks normal.
Well, I've seen it with my own eyes, so it is clearly possible. As I already pointed out, when I comment out the offending "if" statement everything is fine, so the problem seems to be with the above "if" statement condition in the livecd script.

Comment 3 Mr-4 2011-09-19 16:37:38 UTC
Small, but important addition to the above answer:


I've just looked again in my fdisk -l output and I also have /dev/sda10 partition, which seems to trigger the extra output from the above if condition!

What I also have in my partition table is this:

---8<---------------
/dev/sda10           4667        4774      867478+  83  Linux
------>8------------

So, clearly the if test condition is wrong because when I select /dev/sda1 "fdisk -l /dev/sda | grep /dev/sda1 | awk {'print $2;'}" returns TWO results - for partition "/dev/sda1" as well as "/dev/sda10". 

That needs to be corrected!

Comment 4 Brian Lane 2011-09-19 19:17:15 UTC
Yep. sda1 will also match sda10, 11, etc.