Bug 524407 - grub misconfigured with encrypted / and unencrypted /boot on different devices
Summary: grub misconfigured with encrypted / and unencrypted /boot on different devices
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-19 21:36 UTC by Elijah Newren
Modified: 2009-11-30 10:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-30 10:56:42 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Elijah Newren 2009-09-19 21:36:07 UTC
Description of problem:
After installing Fedora 11 from a live CD and rebooting, I'm greeted with an unfriendly non-graphical "grub> " prompt.

Version-Release number of selected component (if applicable):
anaconda-11.5.0.59-1.fc11.x86_64


How reproducible:
Exact same thing happened when I installed fedora 10 (sorry for being to lazy to report the bug at the time), so I assume this is 100% reproducible.

Steps to Reproduce:
1. Boot Fedora-11 live CD, select "Install to Hard Drive"
2. Make /dev/sda1 (laptop harddrive) an encrypted filesystem, and mount it on /
3. Make /dev/sdb1 (usb key) an unencrypted filesystem, and mount it on /boot
4. Allow anaconda to install grub on /dev/sdb (DON'T change any of the default options or you'll be hit by bug 524399)
5. Reboot
  
Actual results:
Get an unfriendly "grub> " prompt.

Expected results:
Machine boots into Fedora

Additional info (How to work around this problem):
The generated /boot/grub/grub.conf file is

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd1,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/luks-77dd5030-6e73-4392-bcb1-d85017dcb5cb
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=0
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.29.4-167.fc11.x86_64)
        root (hd1,0)
        kernel /vmlinuz-2.6.29.4-167.fc11.x86_64 ro root=/dev/mapper/luks-77dd5030-6e73-4392-bcb1-d85017dcb5cb rhgb quiet
        initrd /initrd-2.6.29.4-167.fc11.x86_64.img

I fixed by modifying this file to (the NOTICE seems to be wrong):

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd1,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/luks-77dd5030-6e73-4392-bcb1-d85017dcb5cb
#          initrd /initrd-version.img
#boot=/dev/sdb1
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora 11 (2.6.29.4-167.fc11.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.29.4-167.fc11.x86_64 ro root=/dev/mapper/luks-77dd5030-6e73-4392-bcb1-d85017dcb5cb rhgb quiet
        initrd /initrd-2.6.29.4-167.fc11.x86_64.img

and then running (on a different system with the usb key inserted): 

# grub
(snip)
grub> find /grub/stage1
find /grub/stage1
 (hd0,0)
 (hd1,0)
grub> find /grub/grub.conf.orig  # Differentiate between hard drive & usb key
find /grub/grub.conf.orig
 (hd1,0)
grub> root (hd1,0)
root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd1)
setup (hd1)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd1)"...  28 sectors are embedded.
succeeded
 Running "install /grub/stage1 (hd1) (hd1)1+28 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub> quit


After making these changes, I was able to reboot into the Fedora-11 kernel.  Unfortunately, there was a mounting problem, but that's a separate bug...

Comment 1 Hans de Goede 2009-11-30 10:56:42 UTC
It seems that you did not correctly set the BIOS drive order. If you decide to
retry this be sure to select sdb as the drive the system will boot from in the screen where you can select which drives to use for auto partitioning and choose between different auto partition options and custom partitioning.

Also when configuring the bootloader, select "configure advanced bootloader options", and make sure that sdb is listed first in the BIOS drive order list
(changing the drive which the system boots from should have put this correctly).

Looking at the initial grub.conf, anaconda assumed the system would boot from
sda, so wrote the mbr there, and assumed that the usb-stick would be the second disk as seen by the BIOS. IOW it assumed a BIOS drive order of: internal disk, 
usb stick. And I believe you wanted it to have that reversed.


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