Ticket #19 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

unable to boot after preupgrade's reboot (no boot partition)

Reported by: mjakubicek Owned by: skvidal
Priority: major Milestone: 1.0
Component: preupgrade Version: 0.9.x
Keywords: Cc: xjakub@…
Blocked By: Blocking:

Description

Tested on a F8 with preupgrade 0.9.1 (used the RPM which is currently reviewed in RHBZ #439117)

After downloading packages, reboot, selecting "Upgrade to rawhide", an error message has been displayed that no ISO media were found and I was prompted to select a partition and directory containing the installation files. I found following lines in the terminal:

ERROR: failed to open /mnt/isodirbootupgradestage2.img
ERROR: unable to find Fedora installation images on hd

Obviously there are missing slashes (/mnt/isodir/boot/upgrade/stage2.img), but I was unable to select the right directory: I selected the partition (/dev/sda2 in my case), then put "/boot/upgrade/stage2.img" as directory, but still got a message that there are no installation files in "/mnt/isodir/boot/upgrade/stage2.img". I couldn't get rid of the "/mnt/isodir" path. (Is it possible?)

Change History

comment:1 Changed 6 years ago by wwoods

  • Milestone changed from 0.9 to 1.0
  • Version changed from prerelease to 0.9

comment:2 Changed 6 years ago by skvidal

mjakubicek,

if I give you a script with just the section that generates what to put in your grub.conf can you run it and tell me what it says?

comment:3 Changed 6 years ago by skvidal

okay, pretty sure I figured out where it is happening. Could you run this via python and tell me what it outputs:

#!/usr/bin/python

import os, os.path fn = 'images/stage2.img' bootpath='/boot/upgrade' somepath = bootpath + '/' + fn st_dev = os.stat(somepath).st_dev bootdev = st_dev_to_devicename(st_dev) mtab = open("/etc/mtab") mountpoint = for line in mtab:

(dev,mp,rest) = line.split(' ',2) if dev.endswith(bootdev):

mountpoint = mp

if mountpoint:

print '(%s, %s)' % (bootdev,somepath.replace(mountpoint,))

thanks

comment:4 follow-up: ↓ 5 Changed 6 years ago by skvidal

hmm, that was garbled.

just get this and run it: http://skvidal.fedorapeople.org/misc/preupgrade_stage2.py

comment:5 in reply to: ↑ 4 Changed 6 years ago by mjakubicek

Sure, the output of your script is:

./preupgrade_stage2.py

(sda2, bootupgradestage2.img)

Any other info needed?

comment:6 Changed 6 years ago by wwoods

  • Resolution set to fixed
  • Status changed from new to closed

Think I figured this one out - should be fixed in bzr rev 114 (or the upcoming 0.9.3 package).

comment:7 Changed 6 years ago by mjakubicek

  • Resolution fixed deleted
  • Status changed from closed to reopened

It's not. Only the slashes have been added, but:

1) The initial slash is still missing (before "boot").
2) The "/mnt/isodir" prefix is still there.

So now the error is:

ERROR: failed to open /mnt/isodirboot/upgrade/stage2.img
ERROR: unable to find Fedora installation images on hd

Even after adding the initial slash (/boot/...), I can't get rid of the "/mnt/isodir" prefix and proceed with the update.

P.S.: As there is finally the appropriate component in RHBZ, should I file a tracker bug there too?

comment:8 Changed 6 years ago by mjakubicek

I've just found out following:

If I add the initial slash directly into the kernel boot command line (after hd:sda2:), then the output seems to be different, instead of the error messages, I get:

INFO: mounted loopback device /mnt/runtime on /dev/loop0 as /tmp/stage2.img
INFO: unmounting loopback /mnt/runtime /dev/loop0
INFO: unmounting loopback /mnt/runtime /dev/loop0
ERROR: LOOP_CLR_FD failed for /mnt/runtime /dev/loop0 (No such device or address)

(Maybe there are some typos, sorry, but they shouldn't matter)
Isn't it an anaconda issue -- unmounting the same loopback twice?

Note: the initial slash really has to be added via grub into the command line, if I add it later then I can't get rid of the /mnt/isodir prefix (even /mnt/isodir/../../boot/upgrade/stage2.img doesn't work!).

comment:9 follow-up: ↓ 10 Changed 6 years ago by wwoods

Okay, missing initial / on the stage2= parameter *seems* to be related to having /boot on the root partition. Do you have a separate boot partition?

I'm going to try to reproduce this here.

comment:10 in reply to: ↑ 9 Changed 6 years ago by mjakubicek

Replying to wwoods:

Okay, missing initial / on the stage2= parameter *seems* to be related to having /boot on the root partition. Do you have a separate boot partition?

No

comment:11 follow-up: ↓ 12 Changed 6 years ago by wwoods

  • Resolution set to fixed
  • Status changed from reopened to closed

Okay! It seems that we strip off the mountpoint from the path we're given - makes sense when you have a dedicated /boot and the file is /boot/upgrade/stage2.img. You want /upgrade/stage2.img from /dev/sda1 or whatever.

When you don't have separate /boot, the mountpoint is '/'. So then we end up with "boot/upgrade/stage2.img", which doesn't work. Easy fix: Don't strip the path if mountpoint is '/'.

Committed to bzr (rev 129). If you want to test the fix, either clone the bzr repo or wait for a new build.

comment:12 in reply to: ↑ 11 Changed 6 years ago by mjakubicek

Replying to wwoods:

Committed to bzr (rev 129). If you want to test the fix, either clone the bzr repo or wait for a new build.

Great work boys, it's fixed! Thanks!

comment:13 Changed 6 years ago by dwheeler

  • Priority changed from critical to major
  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Summary changed from unable to boot after preupgrade's reboot to unable to boot after preupgrade's reboot (no boot partition)

Just did a preupgrade on 2008-07-01, and preupgrade STILL doesn't work on systems without a separate boot partitin (the stage2= value in grub.conf is still wrong).

Was this fix placed into Fedora 7's repository? If not, it needs to be.

I realize that Fedora 7 is "end of life"d, but I think there should be an exception for PreUpgrade?. If you want people to move off Fedora 7 to 8 or 9, then you need to make it easy for them to upgrade. Having a fully-working preupgrade for Fedora 7 is one of the BEST ways to get people to upgrade from Fedora 7. For Fedora 7, you might want to disable xfs ("chkconfig xfs off") and/or uninstall Thunderbird, since other bug reports seem to claim there are problems.

Thanks!

comment:14 Changed 6 years ago by mjakubicek

Please could an appropriate update be released for F8/F9? Yesterday I tried on latest F8 with same results, although it's fixed in bzr.

comment:15 Changed 5 years ago by wwoods

  • Resolution set to fixed
  • Status changed from reopened to closed

Fixed and affected distros are long since EOL'd

Note: See TracTickets for help on using tickets.