Great stuff. Fascinating. Makes me want to run out and buy a few big hard-drives.
Slackware gives you a choice of where to put the bootloader. Not sure (can't remember), but I don't think Ubuntu does.
Printable View
Great stuff. Fascinating. Makes me want to run out and buy a few big hard-drives.
Slackware gives you a choice of where to put the bootloader. Not sure (can't remember), but I don't think Ubuntu does.
I would say out of 100 distros there may be 3 to 5 of them only permit the boot loader to be installed in the MBR and nowhere else. The big majority always allow its boot loader to be installed into its root partition and that include Ubuntu too but you have to look out for it because it is hidden under "advance" or "Advance boot loader option".
When a Linux has the boot loader inside its root partition it cannot be booted by itself but must be booted by the boot loader controlling the MBR.
I recommend chainloading before you don't have to worried about what boot loader is inside. Grub, Lilo, NTLDR (xp), bootmgr (Vista), etc, etc are all booted identically by command in grub
If you use Lilo in the MBR the same (assuming (hd0,6) is sda7) appliesCode:title OS in (hd0,6)
root (hd0,6)
chaonloader +1
That is all one needs from booting the 2nd to 200th operating systems by changing just the booting partition reference. Lilo's has a static screen and objects to more than 27 images after the screen is completely filled. For MS systems (Solaris and most BSD too) you have to be aware of their characteristics and ask Grub or Lilo to do extra work to keep them happy.Code:other=/dev/sda7
label=System_in_sda7
People in Justlinux has taught me that I can keep every operating system I install and I can have as many as I want. Currently sky is the limit.
How do you tell ubuntu to put the boot loader in the root partition?
I know its under advanced.... But then what do you type in the box???
ROOT?
/?
I typed (hd0,6) for the 7th partition of the 1st disk. Grub counts from 0.
In any case you can choose to do it before rebooting after the installation by
say you have made a msitake to let Ubuntu overwrite the MBR and your original Linux that controls the MBR is in (hd0,2) you can restore the original Grub (while you are still inside the Ubuntu boot up Live CD and is about to reboot to try the newly installed Ubuntu) at the terminal by command
At this point if you want the newly installed Ubuntu, say in (hd0,6) which accidentally put Grub into the MBR, to have Grub inside its root partition you continue to typeCode:sudo su
grub
root (hd0,2)
setup (hd0)
Piece of cake, isn't it?Code:root (hd0,6)
setup (hd0,6)
If Ubuntu has nuked away a Lilo (and not Grub in the above example) in the MBR and you want your Lilo back, easy piece, just follow Task B3 of the "Just Booting tips".
Ok..... Can you explain exactly what these 2 lines do
root (hd0,6)
What does this do exactly
setup (hd0,6)
What does this do exactly.
I dont understand how it is putting the boot loader in the root.
The "root (hd0,6)" is to tell Grub the root filing system is in the 7th partition of the 1st disk. Grub counts from 0 so 1st disk is (hd0), 2nd disk (hd1) etc. For a partition we add a second digit. So 1st partition of 1st disk is (hd0,0). The 15th partition of the 2nd disk is (hd1,14).
The "root" command tells Grub which partition of which disk holds the operating system you wish to boot.
The "setup (hd0,6)" tells Grub to set up itself in (hd0,6). Since (hd0,6) is a partition therefore Grub will set up itself in the boot sector of the partition "formally", or in other word you install Grub in the root partition of (hd0,6).
When the partition number is missing Grub will say "Ah you want me to set up myself in the whole of disk (hd0) the only logical position is the MBR".
Grub can execute the above instructions as long as there is a /boot/grub directory in the root partition and inside it there is a set of Grub system files. The fact that you can invoke a Grub shell means all the necessary Grub systems will be there.
An example in a Grub shell
Outside the Grub shell my /boot/grub has these files insideCode:grub> root (hd0,13)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0,13)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0,13)"... failed (this is not fatal
)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,13)"... failed (this is not fatal
)
Running "install /boot/grub/stage1 (hd0,13) /boot/grub/stage2 p /boot/grub/men
u.lst "... succeeded
Done.
grub>
The files used by Grub to setup itself are coloured in red, pink and orange. The blue bits are the commands you have to enter.Code:ls /boot/grub
default fat_stage1_5 menu.lst stage1
device.map iso9660_stage1_5 minix_stage1_5 stage2
e2fs_stage1_5 jfs_stage1_5 reiserfs_stage1_5 xfs_stage1_5
root@saikee-Mint:/home/saikee#
For Red Hat distros, like Fedora, Grub's "root" command should be pointing to the /boot directory because a normal installation of this Linux is in multiple partitions involving possible a LVM too.
Maybe u could explain this one to me...
I installed a new linux on a new HD, installed boot loader to MBR (hd0). Then i put back my original boot loader from hd0,0 to hd0. So grub loads up and i have the option i created to boot the new linux (chainload). But it fails, i was getting grub 18 error, but now it just says GRUB with a flashing cursor, and u cant do anything.....
So i then configured grub to boot it directly, and it works! But i dont understand why i cant chainload it. Any idea to fix this?
Thanx
Grub can report Error 18 if an old version is asked to chainload a newer version.
The error should disappear if you use the newer one.
The current version is 0.97 and you should have no problem with it as the one in the MBR.
Hmmmm.... I am almost 100 percent sure that i had .97 in the MBR to begin with. And i assume that the grub on the UBUNTU live CD is .97 also.
Actually, i do remember a difference. One of them tells you the partition type, but the other one does not.... HMMM, i guess i will have to check again.
Thanx
Hi, i'm just registered, so 'Hello World!'
Thanks for the great post, i learn a lot of things!
Now i start to explain my grub problem:
I have a notebook(hp 6710s) with vista, and i would install Gentoo Linux from the minimal cd. The problem is hd that is pre-partitioned from hp: the first primary partition is for Vista, i resized it to make space for linux; the second primary partition is for restore; the third partition is for hp's tools.
So, I create a logical partition that is partitioned for swap, /boot, /
Most important thing is that i can't install grub into MBR because is modded from hp and if i erase it i can't restore Vista anymore (and this is a great problem because i don't have rescues cd and the restore partition is locked, so i can't make a install cd with vLite).
During Gentoo's installation when i install grub with the commands:
In my fstab file:Code:(chroot) Livecd #grub
grub> root (hd0,5)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0,5)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0,5)"... failed (this is not fatal
)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,5)"... failed (this is not fatal
)
Running "install /boot/grub/stage1 (hd0,5) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.
grub>quit
/dev/sda6 is the /boot partition (ext2)
/dev/sda5 is swap partition
/dev/sda7 is / partition (reiserfs)
This is my grub.conf:
After grub installation i reboot, but automatically start Vista without grub's prompt! :mad:Code:# Quale opzione viene avviata in modo predefinito. 0 è la prima, 1 la seconda, ecc.
default 0
# Quanti secondi attendere prima di avviare l'opzione predefinita.
timeout 30
# Un'immagine gradevole
# Da commentare se non si dispone di scheda grafica
splashimage=(hd0,5)/boot/grub/splash.xpm.gz
title=Gentoo Linux 2.6.22-r9
# La partizione dove si trova l'immagine del kernel (o il sistema operativo)
root (hd0,5)
kernel /boot/kernel-2.6.22-gentoo-r9 root=/dev/sda7
title=Gentoo Linux 2.6.22-r9 (rescue)
# Partizione dove si trova l'immagine del kernel o il sistema operativo
root (hd0,0)
kernel /boot/kernel-2.6.22-gentoo-r9 root=/dev/sda7 init=/bin/bb
# Le prossime tre righe vanno messe solo se si ha un dualboot con Windows.
# In questo caso, Windows è in /dev/hda6.
title=Windows Vista Home Premium
rootnoverify (hd0,0)
makeactive
chainloader +1
P.S. Sorry for my bad english but i'm italian :rolleyes:
00700,
Welcome to JustLinux !
Your command
put Grub in the root partition of (hd0,5) or sda6. This only works if you have another Grub in the MBR or (hd0).Code:grub> root (hd0,5)
grub> setup (hd0,5)
It appears to me you have only Gentoo Linux so you need to put it in the MBR. So try this
Take not on the red bits I omitted.Code:grub> root (hd0,5)
grub> setup (hd0)
It may not boot successfully if your menu.lst is faulty but at least you get a Grub screen now.
I opted for another solution:
I copied the boot sector of /dev/sd6 on a usb flash mounted before on /mnt/floppy with the command:
Then i have copied GentooBoot.bin in C:\Code:dd if=/dev/hda5 of=/mnt/floppy/GentooBoot.bin bs=512 count=1
Now i'm trying to use vista bootloader to add a menu item and load the boot sector; the syntax is something like this:
but this gives me an error:Code:bcdedit /create <Linux> /d "Gentoo-Linux" /application BOOTSECTOR path C:\GentooBoot.bin
Do you have any idea?Code:Impossible to find the specified file
Foot by foot i'm goin through!
ThenCode:bcdedit /create /d "Gentoo-Linux" /application BOOTSECTOR
The voice {d2634840-96c2-11dc-bf3c-0017a4e2e6c4} is correctly created
Now i try to reboot i hope that grub starts!Code:bcdedit /set {d2634840-96c2-11dc-bf3c-0017a4e2e6c4} device partition=C:
Operation complete.
bcdedit /set {d2634840-96c2-11dc-bf3c-0017a4e2e6c4} path \GentooBoot.bin
Operation complete.
The Vista's bcdedit is a pig to work with.
I got a feeling your current error may disappear if you drop the "c:" in front of "C:\GentooBoot.bin", leaving "\GentooBoot.bin".
You may like to take a look at this thread or Task E5 of "Just Booting tips" if you Vista still not booting the Linux.
I restarted but doesn't work...
DOH! I have spent a lot of time on reading Microsoft' documentation when the perfect solution was under my eyes!
Doesn't matter, i have learned how vista bootmanager work! :-D
Thanks for your guides, they are very usefull!
The only difference from the guide is that as device i put C: instead boot, but now i have corretted the command and i try to reboot another time! :cool:
EDIT: YEAH! It works! Thanks Thanks Thanks!!! ;)