LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-24-2005, 04:50 PM   #1
RedNovember
Member
 
Registered: Oct 2005
Distribution: Debian etch
Posts: 103

Rep: Reputation: 15
Grub Trouble


Hey, I use SimplyMEPIS 3.3.1-1 on a second 80gb hard drive, with xp on the first 40gb. I have grub on my mbr, and recently got it into my head to install ubuntu on some of the free space. Well, Ubuntu's installation of grub said it recognized "Debian Linux 3.1", which MEPIS is based off of. However, when I rebooted the system, only the memtest option for mepis still existed. Windows worked, and I put in a LiveCD of mepis. When I installed grub frum MEPIS OS Center and rebooted, it only recognized my previous MEPIS installation and not ubuntu.

my fdisk -l looks like this:

Code:
Disk /dev/sda: 65 MB, 65536000 bytes
16 heads, 32 sectors/track, 250 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         249       63728    6  FAT16

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1           4       32098+  de  Dell Utility
/dev/hda2   *           5        4865    39045982+   7  HPFS/NTFS

Disk /dev/hdb: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1        1305    10482381   83  Linux
/dev/hdb2            1306        1496     1534207+  82  Linux swap / Solaris
/dev/hdb3            1497        6718    41945715   83  Linux
/dev/hdb4            6719        7569     6835657+  83  Linux
hda1 is Dell OEM, hda2 is Windows XP.
hdb1 is mepis /, hdb2 is swap, hdb3 is /home, hdb4 is ubuntu /.
sda1 is my usb drive.

According to QTParted from MEPIS, hdb1 is 10gb, hdb2 is 1.46gb, hdb3 is 40gb, and hdb4 is 6.52gb, with 18.35gb free space.
 
Old 10-24-2005, 05:54 PM   #2
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Use ONE of your installs to control grub, whichever you prefer.
Please provide the contents of /boot/grub/menu.lst and the
output of
# ls -l /boot
for each distro, and I'll explain how to go further

You should probably take a look at
$ apropos grub
$ man update-grub
 
Old 10-25-2005, 09:11 PM   #3
RedNovember
Member
 
Registered: Oct 2005
Distribution: Debian etch
Posts: 103

Original Poster
Rep: Reputation: 15
I did all the following from MEPIS (hence the /mnt/hdb4/boot)

Here is the result of my MEPIS menu.lst:
Code:
timeout 15
color cyan/blue white/blue
foreground ffffff
background 0639a1
gfxmenu /boot/grub/message

title MEPIS at hdb1, kernel 2.6.10
kernel (hd1,0)/boot/vmlinuz-2.6.10 root=/dev/hdb1 nomce quiet splash=silent vga=791 
initrd (hd1,0)/boot/initrd.splash 

title MEPIS at hdb1, kernel 2.4.29
kernel (hd1,0)/boot/vmlinuz-2.4.29 root=/dev/hdb1 nomce quiet splash=silent vga=791 hdc=ide-scsi hdd=ide-scsi 
initrd (hd1,0)/boot/initrd.splash 

title Windows at hda2
rootnoverify (hd0,1)
chainloader +1

title MEMTEST
kernel /boot/memtest86.bin
and for Ubuntu:
Code:
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.           
default		0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout		10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title		Windows 95/98/NT/2000
# root		(hd0,0)
# makeactive
# chainloader	+1
#
# title		Linux
# root		(hd0,1)
# kernel	/vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hdb4 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,3)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## nonaltoption boot targets option
## This option controls options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## ## End Default Options ##

title		Ubuntu, kernel 2.6.12-9-386 
root		(hd1,3)
kernel		/boot/vmlinuz-2.6.12-9-386 root=/dev/hdb4 ro quiet splash
initrd		/boot/initrd.img-2.6.12-9-386
savedefault
boot

title		Ubuntu, kernel 2.6.12-9-386 (recovery mode)
root		(hd1,3)
kernel		/boot/vmlinuz-2.6.12-9-386 root=/dev/hdb4 ro single
initrd		/boot/initrd.img-2.6.12-9-386
boot

title		Ubuntu, memtest86+
root		(hd1,3)
kernel		/boot/memtest86+.bin  
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdb1.
title		MEMTEST (on /dev/hdb1)
root		(hd1,0)
kernel		/boot/memtest86.bin  
savedefault
boot


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda2
title		Microsoft Windows XP Home Edition
root		(hd0,1)
savedefault
makeactive
chainloader	+1
and the entire console session:
Code:
RedNovember@1[~]$ ls -l /boot
total 4772
-rw-r--r--  1 root root   36282 2005-02-27 10:30 config-2.4.29
-rw-r--r--  1 root root   50299 2005-02-23 16:50 config-2.6.10
drwxr-xr-x  2 root root    4096 2005-10-24 17:02 grub
-rw-r--r--  1 root root   93043 2005-04-21 23:11 initrd.splash
-rw-r--r--  1 root root   94356 2005-02-02 17:41 memtest86.bin
-rw-r--r--  1 root root  484297 2005-02-27 10:43 System.map-2.4.29
-rw-r--r--  1 root root  722693 2005-02-23 17:11 System.map-2.6.10
-rw-r--r--  1 root root 1440862 2005-02-27 10:43 vmlinuz-2.4.29
-rw-r--r--  1 root root 1912848 2005-02-23 17:11 vmlinuz-2.6.10
RedNovember@1[~]$ ls -l /mnt/hdb4/boot
total 7316
-rw-r--r--  1 root root  239770 2005-10-10 09:16 abi-2.6.12-9-386
-rw-r--r--  1 root root   64135 2005-10-10 08:12 config-2.6.12-9-386
drwxr-xr-x  2 root root    4096 2005-10-24 12:15 grub
-rw-r--r--  1 root root 4937283 2005-10-24 12:07 initrd.img-2.6.12-9-386
-rw-r--r--  1 root root   94664 2005-06-30 11:49 memtest86+.bin
-rw-r--r--  1 root root  897159 2005-10-10 09:16 System.map-2.6.12-9-386
-rw-r--r--  1 root root 1206555 2005-10-10 09:16 vmlinuz-2.6.12-9-386
Is it as simple as changing a couple of lines in menu.lst?

I was thinking about possibly adding SUSE 10.0 and Slackware later. Would this affect that at all?
 
Old 10-25-2005, 09:29 PM   #4
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
OK, so what you probably want to do is have MEPIS controlling the bootloader in the MBR,
and every other distro you install can have a bootloader on their own partition.
So, in MEPIS add this to /boot/grub/menu.lst:

title Ubuntu
root (hd1,3)
chainloader +1
boot

See how that works for you.

I'd recommend you backup your MBR, grub config and
make sure you never install a bootloader to the MBR.

You might want to get tricky and be able to go back the other way
by chainloading from Ubuntu to MEPIS:
so edit /mnt/hdb4/boot/grub/menu.lst and add

title MEPIS
root (hd1,0)
chainloader +1
boot

Get the idea?
 
Old 10-26-2005, 02:33 PM   #5
RedNovember
Member
 
Registered: Oct 2005
Distribution: Debian etch
Posts: 103

Original Poster
Rep: Reputation: 15
I see what you're saying. What would happen if I did this? Would it then take me to another grub screen after I selected Ubuntu? I would think that since the Ubuntu bootloader would be on its partition, it would take me straight to Ubuntu. Is this what would happen?

Also, how would I back up my MBR?

Thanks a lot for all the advice. I was wondering about this for a while.
 
Old 10-26-2005, 06:52 PM   #6
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Yes it should take you from the MEPIS grub screen to the Ubuntu one.

To backup your MBR (assuming you're booting from hda)

# dd if=/dev/hda of=MyMBR.img bs=1 count=446

by default, dd uses bs=512, which would also copy your partition table ...
(which is the last 64 bytes of the first sector)
...not something you always want to do.
Remember to save this file on an external device.
 
Old 10-27-2005, 02:24 PM   #7
RedNovember
Member
 
Registered: Oct 2005
Distribution: Debian etch
Posts: 103

Original Poster
Rep: Reputation: 15
Ok, I edited my menu.lst for my MEPIS grub, but if I select Ubuntu, it takes me to a blue and black screen for "GNU Grub", and asks me to select an option again. I assume this is because I don't have Grub on my Ubuntu partition. Would I have to download/burn an Ubuntu LiveCD to install Ubuntu's grub on the partition? or would the Ubuntu install cd do that?
 
Old 10-27-2005, 05:10 PM   #8
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Quote:
OK, so what you probably want to do is have MEPIS controlling the bootloader in the MBR,
and every other distro you install can have a bootloader on their own partition.
Yes, you assume correctly ... I should have made it more clear.

It would probably be easiest for you to reinstall Ubuntu and write the bootloader
to hda4 rather than the MBR.
 
Old 10-27-2005, 08:24 PM   #9
RedNovember
Member
 
Registered: Oct 2005
Distribution: Debian etch
Posts: 103

Original Poster
Rep: Reputation: 15
All right, thanks for all the help... I think this will probably solve the problem.
 
Old 11-18-2005, 10:55 PM   #10
tinybit
Member
 
Registered: Jul 2005
Location: China
Distribution: Mandriva
Posts: 84

Rep: Reputation: 15
GRUB and LILO always conflict with Windows. And GNU GRUB is not so robust, causing many problems during boot.

So try GRUB for DOS please. It is a cross-platform boot loader based on GNU GRUB. The GRUB.EXE can be started from DOS/Win9x; and GRLDR can be started from BOOT.INI of Windows NT/2K/XP/2003; and even more, the GRUB.EXE can be started from LINUX via the KEXEC tool.

By using GRUB.EXE or GRLDR, you don't have to touch your MBR. It is the safest way coexisting with DOS/Windows.

You needn't install GRUB for DOS. Just run GRUB.EXE from DOS, or append a line of "C:\GRLDR=START GRUB" into your BOOT.INI(restart and select the "START GRUB" menu item), that will do.

Download GRUB for DOS here: http://freshmeat.net/projects/grub4dos/

There is a fat12grldr.img file with the GRUB for DOS release. You can create a GRUB bootable floppy with this fat12grldr.img file.

Or, you can just copy GRUB.EXE to your DOS floppy and run GRUB.EXE to enter the GRUB environment.

If the system has no DOS/WINDOWS, you may use the bootlace.com utility to write GRLDR boot record onto the MBR.
 
Old 02-17-2006, 05:37 PM   #11
Siljrath
Bedrock Linux Advocate
 
Registered: Nov 2004
Location: the internet
Distribution: server:Gentoo | workstation:Bedrock (hijacked:void, fetched:Gentoo,Devuan,Artix)
Posts: 226

Rep: Reputation: 66
lemme see if i'm following this right...

if i were to add:

title dsl
root (hda5)
chainloader +1
boot

... then it would allow me to boot my dsl install from my 5th partition on my first hd.


and if i were to add

title SUSE
root (hda1)
chainloader +1
boot

it would add another option to boot SUSE from the first hd?

and i could install as many distros as i have the partitions for and all i need to do to allow me to boot from them all once again is to add those 4 lines of code to the grub config???

it seems too good to be true. its really that simple??


eep, before i post.. i noticed the hds are writen a little different.... so (hda5) would become (hd0,5).... that right?
 
Old 02-17-2006, 08:02 PM   #12
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Quote:
Originally Posted by Siljrath
lemme see if i'm following this right...

if i were to add:

title dsl
root (hda5)
chainloader +1
boot

... then it would allow me to boot my dsl install from my 5th partition on my first hd.
make that:
root (hd0,4)

and it would chainload the bootloader on hda5


Quote:
and if i were to add

title SUSE
root (hda1)
chainloader +1
boot

it would add another option to boot SUSE from the first hd?
root (hd0,0)

Quote:
and i could install as many distros as i have the partitions for and all i need to do to allow me to boot from them all once again is to add those 4 lines of code to the grub config???

it seems too good to be true. its really that simple??
You will need a 'controlling' bootloader, probably used by the first distro you install.
Each subsequent install will need to have their bootloader installed to the /boot partition
(or / if there is not a separate boot partition)
for the respective distro.
DO NOT INSTALL THE BOOTLOADER FOR SUBSEQUENT DISTROS IN THE MBR!

It is good, true and simple

Quote:
eep, before i post.. i noticed the hds are writen a little different.... so (hda5) would become (hd0,5).... that right?
no, (hd0,4) .... grub counts from 0
...(hd[disk][partition])

Remember to make backups of your bootloaders AND SAVE THEM ON REMOTE/REMOVABLE MEDIA,
because if you make a mistake while playing around you might find it tricky to recover.

Last edited by uberNUT69; 02-17-2006 at 08:05 PM.
 
Old 02-20-2006, 09:42 PM   #13
Siljrath
Bedrock Linux Advocate
 
Registered: Nov 2004
Location: the internet
Distribution: server:Gentoo | workstation:Bedrock (hijacked:void, fetched:Gentoo,Devuan,Artix)
Posts: 226

Rep: Reputation: 66
so in theory this sould proove no problem for even having multiple opperating systems to boot from different partitions on the same physicla drive? even logical partitions in the extended partition??? or is that pushing it?
 
Old 02-20-2006, 10:09 PM   #14
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Yes, you can have multiple OS's chainloaded on any partition (primary or logical).
They do not have to be on the same physical drive.
To essentially have a 'back' button on a chainloaded OS's boot menu, just chainload the MBR.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB trouble laubster Linux - General 2 01-05-2005 03:47 AM
Trouble with GRUB technician Linux - Software 5 02-16-2004 10:37 PM
Grub trouble p1az Linux - General 4 10-03-2003 12:20 PM
Grub trouble mcm8327 Linux - General 2 07-04-2003 08:00 AM
Trouble with GRUB SilverSnake Linux - Software 16 12-06-2002 12:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:09 PM.

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