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 - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-01-2005, 01:10 PM   #1
Ay-Karamba!
Member
 
Registered: Aug 2005
Location: Sydney
Distribution: Ubuntu, FC4
Posts: 43

Rep: Reputation: 15
quick question about grub bootloader & installing another distro


Hi just a quick and simple question: Currently I have a hardisk with Win Xp and FC4 installed on it and a grub bootloader that came from FC4 to make it a dual-booting system. What would I have to do to make another partition and install ubuntu in it while keeping the the current grub bootloader (just make the bootloader can detect my new distro so I can boot it. I don't want ubuntu to install a new bootloader that overrides the current one, and I want to keep all my data (without having to store it on another place temporarily). Thanks
 
Old 09-01-2005, 01:17 PM   #2
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,775

Rep: Reputation: 86
Install Ubuntu on a new partition, but when you're asked if you want to install Grub to the MBR, say no. Then in Fedora, mount as root the Ubuntu partition and copy the appropriate entry from the Ubuntu partition's /boot/grub/menu.lst to the Fedora partition's /boot/grub/menu.lst. Should work.
 
Old 09-01-2005, 01:19 PM   #3
bushidozen
Member
 
Registered: Oct 2004
Posts: 215

Rep: Reputation: 30
first of all, do you already have space on your hard drive for ubuntu? Usually during the installation of a linux distribution, at some point you are asked if you would like to install a bootloader or if one is already installed. I would run the disk first to see if you have that option.
 
Old 09-01-2005, 08:23 PM   #4
Ay-Karamba!
Member
 
Registered: Aug 2005
Location: Sydney
Distribution: Ubuntu, FC4
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by aysiu
Install Ubuntu on a new partition, but when you're asked if you want to install Grub to the MBR, say no. Then in Fedora, mount as root the Ubuntu partition and copy the appropriate entry from the Ubuntu partition's /boot/grub/menu.lst to the Fedora partition's /boot/grub/menu.lst. Should work.
Hmm.. I think I get what you mean, I've checked my /boot/grub/menu.lst and there's something like this:
Code:
title Fedora Core (2.6.12-1.1398_FC4)
	root (hd0,1)
	kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
	initrd /initrd-2.6.12-1.1398_FC4.img
Do you mean I just get a line that looks like this but contains Ubuntu partition and copy it to FC4 partition? But if I don't install grub on Ubuntu partition, will I have /boot/grub/menu.lst on it? And will
Code:
 mount /dev/hdaN
works to mount it?
 
Old 09-01-2005, 08:25 PM   #5
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Houston, TX
Distribution: Arch
Posts: 1,381

Rep: Reputation: 47
I think bushidozen is right, usually the install will detect other installations and will add the appropriate settings to grub
 
Old 09-01-2005, 08:28 PM   #6
Ay-Karamba!
Member
 
Registered: Aug 2005
Location: Sydney
Distribution: Ubuntu, FC4
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by bushidozen
first of all, do you already have space on your hard drive for ubuntu?
This is another thing I would like to know really. So far by browsing the ubuntu documentation, I've found that the installation process is similiar to debian, and there is an option where you can edit your partition table, but I'm not sure if I can resize a current partition without losing my data on it (anyone can help with this?)..
Quote:
Usually during the installation of a linux distribution, at some point you are asked if you would like to install a bootloader or if one is already installed. I would run the disk first to see if you have that option.
I'm pretty sure the installer come with a bootloader, and I'll try aysiu's method by not installing it, and there shouldn't be any problem with this part
 
Old 09-01-2005, 10:28 PM   #7
Ay-Karamba!
Member
 
Registered: Aug 2005
Location: Sydney
Distribution: Ubuntu, FC4
Posts: 43

Original Poster
Rep: Reputation: 15
Hi again, because I couldn't wait any longer for your reply, I decided to install it (and yes it ended up with problem). Here's what happenend:

On ubuntu installer, I decided to edit the partition table manually, and I resized my FC4 partition from 74GB to 54 GB (I assumed no data would be lost here), and I told ubuntu to use the 20GB free space.

Then because the installer said it needs to reboot to finish the config, then I let it installed a bootloader overriding my previous one. But after the installation finished successfully, I couldn't boot my FC4 anymore.

First, it didn't appear in the bootloader menu, so added this into /boot/grub/menu.lst on my ubuntu partition
Code:
title Fedora Core (2.6.12-1.1398_FC4)
	root (hd0,1)
	kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
	initrd /initrd-2.6.12-1.1398_FC4.img
And when I tried to boot it, the system went error, it said kernel-panic or something. So I tried to mount my FC4 partition (/dev/hda3) on ubuntu to see if I still have the data on it, but mount didn't know what type of partition /dev/hda3 is. Here's what I got when I do 'fdisk -l /dev/hda3'
Code:
Disk /dev/hda3: 54.9 GB, 54903744000 bytes
255 heads, 63 sectors/track, 6675 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/hda3 doesn't contain a valid partition table
But /dev/hda1 and /dev/hda2 still okay i guess. /dev/hda1 contains my WinXp partition, here's what inside /dev/hda2

config-2.6.11-1.1369_FC4
config-2.6.11-1.1369_FC4smp
config-2.6.12-1.1398_FC4
grub
initrd-2.6.11-1.1369_FC4.img
initrd-2.6.11-1.1369_FC4smp.img
initrd-2.6.12-1.1398_FC4.img
lost+found
memtest86+-1.55.1
System.map-2.6.11-1.1369_FC4
System.map-2.6.11-1.1369_FC4smp
System.map-2.6.12-1.1398_FC4
vmlinuz-2.6.11-1.1369_FC4
vmlinuz-2.6.11-1.1369_FC4smp
vmlinuz-2.6.12-1.1398_FC4
xen.gz
xen-syms

And here's what I got when I did 'dmesg | tail' (if this helps)
Code:
drivers/usb/input/hid-input.c: event field not found
eth0: no IPv6 routers present
UDF-fs: No VRS found
ISO 9660 Extensions: Microsoft Joliet Level 3
ISO 9660 Extensions: RRIP_1991A
VFS: Can't find ext3 filesystem on dev hda3.
NTFS driver 2.1.22 [Flags: R/O MODULE].
NTFS-fs error (device hda3): read_ntfs_boot_sector(): Primary boot sector is invalid.
NTFS-fs error (device hda3): read_ntfs_boot_sector(): Mount option errors=recover not used. Aborting without trying to recover.
NTFS-fs error (device hda3): ntfs_fill_super(): Not an NTFS volume.
And 'fdisk -l /dev/hda' give me this
Code:
Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1       10335    83015856    7  HPFS/NTFS
/dev/hda2           10336       10348      104422+  83  Linux
/dev/hda3           10349       17023    53616937+  8e  Linux LVM
/dev/hda4           17024       19457    19551105    5  Extended
/dev/hda5   *       17024       19353    18715693+  83  Linux
/dev/hda6           19354       19457      835348+  82  Linux swap / Solaris
Can anyone help me to boot my FC4, or at least check if I still have all the data in it?

Last edited by Ay-Karamba!; 09-01-2005 at 10:31 PM.
 
Old 09-02-2005, 09:59 AM   #8
bushidozen
Member
 
Registered: Oct 2004
Posts: 215

Rep: Reputation: 30
When you resized the FC partition, it's very possible that you could have overwrote the mount point that is used to boot FC. Data is not necessarily saved sequentially on hard disks (which is why there is a "Disk Defragmenter" in Windows), it can be saved anywhere on the partition. I'm not sure if ubuntu checked for data when it resized the partiton, it could have just overwrote what was there. If that is the case, you won't be able to boot FC. In any case, I hope that you backed up your data before you started...

...you did back up your data, right?
 
Old 09-02-2005, 06:00 PM   #9
Ay-Karamba!
Member
 
Registered: Aug 2005
Location: Sydney
Distribution: Ubuntu, FC4
Posts: 43

Original Poster
Rep: Reputation: 15
Unfortunately no (bad luck for me), but I keep the important ones on my laptop. That's okay, but now I face another problem, I can't boot my windows Xp, it said "unmountable_boot_volume". I've tried to repair the mbr thru windows xp cd but it seems that my win xp cd doesn't have repair options, it only asks for "automated system recovery", and I need a floppy disk for that which I don't have. Is there any way to fix this without using Win Xp cd and keep my grub bootloader unchanged?
 
Old 09-02-2005, 06:18 PM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Don't have a neat solution for you to get out of this hole but I can explain why it happened.

Basically your swap at hda6at the end of the hdd tells me that it was in the position hda5 before you created Ubuntu. Unless you have deleted it first the resizing program would simply jam the new hda5 in between FC4 and the swap partition because that was the space coming out of the backside of FC4 when you you squeezed it for space. Your FC4 has to panic because its hda5 swap has gone.

Been a long time since I mess around with the swap partition but you can try to alter FC4's fstab where the location of the swap is specified.

Judging from the your problem with XP it may be more serious than just a relocated swap.

You can restore XP's MBR by just a DOS bootable floppy withj fdisk.exe in it. Boot it up and type fdisk /mbr. All MS OS boot code are interchangeable. I normally use a DOS 6.22 floppy.

Last edited by saikee; 09-02-2005 at 06:23 PM.
 
Old 09-02-2005, 06:45 PM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
It could have been a dead simple procedure to mult-boot in GNU/Linux if the Ubuntu has a reserved partition to get into.

In this case just install Ubuntu
The installer will offer the boot loader location either in MBR or in its root partition, always choose the latter
In FC4's /boot/grub/menu.lst just add these 3 lines

Title this in my Ubuntu in hda5
root (hd0,4)
chainloader +1

This is the way I multiboot about 40 systems with Grub.

I actually amend the /boot/grub/menu.lst before the installations like this

Title Empty partition @ hda30
root (hd0,29)
chainloader +1

Title Empty partition @ hda31
root (hd0,30)
chainloader +1

and so on

In Grub these entries don't boot until they are filled.

The above chainloading method beats the direct boot to the kernel because it is generic and that meansare the same 3 lines applicable to DOS, Win3x, Win9x, Win2k, XP, *BSD and Solaris when I tried. The necessary condition for it to work is to have a bootloader ready for chainloading and that is why it pays to install the bootloader in root partition (or Linux's own partition) always.

Like I said it could have been so simple.

While I am on this subject and knowing Ubunto is available and has Grub as its bootloader can I offer an advice to create a Grub bootable floppy in Ubuntu?

Just log in as root, change directory to /boot/grub and dd stage1 and stage2 files into the floppy

cd /boot/grub
dd if=stage1 of=/dev/fd0 bs=512 count=1
dd if=stage2 of=/dev/fd0 bs=512 seek=1

This floppy again can boot any system. Just pop it in and boot to Grub prompt, to boot up XP manually you type

root (hd0,0)
chainloader +1
boot

changing (hd0,) to (hd0,1) will boot the panicky FC4
changing (hd0,0) to (hd0,4) will boot Ubuntu

Last edited by saikee; 09-02-2005 at 06:48 PM.
 
Old 10-06-2005, 06:29 AM   #12
Tim_Foust
LQ Newbie
 
Registered: Jun 2004
Location: Columbus Ohio
Distribution: Mandrake 10.0
Posts: 17

Rep: Reputation: 0
saikee -
Great post! I am trying to learn how to do just this (Linux multiboot), but I need some clarification.

First, the specs regarding my box and what I am hoping to accomplish:

Primary Master - XP
Primary Slave - CentOS
Secondary Master - Mandrake 10.1
Secondary Slave - DVD Burner

All OSs are on their physical hard drive.

Currently, I can only boot into Xp or Cent via GRUB. The only way to see Mandrake is to set it as Master and unplug PM and PS. Bootloader for Mandrake on it's own boot partition.

So, at the least, I would like to be able to see all 3 OSs at boot and select which one I want.
Ideally, I want to completely lose XP and install Ubuntu in its place, to achieve this result:

Primary Master - Ununtu
Primary Slave - CentOS
Secondary Master - Mandrake 10.1
Secondary Slave - DVD Burner

If adding a few lines to signify to GRUB that there are other OS's (chainloader +1), that would be incredibly easy!

If you have time, please let me know what changes I would want to make to GRUB.

"The installer will offer the boot loader location either in MBR or in its root partition, always choose the latter
In FC4's /boot/grub/menu.lst just add these 3 lines

Title this in my Ubuntu in hda5
root (hd0,4)
chainloader +1

This is the way I multiboot about 40 systems with Grub.

I actually amend the /boot/grub/menu.lst before the installations like this

Title Empty partition @ hda30
root (hd0,29)
chainloader +1

Title Empty partition @ hda31
root (hd0,30)
chainloader +1

and so on

In Grub these entries don't boot until they are filled."

The above looks loke what I would need to do, am I correct in that? Except I using each OS on it's own physical drive. I want to install more on multiple partitions, but for now, I'll just stick to the 3 drives.

Thanks in advance!
Tim
 
Old 10-14-2005, 09:00 AM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Tim,

Just back from a 3-week holiday without a computer and am in a process clearing backlogs quickly.

Not too sure what exactly is bothering you but if you have the 3 systems installed in say the first partition of each disk, then they are known to Grub as (hd0,0), hd1,0) and (hd2,0)

You can amend your /boot/grub/menu/lst controlling the MBR to include the choices of booting to any of the above.

It is really as simple as that. Just make sure you have the bootloader of each system installed in its root partition. If you haven't done it at installation you can do it when you run that Linux by

grub-install /dev/hdb1 --- for Linux using Grub installed in 2nd disk 1st partition

lilo -b /dev/hdb1 --- for Linux using Lilo installed in 2nd disk 1st partition etc
 
  


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
Quick bootloader question /hme/usr Mandriva 4 11-16-2005 12:31 PM
Installing The Grub Bootloader From Rescue Disk sloik2000 Linux - Software 4 01-20-2005 04:38 PM
GRUB Bootloader Question raevin Linux - General 6 07-17-2004 12:37 PM
Installing Arch--bootloader killed my Grub busbarn Linux - Software 4 03-13-2004 10:34 PM
Re-installing Grub Bootloader? kkempter Linux - General 21 08-20-2003 04:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:19 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