LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-04-2002, 06:25 AM   #1
MikHud
Member
 
Registered: Jan 2002
Location: UK
Distribution: Ubuntu
Posts: 45

Rep: Reputation: 15
GRUB not LILO - hangs now


I'm using GRUB not LILO on my RH7.2 (2.4.7-10) and I want to repartition my IDE system disk. No other OS just RH on this disk, and no SCSI. I partitioned a new disk how I want it, then copied the system over. But now I can't get GRUB to come up - the console just hangs saying "GRUB". This is what I did:-

I took a new hd and put it in as hdb, then fdisk'd the desired partitions: hdb1 = '/' (type 83), hdb2 = swap (82), hdb3 = '/bkup' (83), hdb4 = Extended (5), and hdb5 = '/home' (83). '/boot' is in a separate partition on hda but I want it under '/' on the new disk. hdb1 lies well below cylinder 1024 and I made it bootable via fdisk.
Then I did the following:-
mke2fs -L / /dev/hdb1; mke2fs -L /bkup /dev/hdb3; mke2fs -L /home /dev/hdb5
mkswap -f /dev/hdb2
Mounted /dev/hdb at /mnt/hdb.
Created the mount points: /mnt/hdb/bkup and /mnt/hdb/home.
Mounted /dev/hdb3 on /mnt/hdb/bkup, and /dev/hdb5 on /mnt/hdb/home.
cd /; find . -depth -print0 | cpio -p0admV /mnt/hdb

Next I edited the copy of grub.conf on the new disk: /mnt/hdb/boot/grub/grub.conf. Because its no longer in its own partition I added the '/boot' prefix to grub/splash.xpm and the kernel path ie: 'splashimage=(hd0,0)/boot/grub/splash.xpm.gz', and 'kernel /boot/vmlinuz...'. Root is to be hda1 (when booting from the new disk) instead of hda2 on the original installation, so I changed this on the kernel line too.
Finally I edited /mnt/hdb/etc/fstab to remove the line for the '/boot' partition which doesn't exist on the new disk. Then I put the new disk in as the primary master and re...er hung with "GRUB" !

Any suggestions what might be up with GRUB?
 
Old 05-04-2002, 08:14 AM   #2
Lazarus
Member
 
Registered: Dec 2001
Location: Kent in UK
Distribution: Fedora 2
Posts: 170

Rep: Reputation: 30
This may point you in the right direction. I wrote a small script that makes a grub boot floppy this I used do make a bootable cd
here is the script:-

#!/bin/sh
#
echo makes a grub bootable floppy
#
# written on 1st May 2002
#
if [ -z $1 ] ;
then
echo " "
echo "needs kernel file as a parameter eg"
echo "make_grub_boot_floppy vmlinuz.w.x.y"
echo " "
exit
else
kernel="/boot/$1"
fi
echo " "
echo "Low level formatting floppy"
echo " "
fdformat /dev/fd0
if [ $? != 0 ]
then
echo "Faulty floppy disk or drive"
echo "Floppy failed to format properly"
exit
fi
exit
echo " "
echo "makeing ext2 file system"
echo " "
/sbin/mke2fs /dev/fd0
if [ $? != 0 ]
then
echo "Failed to make file system on the floppy"
exit
fi
#
mount /dev/fd0 /floppy
if [ $? != 0 ]
then
echo "Floppy could not be mounted"
exit
fi
echo " "
echo "Setting up /boot/grub and copying files"
echo " "
cd /floppy
mkdir boot
cd boot
echo " "
echo "copying kernel"
echo " "
echo " "
cp $kernel vmlinuz
mkdir grub
cd grub
cp /boot/grub/* .
cp /home/source/shell/grub.menu.floppy grub.conf
cd $HOME
echo " "
echo "Running grub in batch to set up mbr"
echo " "
umount /floppy
grub --batch <<EOT
root (fd0)
setup (fd0)
quit
EOT
#
echo "Done"
#

hope that is ok I had to paste in into this in a few chunks!

here is the grub.menu.floppy file:-

#
# This is copied to grub.conf when makeing boot floppies
#
# written 2nd May 2002
#
title hda1 (linux)
root (fd0)
kernel /boot/vmlinuz ro root=/dev/hda1
title hda2 (linux)
root (fd0)
kernel /boot/vmlinuz ro root=/dev/hda2
title cdrom
root (fd0)
kernel /boot/vmlinuz ro root=/dev/hdc init=/sbin/recover
title windows or dos partition 1
rootnoverify (hd0,0)
chainloader +1
title windows or dos partition 2
rootnoverify (hd0,1)
chainloader +1
title floppy ... hit enter after invalid system disk
# note floppy is set to fd1 because on cd boot
# fd0 is used by the boot image
rootnoverify (fd1)
chainloader +1

I hope this helps. I use it to boot a linux system on a cd
largely copied from a redhat. It should anyway give you some pointers with luck.

Last edited by Lazarus; 05-04-2002 at 09:44 AM.
 
Old 05-08-2002, 05:56 AM   #3
MikHud
Member
 
Registered: Jan 2002
Location: UK
Distribution: Ubuntu
Posts: 45

Original Poster
Rep: Reputation: 15
Thanks for your help Lazarus

The main bit I hadn't done was setting up the MBR for GRUB.

I'm still not quite there yet but I'm further down the road.

Thanks
Mike.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting of raw ISO from GRUB/LILO (though preferably GRUB) Orkie Linux - Software 28 12-15-2013 09:37 PM
Switching from grub to lilo, messed up Lilo.conf, rescuing via Knoppix. SonicGT Debian 2 08-21-2005 01:15 PM
lilo hangs at LI jerrymc Linux - Software 3 07-18-2002 11:38 AM
hangs after LILO cecco Linux - Software 4 05-18-2001 07:12 AM
Lilo hangs duncan Linux - Software 4 05-17-2001 07:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration