bugGNU GRUB - Bugs: bug #37454, grub2 will not install to an ext2...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #37454: grub2 will not install to an ext2 ext3 ext4 partition

Submitter:  Chris Murphy <chrismurphy>
Submitted:  Thu 27 Sep 2012 09:35:14 PM UTC
   
 
Category:  Installation Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Invalid Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release:  other
Release:  Reproducibility:  Every Time
Planned Release:  None

Jump to the original submission

Fri 28 Sep 2012 06:08:36 PM UTC, comment #6: 

F18 alpha, all new installation. Single clean disk, four partitions, 3x ext4, 1x swap.
grub2-2.00-5.fc18.x86_64

1.
grub2-install /dev/sda
Installation finished. No error reported.

2.
grub2-install --force /dev/sda1
/usr/sbin/grub2-bios-setup: warning: File system `ext2' doesn't support embedding.
/usr/sbin/grub2-bios-setup: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..

There is code now in the first sector of /dev/sda1 unlike previous attempts. So it seems --force is resulting in successful block listing on ext4 so long as it's not a cross-disk install. So it would seem this is a false alarm and NOTABUG.

Additional information:
Fedora 18 installer devs intend to have a hidden (was previously exposed) feature to use --force to install GRUB with block lists, for those users who wish to install Fedora but preserve their legacy boot loader in LBA0 and in the MBR gap. Is there a preferred alternative?

Chris Murphy <chrismurphy>
Fri 28 Sep 2012 05:31:21 PM UTC, comment #5: 

The parameter to grub(2)-install is only where boot sector goes. If you want the files to go there as well, you need to specify --boot-directory. The cross-disk install with blocklists never worked due to BIOS disk number incertainety. But the message you get is weird. Can you recreate it with bzr and give step by step script for recreating (e.g. create image, fdisk, kpartx, mkfs, grub2-install)

Vladimir Serbinenko <phcoder>
Group administrator
Fri 28 Sep 2012 05:16:27 PM UTC, comment #4: 

/boot is btrfs, but I'm not installing to /boot, nor am I installing to that disk. It's a cross-disk installation to a totally different disk, to an ext4 formatted partition. In the past it has been possible to do this, typically using --force to use blocklists, but this is no longer working.

With regression (grub2-2.0-0.38.beta6.fc17.x86_64), even if I boot from a system with no btrfs, only ext4, and do the same thing, I get the same warning: File system `ext2' doesn't support embedding. If I use ---force, again the same error, and block lists are not generated.

If I eliminate cross-disk installation:
grub2-install /dev/sda
Installation finished. No error reported.

grub2-install /dev/sda1
/usr/sbin/grub2-bios-setup: error: unable to identify a filesystem in hd0; safety check can't be performed.

grub2-install --force /dev/sda1
/usr/sbin/grub2-bios-setup: error: unable to identify a filesystem in hd0; safety check can't be performed.

I can try these regressions with grub2-2.00-5.fc18.x86_64  if useful. But ultimately the question is whether it's expected that grub2-install --force /dev/sda1 (i.e. to a partition, not changing LBA0 or LBA1 legacy bootloader) to use block lists, on ext4, is supposed to be possible. Presently it appears not to be.

Chris Murphy <chrismurphy>
Fri 28 Sep 2012 04:41:56 PM UTC, comment #3: 

Is /boot on btrfs? This is a very bad idea unless you have an embedding zone since btrfs blocklist can't work well due to COW.

Vladimir Serbinenko <phcoder>
Group administrator
Fri 28 Sep 2012 04:14:00 PM UTC, comment #2: 

There is no btrfs on sdb, only ext4 on sdb1. There is btrfs on sda2. Different disk.

Chris Murphy <chrismurphy>
Fri 28 Sep 2012 03:54:55 PM UTC, comment #1: 

You have a valid btrfs on this disk in the same time as ext4. Is it intentional? If it is please explain why. If not I mke2fs must be modified to clean out first 1M of disk.
In unexpected situation like yours GRUB refuses to install on purpose to avoid possible filesystem damage.

Vladimir Serbinenko <phcoder>
Group administrator
Thu 27 Sep 2012 09:35:14 PM UTC, original submission:  

Description of problem:
grub2-install /dev/sdb1, with or without --force, fails to install to ext[234] formatted partitions.

Version-Release number of selected component (if applicable):
grub2-2.00-5.fc18.x86_64

How reproducible:
100% for ext4, i.e. /boot on its own partition formatted as ext4


Steps to Reproduce:
1. new blank disk
2. gpt or mbr partitioned, 1GB
3. mkfs.ext4 /dev/sdb1
4. Either
grub2-install /dev/sdb1
grub2-install --force /dev/sdb1

 
Actual results:
/usr/sbin/grub2-bios-setup: warning: File system `ext2' doesn't support embedding.
/usr/sbin/grub2-bios-setup: error: filesystem `btrfs' doesn't support blocklists.

To test if there were file system changes, before grub2-install:
hexdump -C /dev/sdb1 > beforegrubinstall.bin
After grub2-install:
hexdump -C /dev/sdb1 > aftergrubinstall.bin
After grub2-install --force:
hexdump -C /dev/sdb1 > aftergrubforceinstall.bin

diff says these files are identical.

Expected results:
Unsure. History says it's possible to install grub this way but perhaps we're supposed to place core.img on /dev/sdb1 and then chainload or multiboot it? Documentation could be more clear on alternatives if installing to a partition is not recommended; the idea is how to avoid stepping on a legacy bootloader the user may want to retain, in multi-boot scenarios.

Additional info:
Attaching --debug file from grub2-install failure.

On irc.freenode.net #grub Jordan_U suggested: "grub-install shouldn't fail just because we don't have an embedding area (even if we think users should, and can, avoid this)."

Original bug filed against Fedora 18:
https://bugzilla.redhat.com/show_bug.cgi?id=861192

Chris Murphy <chrismurphy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by chrismurphy (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-19 phcoder StatusNone Invalid
        Open/ClosedOpen Closed
    2012-09-27 chrismurphy Attached File- Added grubinstall_debugoutput.txt, #26663

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code