Re: GRUB as afterthought to install
Conrad Newton <conrad.newton-gyXR7Lt7FVk/[email protected]>
| Newsgroups | gmane.linux.debian.knoppix |
|---|---|
| Message-ID | <[email protected]> |
From Philip Jones on Sunday, 2004-03-21 at 16:52:07 -0500: > Newbie dilemma: I have a Dell box with a 56-gig HD running Windows XP. I > have successfully added a second HD, 40 gig, on which I have installed > Linux from the Knoppix CD. > > I was unprepared for the questions asked of me in the install, but > thought at least that I would be prompted to choose between LILO and > GRUB. Various things I have read made me think I'd like GRUB better, but > I never saw it offered as a bootloader. So apparently I didn't load LILO > either, and am only able to run Linux by booting from the Knoppix CD. > (When I do, though, I can see that my new hard drive does contain the > Linux files.) I tried booting from the boot disk I made during the > install, but was told it was not valid. > > Can I go back and install GRUB now without starting from scratch on the > Knoppix install? Do I have to accept LILO first and then replace it with > GRUB? As you say, there are several ways to do it. If you want a GRUB-only solution, boot the Knoppix CD and make a grub floppy: /sbin/grub-install '(fd0)' After that, you can use the floppy to boot into your hard disk Knoppix installation, but you will have to use the grub command line. You do that as follows: When grub first starts, choose the 'c' option (for "command line"). You then have a prompt on which to write the following lines: kernel (hd1,0)/vmlinuz root=/dev/hdb1 knoppix lang=us followed maybe by initrd (hd1,0)/boot/initrd.gz and boot Here I have assumed that Knoppix is installed on the first partition of the second hard disk, identified alternatively by the variables /dev/hdb1 or in GRUB-speak (hd1,0). (GRUB starts counting variables at 0 instead of 1 or a). Whether you have an initrd line or not depends on how you did the install. "Knoppix style" uses ext2 and no initrd, "Debian style" uses a journaled file system plus initrd. If you are unsure, you will have to try with and without the initrd line. Once you have done all that, it is time to make a grub configuration file on the Knoppix hard disk. The configuration information is stored in /boot/grub/menu.lst I append the file from my system: you may alter it to suit your purposes. In my configuration file, I refer to a Knoppix derivative called "Snofrix". The Snofrix line corresponds to your Knoppix hard disk installation, except that mine is installed on the third partition of the first hard disk (/dev/hda3 or (hd0,2)). You will notice that I have commented out the initrd line that follows Snofrix, but you will perhaps need it, if you needed it to boot into Knoppix on your system. Finally, to install grub to the master boot record, you need to issue the command /sbin/grub-install '(hd0)' Conrad
menu.lst
(text/plain, 1.1 KB)
# grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You do not have a /boot partition. This means that # all kernel and initrd paths are relative to /, eg. # root (hd0,1) # kernel /boot/vmlinuz-version ro root=/dev/hda2 # initrd /boot/initrd-version.img #boot=/dev/hda default=3 timeout=10 color black/green red/green i18n (hd0,1)/boot/grub/messages keytable (hd0,1)/boot/us-latin1.klt #splashimage=(hd0,6)/boot/grub/splash.xpm.gz title Windows 98 root (hd0,0) makeactive chainloader +1 title Mandrake 8.2 (2.4.18-6mdk) root (hd0,1) kernel /boot/vmlinuz-2.4.18-6mdk root=/dev/hda2 devfs=mount initrd /boot/initrd-2.4.18-6mdk.img title Snofrix 2004-03-15 (2.4.22-xfs) kernel (hd0,2)/boot/vmlinuz root=/dev/hda3 knoppix lang=nb utc screen=800x600 hdc=ide-scsi hdd=ide-scsi #initrd (hd0,2)/boot/initrd.gz title Debian Stable (2.4.18-bf2.4) kernel (hd0,7)/boot/vmlinuz-2.4.18-bf2.4 root=/dev/hda8 #initrd (hd0,7)/initrd.img # # To install: /sbin/grub-install '(fd0)' # or: /sbin/grub-install '(hd0)'