Bug 969709 - GRUB2 bootloader installation and the whole Fedora 19 installation fails if there is no MBR gap
GRUB2 bootloader installation and the whole Fedora 19 installation fails if t...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: grub2 (Show other bugs)
19
i686 All
unspecified Severity urgent
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-01 20:05 EDT by Rostislav Krasny
Modified: 2013-08-22 15:46 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-03 14:45:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Rostislav Krasny 2013-06-01 20:05:24 EDT
Description of problem:
I have a 74.5 GB /dev/sda hard disk with 1st NTFS partition that allocates a half of that disk space and starts from LBA 1 address. I tried to install Fedora 19-beta on the reminded disk space. I let the installer to allocate it automatically, i.e. 500 MB for /dev/sda2 mounted to /root and the rest for a swap and the / mount point. Fedora 19-beta installation didn't ask me what type of the bootloader I want to install and how to do that. After installing all packages and doing some post-install tasks it tried to install the GRUB2 bootloader and failed. The error details found on the installer GUI where uninformative. But on one of the pseudoterminals there was an error message from grub2-install, stating that there is no MBR gap and an alternative grub2 installation method won't be used because of some other reason (is it deprecated?).

I have a working operating system on the first partition of /dev/sda and I can neither recreate nor move it. I have no problem installing other GNU/Linux distributions and FreeBSD OS, with their bootloaders (including grub), on that disk. Why Fedora is so special? 

Version-Release number of selected component (if applicable):
Fedora 19-beta i386 netinst

How reproducible:
See below the steps to reproduce

Steps to Reproduce:
1. On an empty /dev/sda create first non-linux (for example primary NTFS) partition, starting from LBA 1 and ending somewhere on the middle of the disk.
2. Try to install Fedora 19 beta into the reminded disk space of the same physical disk. Let Fedora installation to allocate the reminded disk space automatically. For example 1.5GB for swap, 500 MB for /root and the rest for /.

Actual results:
Fedora installation fails in a Python script that installs the bootloader - grub2. On one of the pseudo-terminals an error message from grub2-install is printed. The error message says that there is no MBR gap and the alternative method is deprecated or something like that (sorry, I )

Expected results:
The bootloader type and how it will be installed need to be configurable in the Fedora installer before it starts the actual work.

Additional info:
http://www.gnu.org/software/grub/manual/grub.html#BIOS-installation
Comment 1 Rostislav Krasny 2013-06-01 21:04:16 EDT
According to Fedora 18 Installation Guide (see link below) the alternative grub2 installation method is no longer supported: "Beginning in Fedora 18, GRUB2 can no longer be installed to a partition".

http://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/s1-grub-installing.html

So both Fedora 18 and 19 are completely unusable on my machine.

Actually I don't need most of the GRUB2 functionality. I just need to choose booting from /dev/sda1 or from /dev/sda2. It's a simple task and, for example, a FreeBSD bootloader copes with it very well. It is installed into the MBR sector itself and neither MBR gap nor partition space is need.

http://www.freebsd.org/doc/en/books/handbook/boot-blocks.html

Can Fedora install something like that as an alternative bootloader?
Comment 2 Chris Murphy 2013-06-01 23:03:28 EDT
extlinux will do what you want. No recent partition tool on linux, OS X, or Microsoft, will partition a disk in the described manner. It's not advisable for current HDD's which have pretty much all moved to 4096 byte physical sectors, a partition that starts on LBA 1 won't be properly aligned and writes will take a  performance hit.
Comment 3 Rostislav Krasny 2013-06-02 23:05:33 EDT
(In reply to Chris Murphy from comment #2)
> extlinux will do what you want.

extlinux boots from a Linux partition and uses a configuration file in it.
This is not exactly what I want. I want a boot manager only in the MBR sector.
Similar to Boot Manager of FreeBSD (the boot0). I already gave the below link
about it:

http://www.freebsd.org/doc/en/books/handbook/boot-blocks.html

Anyway, does Fedora 19 installer support extlinux?

> No recent partition tool on linux, OS X, or Microsoft, will partition a
> disk in the described manner.

I had partitioned my disk using OpenBSD fdisk that is similar to GNU/Linux
fdisk. Both of them allow to define partition start and length parameters
with an LBA address precision.

> It's not advisable for current HDD's which have pretty much all moved to
> 4096 byte physical sectors, a partition that starts on LBA 1 won't be properly
> aligned and writes will take a  performance hit.

I have Hitachi HDS728080PLAT20 hard disk. According to its specifications
it has 512 bytes physical sectors. See section 4.1 in the below document:

http://www.hgst.com/tech/techlib.nsf/techdocs/0C810B96385B2DBA86256E40006FB9F1/$file/d7k80_sp1.6.pdf

So I don't need to care about the 4k alignment.

Partition tool in the Windows XP installer and in the Windows XP itself also
doesn't care about the 4k alignment. It creates first partition starting from
LBA 63 address, instead of LBA 64 or LBA 8. It does so for historical reasons:
(LBA 63 == C=0,H=1,S=1).

Using MBR gap is dangerous since this disk space isn't properly declared
as allocated. Other crafty software can overwrite it.
Comment 4 Chris Murphy 2013-06-03 00:46:56 EDT
(In reply to Rostislav Krasny from comment #3)
 
> extlinux boots from a Linux partition and uses a configuration file in it.

It starts in the MBR, defers to the MBR active flag to determine which partition to jump to and read more code from, which it does and reads code that tells it to jump yet again. The syslinux, isolinux, extlinux variants support other file systems than linux file systems.

> This is not exactly what I want. I want a boot manager only in the MBR
> sector.

The MBR boot strap region allows only 440 bytes of code, you're not going to fit a boot manager in there that understands a file system, which it needs to in order to load a kernel.

> Similar to Boot Manager of FreeBSD (the boot0). I already gave the below link
> about it:
> 
> http://www.freebsd.org/doc/en/books/handbook/boot-blocks.html

It's merely presenting you with an option of which partition to jump to next, like an on-the-fly MBR active flag. The code doesn't know how to read either Windows or FreeBSD file systems at this point. If you like boot0 then use that in the MBR, it'll just jump to and use whatever code is in the VBR it points to which could be LILO, GRUB, Windows, or sys/iso/ext linux.

> 
> Anyway, does Fedora 19 installer support extlinux?

I haven't looked for it in the installer but it's a feature:
http://fedoraproject.org/wiki/Features/SyslinuxOption




> 
> > No recent partition tool on linux, OS X, or Microsoft, will partition a
> > disk in the described manner.
> 
> I had partitioned my disk using OpenBSD fdisk that is similar to GNU/Linux
> fdisk. Both of them allow to define partition start and length parameters
> with an LBA address precision.

Yeah anymore I don't think fdisk lets you choose a value less than LBA 2048 for 512 byte logical sector disks, and parted doesn't do it by default. Even Windows for some time now uses 2048.


> Partition tool in the Windows XP installer and in the Windows XP itself also
> doesn't care about the 4k alignment. It creates first partition starting from
> LBA 63 address, instead of LBA 64 or LBA 8. It does so for historical
> reasons:
> (LBA 63 == C=0,H=1,S=1).

That's because XP is ancient and comes from the epoch of CHS which isn't how hard drives work today anyway.
 
> Using MBR gap is dangerous since this disk space isn't properly declared
> as allocated. Other crafty software can overwrite it.

Crafty software can overwrite anything it wants, declared or not. If the gap really bothers you, you can probably use GPT, and specify GRUB to be installed in a 1MB BIOS Boot partition of its own. Many BIOS firmware are OK with the use of GPT.
Comment 5 Rostislav Krasny 2013-06-03 07:16:46 EDT
(In reply to Chris Murphy from comment #4)
> (In reply to Rostislav Krasny from comment #3)
>  
> > extlinux boots from a Linux partition and uses a configuration file in it.
> 
> It starts in the MBR, defers to the MBR active flag to determine which
> partition to jump to and read more code from, which it does and reads code
> that tells it to jump yet again. The syslinux, isolinux, extlinux variants
> support other file systems than linux file systems.
> 

This is what an ordinary MBR code does. extlinux looks similar to ntldr of Windows. Both resides in the boot partition of the appropriate operating system,
both have a text configuration file and both are loaded by code in the first
sector(s) of the bootable system partition.

> > This is not exactly what I want. I want a boot manager only in the MBR
> > sector.
> 
> The MBR boot strap region allows only 440 bytes of code, you're not going to
> fit a boot manager in there that understands a file system, which it needs
> to in order to load a kernel.
> 

Boot manager doesn't need to understand any file system. Its only job is
loading a boot sector of the partition choosen by the user. This is how the
FreeBSD Boot Manager works.

> > Similar to Boot Manager of FreeBSD (the boot0). I already gave the below link
> > about it:
> > 
> > http://www.freebsd.org/doc/en/books/handbook/boot-blocks.html
> 
> It's merely presenting you with an option of which partition to jump to
> next, like an on-the-fly MBR active flag. The code doesn't know how to read
> either Windows or FreeBSD file systems at this point. If you like boot0 then
> use that in the MBR, it'll just jump to and use whatever code is in the VBR
> it points to which could be LILO, GRUB, Windows, or sys/iso/ext linux.
> 

Yes, this is what I want. Does Fedora support a boot manager like that? I mean
does it have it and can it install it from the Fedora installer? At least
manually from a shell console.

> > Anyway, does Fedora 19 installer support extlinux?
> 
> I haven't looked for it in the installer but it's a feature:
> http://fedoraproject.org/wiki/Features/SyslinuxOption
> 

If Fedora installer doesn't support it, it's a lost feature.

> > > No recent partition tool on linux, OS X, or Microsoft, will partition a
> > > disk in the described manner.
> > 
> > I had partitioned my disk using OpenBSD fdisk that is similar to GNU/Linux
> > fdisk. Both of them allow to define partition start and length parameters
> > with an LBA address precision.
> 
> Yeah anymore I don't think fdisk lets you choose a value less than LBA 2048
> for 512 byte logical sector disks, and parted doesn't do it by default. Even
> Windows for some time now uses 2048.

It would be a regression and I don't think fdisk was changed that way, though.

> > Partition tool in the Windows XP installer and in the Windows XP itself also
> > doesn't care about the 4k alignment. It creates first partition starting from
> > LBA 63 address, instead of LBA 64 or LBA 8. It does so for historical
> > reasons: (LBA 63 == C=0,H=1,S=1).
> 
> That's because XP is ancient and comes from the epoch of CHS which isn't how
> hard drives work today anyway.

But I'm fine with my current hardware and with Windows XP in it. I don't want
to buy a new computer with Windows 7, just because I want to try the
Fedora Linux distribution. With my hardware I don't need to care about the 4K
alignment and about the MBR gap. I expect from the Linux distribution to be
compatible and other Linux distributions are compatible with my disk
configuration.

> > Using MBR gap is dangerous since this disk space isn't properly declared
> > as allocated. Other crafty software can overwrite it.
> 
> Crafty software can overwrite anything it wants, declared or not.

That isn't crafty but buggy software.

> If the gap really bothers you, you can probably use GPT, and specify GRUB to
> be installed in a 1MB BIOS Boot partition of its own. Many BIOS firmware are
> OK with the use of GPT.

My BIOS isn't UEFI and it knows nothing about GPT. Anyway GPT makes sense only
with disks bigger than 2TB. This was the main reason of the GPT invention.
Comment 6 Rostislav Krasny 2013-06-03 09:55:19 EDT
(In reply to Chris Murphy from comment #2)
> It's not advisable for current HDD's which have pretty much all moved to
> 4096 byte physical sectors

I want to comment it again because it's just not true. There are many current
modern hard disks with 512 bytes physical sectors. For example read following
data sheet of Hitachi Ultrastar™ 7K4000 disks:

http://www.hgst.com/tech/techlib.nsf/techdocs/FD3F376DC2ECCE68882579D40082C393/$file/US7K4000_ds.pdf

There are two groups of hard disks with SATA interface: one with 512e
(512 emulated) sector size and the other with 512n (512 native) sector size.
Comment 7 Chris Murphy 2013-06-03 11:27:42 EDT
(In reply to Rostislav Krasny from comment #5)

> Boot manager doesn't need to understand any file system. Its only job is
> loading a boot sector of the partition choosen by the user. This is how the
> FreeBSD Boot Manager works.

The available managers on linux have capabilities that make them too big to fit in the 2 boot sectors on ext. If you like the FreeBSD Boot Manager nothing stops you from using it.

> If Fedora installer doesn't support it, it's a lost feature.

The feature page I cited says extlinux will be supported as a hidden option.

> It would be a regression and I don't think fdisk was changed that way,
> though.

fdisk on linux, part of util-linux, definitely doesn't let you specify a start LBA less than 2048 on 512 byte disks.

 
> But I'm fine with my current hardware and with Windows XP in it. I don't want
> to buy a new computer with Windows 7, just because I want to try the
> Fedora Linux distribution. With my hardware I don't need to care about the 4K
> alignment and about the MBR gap. I expect from the Linux distribution to be
> compatible and other Linux distributions are compatible with my disk
> configuration.

Some other linux distributions install grub to an ext formatted partition using the --force flag, in order to use block lists. The Fedora installer isn't doing that anymore since Fedora 18.

> My BIOS isn't UEFI and it knows nothing about GPT. Anyway GPT makes sense
> only with disks bigger than 2TB. This was the main reason of the GPT invention.

As I said many BIOS (non-UEFI) computers will work fine with GPT, but sadly Windows will not, when booted from BIOS hardware it insists on MBR. So you're stuck with making MBR work.
Comment 8 Rostislav Krasny 2013-06-03 13:01:25 EDT
(In reply to Chris Murphy from comment #7)
> The available managers on linux have capabilities that make them too big to
> fit in the 2 boot sectors on ext.

Then they should use the file system. After all something loads the kernel
that is a file on the file system. extlinux and ntldr work that way.

> If you like the FreeBSD Boot Manager nothing stops you from using it.

Is it part of Fedora installation? That's what stops me.

> > If Fedora installer doesn't support it, it's a lost feature.
> 
> The feature page I cited says extlinux will be supported as a hidden option.

What does it mean a hidden option? How to use it?

> > It would be a regression and I don't think fdisk was changed that way,
> > though.
> 
> fdisk on linux, part of util-linux, definitely doesn't let you specify a
> start LBA less than 2048 on 512 byte disks.

In my opinion there is a regression. Instead of warning and/or using a default
value someone had decided just restrict a user. But this is another story, not
related to this bug.

> > But I'm fine with my current hardware and with Windows XP in it. I don't want
> > to buy a new computer with Windows 7, just because I want to try the
> > Fedora Linux distribution. With my hardware I don't need to care about the 4K
> > alignment and about the MBR gap. I expect from the Linux distribution to be
> > compatible and other Linux distributions are compatible with my disk
> > configuration.
> 
> Some other linux distributions install grub to an ext formatted partition
> using the --force flag, in order to use block lists. The Fedora installer
> isn't doing that anymore since Fedora 18.

What was the reason of that decision?

> > My BIOS isn't UEFI and it knows nothing about GPT. Anyway GPT makes sense
> > only with disks bigger than 2TB. This was the main reason of the GPT invention.
> 
> As I said many BIOS (non-UEFI) computers will work fine with GPT, but sadly
> Windows will not, when booted from BIOS hardware it insists on MBR. So
> you're stuck with making MBR work.

And MBR works just fine, if nobody tries to use dirty tricks with MBR gap.
Comment 9 Chris Murphy 2013-06-03 13:24:56 EDT
(In reply to Rostislav Krasny from comment #8)
> Then they should use the file system. After all something loads the kernel
> that is a file on the file system. extlinux and ntldr work that way.

grub works that way also, it just uses the mbr gap which you have an aversion to. grub also has the option, like extlinux and ntldr work by design, to have a specific location they go in and chainload.


> > If you like the FreeBSD Boot Manager nothing stops you from using it.
> 
> Is it part of Fedora installation? That's what stops me.

Earlier you said "At least manually from a shell console" earlier, yet now you want the Fedora installer to install 440 bytes to LBA 0 for you. I don't understand why you can't do this yourself if you like that boot manager.

> What does it mean a hidden option? How to use it?

You pass the extlinux kernel parameter when booting install media.

> > fdisk on linux, part of util-linux, definitely doesn't let you specify a
> > start LBA less than 2048 on 512 byte disks.
> 
> In my opinion there is a regression. Instead of warning and/or using a
> default
> value someone had decided just restrict a user. But this is another story,
> not
> related to this bug.

This bug report isn't describing an actutal bug, so arguably the whole conversation needs to be moved to a user forum. On linux the expectation is to have a 1MB MBR gap for GRUB, or BIOS Boot partition on GPT disks. If you want some other arrangement you're in search of special grub options to force it to install elsewhere, or use another boot loader.


> > Some other linux distributions install grub to an ext formatted partition
> > using the --force flag, in order to use block lists. The Fedora installer
> > isn't doing that anymore since Fedora 18.
> 
> What was the reason of that decision?

GRUB maintainers don't recommend block lists on ext, the GRUB list has several discussions on why.
Comment 10 Brian Lane 2013-06-03 14:45:12 EDT
Chris has explained things. This isn't going to change, and isn't the place to continue arguing about it.
Comment 11 Rostislav Krasny 2013-06-03 16:26:33 EDT
(In reply to Chris Murphy from comment #9)
> (In reply to Rostislav Krasny from comment #8)
> > Then they should use the file system. After all something loads the kernel
> > that is a file on the file system. extlinux and ntldr work that way.
> 
> grub works that way also, it just uses the mbr gap which you have an
> aversion to. grub also has the option, like extlinux and ntldr work by
> design, to have a specific location they go in and chainload.

If it loads some file there should be no need to use MBR gap. All boot loader
code should be in that file.

> > > If you like the FreeBSD Boot Manager nothing stops you from using it.
> > 
> > Is it part of Fedora installation? That's what stops me.
> 
> Earlier you said "At least manually from a shell console" earlier, yet now
> you want the Fedora installer to install 440 bytes to LBA 0 for you. I don't
> understand why you can't do this yourself if you like that boot manager.

You misunderstood me. I meant - could I install the FreeBSD Boot Manager, at
least manually from a shell, during the Fedora installation? There is a shell
console in the second pseudoterminal, when Fedora installer works.

I've looked for boot0 RPM on http://rpm.pbone.net/ and found one from ALTLinux.
Could such RPM be added into the Fedora RPM collection too?

> > What does it mean a hidden option? How to use it?
> 
> You pass the extlinux kernel parameter when booting install media.

But there is no convenient way to install it instead of grub2, isn't it?

> > > fdisk on linux, part of util-linux, definitely doesn't let you specify a
> > > start LBA less than 2048 on 512 byte disks.
> > 
> > In my opinion there is a regression. Instead of warning and/or using a
> > default value someone had decided just restrict a user. But this is
> > another story, not related to this bug.
> 
> This bug report isn't describing an actutal bug,

The Fedora 19 beta installation fails but other Linux distributions and other
UNIX-like OSes (FreeBSD and OpenBSD) could be installed on the same system.
If it is not a bug, then what is a bug?

> so arguably the whole conversation needs to be moved to a user forum.

I agree. Could you point me to that forum?
Comment 12 Chris Murphy 2013-06-03 16:46:53 EDT
(In reply to Rostislav Krasny from comment #11)
> 
> If it loads some file there should be no need to use MBR gap. All boot loader
> code should be in that file.

That's one opinion, but it's not how GRUB works on BIOS. BIOS doesn't know what a file is, it just blindly executes the code in the MBR. That's it. And there isn't enough code there to understand a file system to load all of grub, which is why the minimum amount of grub code goes in the MBR gap. If you don't like that philosophy, then don't use grub. On UEFI, the firmware understands FAT already, so it can locate and load arbitrary files, but it doesn't work that way on BIOS.

> You misunderstood me. I meant - could I install the FreeBSD Boot Manager, at
> least manually from a shell, during the Fedora installation?

Yes, use dd.

> Could such RPM be added into the Fedora RPM collection too?

No idea.

> > You pass the extlinux kernel parameter when booting install media.
> 
> But there is no convenient way to install it instead of grub2, isn't it?

Passing extlinux kernel parameter when booting install media installs extlinux instead of grub2. I don't know what you mean be convenient way.

> The Fedora 19 beta installation fails but other Linux distributions and other
> UNIX-like OSes (FreeBSD and OpenBSD) could be installed on the same system.
> If it is not a bug, then what is a bug?

Seems like a bug to you, but works as designed for those who designed it. Although if the installer doesn't warn in advance of installation, I'd call it a kind of bug. The installer should qualify the target for ability to accept the boot loader before modifying the disk (by installing).

>Could you point me to that forum?

http://www.forums.fedoraforum.org/
https://admin.fedoraproject.org/mailman/listinfo/users
Comment 13 Rostislav Krasny 2013-06-03 18:20:13 EDT
(In reply to Chris Murphy from comment #12)
> (In reply to Rostislav Krasny from comment #11)
> > You misunderstood me. I meant - could I install the FreeBSD Boot Manager, at
> > least manually from a shell, during the Fedora installation?
> 
> Yes, use dd.

I already thought to continue this discussion in a forum but this answer
is a complete joke. To use dd I need a file with the FreeBSD Boot Manager
and Fedora doesn't have it. What a surprise!

> > I've looked for boot0 RPM on http://rpm.pbone.net/ and found one from ALTLinux.
> > Could such RPM be added into the Fedora RPM collection too?
> 
> No idea.

And no willing to help. I will consider using other Linux distribution.
Fedora doesn't boot anyway and nobody cares.

> >Could you point me to that forum?
> 
> http://www.forums.fedoraforum.org/
> https://admin.fedoraproject.org/mailman/listinfo/users

Thanks
Comment 14 Russ Anderson 2013-06-25 21:57:55 EDT
Rostislav, you raise many valid points.  I have has similar results with FC19 trying to dual boot.  And I don't know what a hidden Anaconda option is, either.

Chris, if your goal is to discourage people from using Fedora 19, you are doing a good job of it.
Comment 15 Steve Tyler 2013-06-26 04:23:59 EDT
I attempted to reproduce this in a VM and got Bug 969684:
Bug 969684, Comment 38
Bug 969684, Comment 39

Rostislav: Did you get a dialog saying "An unknown error has occurred" with a "Report Bug" button?
Comment 16 Steve Tyler 2013-06-26 06:57:13 EDT
You may be able to get a bootable system by installing grub2 from rescue mode:
1. Boot the installer disc in rescue mode.
2. chroot /mnt/sysimage
3. grub2-install --force /dev/sda2 # device with /boot partition
4. grub2-mkconfig -o /boot/grub2/grub.cfg

I also had to reset the root password in rescue mode, so the install failure may have preempted some additional configuration. Tested in a VM with a minimal install from Fedora-19-x86_64-netinst.iso (RC2).

The bug here, IMO, is that the installer failed to detect insufficient disk space to install grub2 *before* installation, and it failed to provide an informative error message. Those are sufficient reasons to reopen this bug.

Command-line:
$ qemu-kvm -m 4096 -hda f19-test-1.img -cdrom ~/xfr/fedora/F19/F19-Final/RC2/Fedora-19-x86_64-netinst.iso -vga std -boot menu=on
Comment 17 Steve Tyler 2013-06-27 15:21:19 EDT
(In reply to Rostislav Krasny from comment #0)
> Description of problem:
> I have a 74.5 GB /dev/sda hard disk with 1st NTFS partition that allocates a
> half of that disk space and starts from LBA 1 address.
...

(Comment 3)
...
> I had partitioned my disk using OpenBSD fdisk that is similar to GNU/Linux
fdisk.
...
> Partition tool in the Windows XP installer and in the Windows XP itself also
doesn't care about the 4k alignment.
...

Rostislav, I am confused about what you actually did to get your disk configuration.

Did you use "OpenBSD fdisk" to create the NTFS partition and then install Windows XP to that?
Or did you use the Windows XP installer to create the NTFS partition?

What is your use-case for an NTFS partition starting at "LBA 1 address"?
Comment 18 Rostislav Krasny 2013-06-30 06:29:40 EDT
(In reply to Steve Tyler from comment #17)
> Rostislav, I am confused about what you actually did to get your disk
> configuration.
> 
> Did you use "OpenBSD fdisk" to create the NTFS partition and then install
> Windows XP to that?

Yes, I did it that way. You may also use any other partition software that allows creating a primary partition that starts at LBA 1.
Comment 19 Rostislav Krasny 2013-06-30 07:26:25 EDT
(In reply to Steve Tyler from comment #15)
> I attempted to reproduce this in a VM and got Bug 969684:
> Bug 969684, Comment 38
> Bug 969684, Comment 39
> 
> Rostislav: Did you get a dialog saying "An unknown error has occurred" with
> a "Report Bug" button?

Yes, that's what I got on the installer GUI. I've reproduced this issue again and looked at the details. The exception was thrown in /usr/lib/python2.7/site-packages/pyanaconda/bootloader.py at line 1540.
Comment 20 Steve Tyler 2013-06-30 23:35:31 EDT
Thanks, Rostislav. That exception is fairly generic, so the log file has to be examined to see the error messages. The log file is in /tmp/anaconda* before rebooting. Attachment 765441 [details] (Bug 969684) has grub2-bios-setup error messages that appear to be what you were describing in Comment 0.

The Fedora installer allocates 2048 sectors before the first partition.[1] The grub2 documentation says: "You must ensure that the first partition starts at least 31 KiB (63 sectors) from the start of the disk ...".[2] The installer should be checking for that, but it appears that it does not.

# parted /dev/sda u s p free
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 25165824s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start     End        Size       Type     File system  Flags
        63s       2047s      1985s               Free Space
 1      2048s     1026047s   1024000s   primary  ext4         boot
 2      1026048s  25165823s  24139776s  primary               lvm

[1] Tested in a VM with a default minimal install using:
$ qemu-img create f19-test-1.img 12G
$ qemu-kvm -m 4096 -hda f19-test-1.img -cdrom ~/xfr/fedora/F19/F19-Final/RC3/Fedora-19-x86_64-DVD.iso -vga std -boot menu=on

[2] http://www.gnu.org/software/grub/manual/grub.html#BIOS-installation
Comment 21 Steve Tyler 2013-07-02 02:19:31 EDT
(In reply to Steve Tyler from comment #20)
> ... The installer should be checking for that ...

That may be easier said than done. The grub2 code that checks for an adequate "post-MBR gap" does numerous other checks too.

See pc_partition_map_embed() here:
http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/grub-core/partmap/msdos.c

Grub2 source:
ftp://ftp.gnu.org/gnu/grub/
Comment 22 george_darren 2013-07-06 18:11:18 EDT
I currently have a working Fedora 17 system dual booting with Windows XP. If I remember correctly I initially partitioned using gparted from the Fedora live CD which aligned the Windows (ntfs) partition with the 4096 byte boundary. I then installed Windows XP on the first partition which worked until the point when it reboots to complete installation. Then it refused to boot. I worked out that Windows XP needs to have the partition starting on the 63rd sector, at least to be able to complete installation using the standard CD. So I removed the partitions and let the Windows XP install CD create the Windows partition. This works fine but means the Windows partition starts at the 63rd sector. Yes I know this means a performance hit (on Windows) but at least it works. I then created the other (Fedora) partitions using parted (aligned to the 4096 boundaries) and installed Fedora 17 on these with GRUB 2 installed to the MBR and also the /boot partition. (I used to use the Windows XP bootloader installed to the MBR to boot Windows and then chainboot GRUB by installing GRUB to the /boot partition only and then "dd if=/dev/sda5 (/boot partition) of=/mnt/windows/linux.bsc bs=512 count=1" along with modifying the boot.ini in Windows file to point to this file. Very disappointed you can't do this with GRUB 2 that I know of!)

I do not have a more recent copy of Windows that I can install and even if I did I wouldn't want to since with only 2GB of memory and Windows mainly being used to play games I like the fact that Windows XP uses less memory than more recent versions and wouldn't be able to play my games as well otherwise.

My partition layout looks like this:

 1      63s          246751231s   246751169s   primary   ntfs         boot
 3      246751232s   3907028991s  3660277760s  extended
 5      246755328s   247279615s   524288s      logical   ext4
 6      247281664s   255670271s   8388608s     logical
 7      255672320s   3697932287s  3442259968s  logical
 8      3697934336s  3861774335s  163840000s   logical
 9      3861776384s  3890448383s  28672000s    logical
10      3890450432s  3907028991s  16578560s    logical

Partition 1 is Windows ntfs
Partition 5 is /boot ext4
Partitions 6-10 are encrypted swap, /, /home, /var and /tmp partitions

Is attempting to install Fedora 19 going to fail and/or hose my current partitions and if so is there any way round this?

I realise there are many reasons for the way things are done that I do not understand and that a lot of people do huge amounts of work on Fedora without any monetary compensation although I am sure they are compensated in other ways such as by being part of a community that creates great software.

Nevertheless it looks to me as if it is not possible to dual boot Windows XP with Fedora 19 and if that is not a huge bug then I really don't know what is. Maybe I am misunderstanding something and I would be very grateful for any correction or workaround, but a huge part of people new to Fedora will be running that ancient system Windows XP and may like myself have very good reasons for doing so and be unable to change.

Thank you.
Comment 23 george_darren 2013-07-06 18:34:51 EDT
further to my last note, it strikes me that the problem might not just be that all Windows XP users who try to install Fedora 19 will not be able to but that they might end up with an unusable/unbootable system with all their data lost unless they are very I.T. literate or have a deep pocket book to pay someone who is. Surely not?
Comment 24 Steve Tyler 2013-07-07 00:46:31 EDT
(In reply to george_darren from comment #22)
...
> My partition layout looks like this:
> 
>  1      63s          246751231s   246751169s   primary   ntfs         boot
...

Bugzilla isn't a general support forum[1], but as far as this bug is concerned, you are fine. You have enough room to install grub2.

grub2 boots Windows XP fine. The installer will configure a grub2 menu that includes a Windows XP entry.

Before installing, I would suggest:
1. Backing up everything you care about.
2. Reading the F19 Release Notes and the F19 Common Bugs:
   http://docs.fedoraproject.org/en-US/Fedora/19/html/Release_Notes/sect-Release_Notes-Welcome_to_Fedora_.html
   https://fedoraproject.org/wiki/Common_F19_bugs
3. Looking over the F19 installation guides:
   http://docs.fedoraproject.org/en-US/Fedora/19/html/Installation_Quick_Start_Guide/index.html
   http://docs.fedoraproject.org/en-US/Fedora/19/html/Installation_Guide/index.html

The F19 installer looks very different from the F17 installer, so doing a test install to a spare partition or to a different disk drive might be a good idea.

BTW, you can use "fedup" to upgrade, if you don't want to reinstall:
http://docs.fedoraproject.org/en-US/Fedora/19/html/Installation_Guide/ch18s02.html

[1] FedoraForum.org is the Support forum for Fedora Linux:
    http://fedoraforum.org/
Comment 25 Steve Tyler 2013-08-22 15:46:01 EDT
This bug would be more usefully closed as a duplicate of:
Bug 986431 - Anaconda fails to install bootloader if legacy MBR has only 36 sectors before 1st partition

Note You need to log in before you can comment on or make changes to this bug.