Bug 430811 - Upgrade from F8 - anaconda doesn't find /boot, traceback trying to write new bootloader config
Summary: Upgrade from F8 - anaconda doesn't find /boot, traceback trying to write new ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Chris Lumens
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F9Blocker
TreeView+ depends on / blocked
 
Reported: 2008-01-29 21:48 UTC by Will Woods
Modified: 2008-03-12 20:16 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-12 20:16:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
anacdump.txt (499.67 KB, text/plain)
2008-01-29 21:48 UTC, Will Woods
no flags Details

Description Will Woods 2008-01-29 21:48:04 UTC
Attempted an upgrade from F8 to F9Alpha. Packages installed fine but the
installer traced back at post-install configuration.

It appears that bootDevs is an empty list - perhaps I forgot to choose a device?
I also had a USB key inserted when I did the installation, so this might also
have affected things.

anaconda 11.4.0.27 exception report
Traceback (most recent call first):
  File "/usr/lib/booty/bootloaderInfo.py", line 759, in writeGrub
    f.write('#          root %s\n' % self.grubbyPartitionName(bootDevs[0]))
  File "/usr/lib/booty/bootloaderInfo.py", line 1187, in write
    justConfig | (not self.useGrubVal))
  File "/usr/lib/anaconda/bootloader.py", line 209, in writeBootloader
    justConfigFile, anaconda.intf)
  File "/usr/lib/anaconda/dispatch.py", line 209, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 132, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/gui.py", line 1201, in nextClicked
    self.anaconda.dispatch.gotoNext()
  File "/usr/lib/anaconda/iw/progress_gui.py", line 80, in renderCallback
    self.intf.icw.nextClicked()
  File "/usr/lib/anaconda/gui.py", line 1222, in handleRenderCallback
    self.currentWindow.renderCallback()
IndexError: list index out of range

Comment 1 Will Woods 2008-01-29 21:48:04 UTC
Created attachment 293348 [details]
anacdump.txt

Comment 2 Will Woods 2008-01-29 23:06:35 UTC
retested without the USB key inserted; no change.

Comment 3 Will Woods 2008-01-29 23:56:14 UTC
Retested with regular F8 instad of LiveCD install - no change.

It's worth noting that in all these cases I get the "installer is unable to
detect the boot loader currently in use on your system" screen. I choose "Create
new" and the install proceeds, then bombs at bootloader configuration time.

I'll try skipping the bootloader configuration update, but given that the
existing system is just a normal F8 install, shouldn't we be able to detect it?

Comment 4 Will Woods 2008-01-30 00:51:51 UTC
Further note: it looks like /boot was not mounted during the upgrade, and
there's no fstab entry for it in the upgraded system. Details below:

After skipping the bootloader config (and thus completing an install) GRUB shows
that there are no F9 boot images in the /boot partition (/dev/sda1).

Booting the F8 images (which are still there) gets the system up and running.
There's no fstab entry for /boot, so sda1 is auto-mounted as /media/_boot once
you log into X.

/boot on the root partition contains the F9 kernel, but no grub.conf. So:

  1) cp /boot/*fc9* /media/_boot
  2) rm -rf /boot/*
  3) echo '/dev/sda1 /boot ext3 defaults 1 1' >> /etc/fstab
  4) umount /media/_boot; mount /boot
  5) vi /etc/grub.conf, add boot entry for fc9 kernel
  6) reboot

and now the system is OK.

Comment 5 Will Woods 2008-01-30 17:21:07 UTC
clumens guided me through some debugging - we found that, basically, anaconda
does not see /boot in its list of disks. It's not mounted anywhere. 

During the findrootparts step, anaconda finds the drive itself ok:
DEBUG   : self.driveList(): [u'sda']

It then finds the LVs, and does this:

DEBUG   : isys.py:mount()- going to mount /dev/VolGroup00/LogVol00 on /mnt/sysimage
DEBUG   : isys.py:mount()- going to mount /dev/VolGroup00/LogVol01 on /mnt/sysimage
DEBUG   : isys.py:mount()- going to mount sda1 on /mnt/sysimage
WARNING : step complete does not exist

This is the last time it mentions sda1 or /boot. 

Checking the debugger we find that sda1's 'active' flag is apparently set to 0.
Later partitioning code filters out inactive partitions, so that's why it's
ignored from there on out. We're not yet sure why it's not marked as active.

Comment 6 Jeremy Katz 2008-01-30 17:37:40 UTC
(In reply to comment #5)
> Later partitioning code filters out inactive partitions, so that's why it's
> ignored from there on out. We're not yet sure why it's not marked as active.

This doesn't make much sense... there can only be one active partition per disk
(active is the partition with the 'boot' flag; MBR code uses this to determine
which partition to run code from at boot time)

Comment 7 Will Woods 2008-01-30 17:42:28 UTC
fdisk -l /dev/sda shows that sda1 has the boot flag set. So sda1 should be
considered active.. but:

  part = diskset.disks["sda"].next_partition()
  print part.is_active()

gives a result of 0. So something's wrong there.

Comment 8 Jeremy Katz 2008-01-30 17:53:08 UTC
You're not comparing the same things.  is_active() is just whether or not the
partition is a real partition (as opposed to freespace or metadata).  You need
to use get_flags() and & the result with parted.PARTITION_BOOT.

Also, that part isn't going to be sda1 -- instead, it's the metadata partition
at the start of the disk.  Hence, why it doesn't count as active.

Comment 9 Will Woods 2008-01-30 18:48:03 UTC
Ah, okay. Something was definitely wrong.. my understanding of the code. Heh.
Starting again: the root of the problem is that /boot is not showing up in
diskset.getLabels(). getLabels() does this:

for part in parts:
    node = get_partition_name(part) # returns 'sda1'
    label = isys.readFSLabel(node)  # returns None (!)

isys.readFSLabel('/dev/sda1'), on the other hand, returns '/boot'. Huzzah!

clumens has prepared an updates.img with a modified isys that prepends '/dev/'
if it's not there. Testing that now.

Comment 10 Chris Lumens 2008-01-30 21:41:49 UTC
This should be fixed in the next build of anaconda.  Now to fix the updates.img
problem...


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