quick question about grub bootloader & installing another distro
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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:
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
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
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
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
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.
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...
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?
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.
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
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:
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.