View Single Post
Old 12-14-2007, 10:14 AM   #9
Ray Jones
[armleglegarmhead]
 
Ray Jones's Avatar
 
Join Date: Jun 2003
Location: digital
Posts: 8,188
10 year veteran! LF Jester Helpful! Forum Veteran 
Quote:
Originally Posted by Astrotoy7
>how do you launch linux with no bootloader
You mean install? Easy, usually every distro's installer asks you whether to install GRUB/LILO/nothing.


Quote:
>will this launch into linux by default , how can you change the default OS
No, it will not lauch linux at all.

Two ways, change the order of OS entries in the menu.lst file, or change [number] in the default [number] line in the menu.lst (starts counting at 0) to select your preferred entry. It is also possible to always select the last booted entry, have a default entry in case of system failure.


Quote:
>what distros will it work on. eg. any that use GRUB, like ubuntu
Let's say, expect it to do so. ^^


Quote:
>How exactly do you get to/edit the menu.lst file
Windows? It should be in C:\boot\grub\, complete with nice commentary for the unknowing.


Quote:
>what are you meant to be looking for when you say "take note of the contents of /boot" can you give an example
When you've installed Linux, the kernel and initrd files are in /boot, to list it's contents grab a console and type
ls -al /boot. It should give you something like my crap SuSE Linux at work does
Code:
drwxr-xr-x  3 root root    4096 11. Okt 08:33 .
drwxr-xr-x 22 root root    4096 14. Dez 09:47 ..
-rw-------  1 root root     512 12. Dez 2006  backup_mbr
lrwxrwxrwx  1 root root       1 12. Dez 2006  boot -> .
-rw-r--r--  1 root root   64134  3. Okt 01:49 config-2.6.18.8-0.7-default
drwxr-xr-x  2 root root    4096 11. Okt 08:33 grub
lrwxrwxrwx  1 root root      27 11. Okt 08:33 initrd -> initrd-2.6.18.8-0.7-default
-rw-r--r--  1 root root 3151967 11. Okt 08:33 initrd-2.6.18.8-0.7-default
-rw-r--r--  1 root root  369152  9. Mai 2007  message
-rw-r--r--  1 root root   86462  3. Okt 01:51 symsets-2.6.18.8-0.7-default.tar.gz
-rw-r--r--  1 root root  338740  3. Okt 01:51 symtypes-2.6.18.8-0.7-default.gz
-rw-r--r--  1 root root   99320  3. Okt 01:51 symvers-2.6.18.8-0.7-default.gz
-rw-r--r--  1 root root  954130  3. Okt 01:43 System.map-2.6.18.8-0.7-default
-rwxr-xr-x  1 root root 2114978  3. Okt 01:49 vmlinux-2.6.18.8-0.7-default.gz
lrwxrwxrwx  1 root root      28 11. Okt 08:32 vmlinuz -> vmlinuz-2.6.18.8-0.7-default
-rw-r--r--  1 root root 1618384  3. Okt 01:44 vmlinuz-2.6.18.8-0.7-default
We're interested in the vmlinuz* and initrd* files (with vmlinuz being the kernel image, and initrd being something like just more awesome to make your kernel happy). So what yo must take note of is the names of the vmlinuz/initrd files you would like to boot into.

In that example we want vmlinuz-2.6.18.8-0.7-default and initrd-2.6.18.8-0.7-default so the menu.lst lines would be something like
Code:
title openSUSE 10.2 - 2.6.18.8-0.7
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.18.8-0.7-default
    initrd /boot/initrd-2.6.18.8-0.7-default
The root line simply tells GRUB which (harddrive,partition) and boot directory to use.

For a complete documentation of GRUB and the menu.lst, you should consider reading the GRUB manual, 'cause I don't feel like copy&paste.

Hint:
In the directory listing above you may notice some lines starting with an "l".
These are actually links pointing at some file, in this case vmlinuz/initrd are pointing to the actual kernel/initrd (and are changed accordingly with any kernel update/install). This a common technique in Linux, so you can actually almost rely on that. An almost idiot proof menu.lst entry would be
Code:
title 
    root (hd0,1)
    kernel /boot/vmlinuz
    initrd /boot/initrd
But remember this will always attempt boot the last installed kernel version.


Quote:
>what are the advantages of doing it this way
In jay's case, it downloads porn. In my case too, but different porn. Also, you can painlessly configure it to boot from USB stick or HDD, or to download even moar porn for you. And you can edit the menu entries while in the boot menu, so basically typos won't render your system unbootable. It's theme-able. And yes, there are GUIs available to manage GRUB.





PUBLIC SERVICE ANNOUNCEMENT


Whenever you install (a "native" Linux) GRUB onto some harddisk, just make sure you do not install GRUB onto some partition, but always into the MBR of the HDD itself.

Most distro's installers I know do ask where to install GRUB and the default choice is often the correct one (except you want to boot from an USB HDD or whatever). This is what cause much trouble when not done so (I must know ^^). The point is that way you make sure you do not overwrite any bootsectors of any partition of that HDD, and thus you make sure any possible Windows installation has everything it wants where it needs it on its partition.

When you keep that in mind, it almost does not matter what you do install first, Linux, Windows, err DOS?

However, the critical thing *is* the MBR. The MBR basically contains nothing but info about where to go first. (And in case you install GRUB there, GRUB too)
It is simply the very first sector of any drive out there. Every HDD and PC goes and looks into the MBR where to go next.


Anyway, in case you want to get rid of (Linux') GRUB, there are several ways to accomplish this, one is using a Windows XP installation CD, its rescue mode (A CONSOLE btw), and the FIXMBR command. Or you can backup that MBR in Linux *before* installing GRUB, for a later restore.

In case you want to reinstall GRUB, just take some Linux Live/Install CD and do what the GRUB manual tells you.



Last edited by Ray Jones; 12-14-2007 at 10:46 AM.
Ray Jones is offline   you may: quote & reply,