Upgrade from RH8 to FC1 hangs with GRUB

Wolfgang wolfgang at rpi.net.au
Thu Jan 22 12:23:34 UTC 2004


On Thu, 2004-01-22 at 07:04, John Rumball wrote:
> Phil,
> 
> Thanks for taking the time to post your detailed response.  I will file 
> it for future reference because I was able to solve my problem and 
> finally boot from the new disk.  This is how...
> 
> When I first used ghost to image my old disk to the new disk, I used 
> Ghost 7.5 AND accepted the default sizes that ghost selected for the 
> partitions on the new disk.  That is, it increased the size of my boot 
> partition (hda1).
> 
> I found a document on the Symantec site that talks specifically about a 
> problem using Ghost 7.5 and earlier to image Linux partitions that use 
> the Grub loader. Imagine!!  So, I decided to re-ghost my old disk, this 
> time using Ghost 8.0.  I also decided to leave the boot partition the 
> same size as on the old disk.  When I subsequently tried to boot from 
> the new drive everything worked as hoped!!!
> 
> Thank you to everyone who offered their assistance. 
> 
> The open source community rules!!
> 
> 
> John Rumball
> 
> 
> > On Wed, 2004-01-21 at 12:19, John Rumball wrote:
> > > That line must have been commented out by anaconda.
> > 
> > My guess as well.  Had wondered about why, but it works that way so
> > never dug in to find out.
> > 
> > > I notice that it 
> > > is also commented out on my FC1 box at home (which also has hda1, 
> hda2, 
> > > hda3 and was recently upgraded from RH8) and on the old drive I am 
> > > replacing in this box.
> > > 
> > > I should also mention that I tried booting off my old drive and it 
> > > worked just fine, although it loaded RH8 and not FC1.  I guess this 
> > > confirms that my previously attempted yum upgrade never completed 
> > > properly!
> > 
> > Sounds like it.  From your original message it appears the actual
> > install of the new RPMS never started.  Haven't used Ghost for this 
> kind
> > of cloning but it seems that something messed up.  Presumably you had 
> to
> > configure the old drive as master or single (/dev/hda) to get the 
> system
> > to boot back to RH8.  If the new drive is configured as slave, can 
> still
> > boot to the old one?
> > 
> > If so, and if you still want to try an upgrade to preserve old 
> settings
> > etc., I'd try "cloning" the running system on the old drive under 
> Linux
> > to the new one configured as a slave drive (/dev/hdb).
> > 
> > Something along these lines has worked for me:
> > 
> > 	dd if=/dev/zero of=/dev/hdb bs=512 count=1 # Kill old MBR
> > 	fdisk /dev/hdb	# create partitions as desired
> > 	...
> > Then
> > 	mke2fs -j /dev/hda1
> > 	mke2fs -j /dev/hda2
> > 	mkswap /dev/hda3
> > 	mkdir /alt
> > 	mount /dev/hda2 /alt
> > 	mkdir /alt/boot
> > 	mount /dev/hda1 /alt/boot
> > 	cp -aux /boot /alt
> > 	cp -aux / /alt
> > 
> > Make a grub boot floppy so you can boot either instance in a pinch.
> > 
> > This script (I call it mkgrubmenu and it lives in /root/bin) may help
> > (did for Paolo):
> > -------------------------------------------------------------------
> > #!/bin/bash
> > # mkgrubmenu
> > #
> > # Written by Phil Schaffner <p.r.schaffner at ieee.org>
> > #  based on mkbootdisk by Erik Troan <ewt at redhat.com>
> > 
> > pause=yes
> > format=yes
> > device=/dev/fd0
> > unset verbose
> > 
> > GRUBDIR=/boot/grub
> > MOUNTDIR=/tmp/mkgrubmenu
> > PATH=/sbin:$PATH
> > export PATH
> > 
> > VERSION=0.1
> > 
> > usage () {
> >     cat >&2 <<EOF
> > usage: `basename $0` [--version] [--noprompt] [--noformat]
> >        [--device <devicefile>] [--grubdir <dir>] [--verbose -v]
> >        (ex: `basename $0` --device /dev/fd1)
> > EOF
> >     exit $1
> > }
> > 
> > while [ $# -gt 0 ]; do
> >     case $1 in
> > 	--device)
> > 	    shift
> > 	    device=$1
> > 	    ;;
> > 	--grubdir)
> > 	    shift
> > 	    GRUBDIR=$1
> > 	    ;;
> > 	--help)
> > 	    usage 0
> > 	    ;;
> > 	--noprompt)
> > 	    unset pause
> > 	    ;;
> > 	--noformat)
> > 	    unset format
> > 	    ;;
> > 	-v)
> > 	    verbose=true
> > 	    ;;
> > 	--verbose)
> > 	    verbose=true
> > 	    ;;
> > 	--version)
> > 	    echo "mkgrubdisk: version $VERSION"
> > 	    exit 0
> > 	    ;;
> > 	*)
> >             usage
> > 	    ;;
> >     esac
> > 
> >     shift
> > done
> > 
> > [ -d $GRUBDIR ] || {
> >     echo "$GRUBDIR is not a directory!" >&2
> >     exit 1
> > }
> > 
> > 
> > 
> > if [ -e "$device" ]; then {
> >     [ -n "$pause" ] && {
> > 	echo -n "Insert a"
> > 	[ -n "$format" ] || echo -n " vfat formatted"
> > 	echo " disk in $device."
> > 	echo "Any information on the disk will be lost."
> > 	echo -n "Press <Enter> to continue or ^C to abort: "
> > 	read aline
> >     }
> > 
> >     [ -n "$format" ] && {
> > 	[ -n "$verbose" ] && echo "Formatting $device... "
> > 	fdformat $device || exit 0
> > 	mkfs.msdos $device > /dev/null 2>/dev/null || exit 0
> > 	[ -n "$verbose" ] && echo "done."
> >     }
> > 
> >     rm -rf $MOUNTDIR
> >     mkdir $MOUNTDIR || {
> > 	echo "Failed to create $MOUNTDIR" >&2
> > 	exit 1
> >     }
> >     [ -d $MOUNTDIR ] || {
> > 	echo "$MOUNTDIR is not a directory!" >&2
> > 	exit 1
> >     }
> > 
> >     mount -wt vfat $device $MOUNTDIR || {
> > 	rmdir $MOUNTDIR
> > 	exit 1
> >     }
> > 
> >     mkdir $MOUNTDIR/grub
> > 
> >     [ -n "$verbose" ] && echo -n "Copying $GRUBDIR files... "
> >     cd $GRUBDIR
> >     cp -a stage1 stage2 grub.conf device.map $MOUNTDIR/grub
> >     [ -n "$verbose" ] && echo "done."
> > 
> >     [ -n "$verbose" ] && echo -n "Setting up GRUB... "
> >     grub --device-map=$GRUBDIR/device.map --batch <<EOF
> > root (fd0)
> > setup (fd0)
> > quit
> > EOF
> > 
> >     [ -n "$verbose" ] && echo "done."
> > 
> >     umount $MOUNTDIR
> >     rmdir $MOUNTDIR
> >     [ -n "$verbose" ] && echo "done setting up GRUB."
> >     echo "edit (fd0)/grub/grub.conf to customize."
> > }
> > else
> >     echo "$device does not exist"
> > fi
> > 
> > ---------------------------------------------------------------
> > 
> > Configure the new drive as single (recommended to avoid possible MBR
> > confusion) or master, with the old one either removed or as slave.  
> Boot
> > using the floppy, and (assuming success) log on as root and do the
> > following:
> > 
> > 	grub
> > 	root (hd0,0)
> > 	setup (hd0)
> > 	quit
> > 
> > You SHOULD, with any luck, then be able to reboot from the new disk 
> and
> > continue with the upgrade.
> > 
> > Check out 
> > http://www.ldeo.columbia.edu/~vschmidt/notes/redhat2fedora/
> > for good hints on how to upgrade with yum.
> > 
> > Should also be possible to boot either instance of Linux with both 
> disks
> > installed if you appropriately edit /boot/grub/grub.conf, and
> > /alt/etc/fstab and /alt/etc/mtab on the /dev/hdb2 partition, but won't
> > go into all that detail here.
> > 
> > Good luck!
> > 
> > Phil

Good to see it's working ok now. You should be able to repartition it
with Ghost now too. As I've used it on RH7.3, 8.0 & 9 without problems.
(And that's also the whole point of being able to use ghost to upgrade
to a larger HDD when needed. As I keep a copy of it on a bootable CD-R.)

The only thing I have encountered with Ghost, was the booting problem
from time to time (Which can be corrected by what I mentioned in my
first post. And that the older versions 5->7 wouldn't handle the Linux
Ext3 system too well, where as you found out that version 8 does it
nicely.

Wolf






More information about the fedora-list mailing list