Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
Hello, So I am stuck in the bootloader hell. With a vintage PC Ok, so here's the setup: There is one HDD, with two primary partitions: 1st for the system, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    28

    [SOLVED] Manual GRUB install for screwed up Luit Linux install


    Hello,

    So I am stuck in the bootloader hell. With a vintage PC

    Ok, so here's the setup:
    There is one HDD, with two primary partitions: 1st for the system, 2nd for the swap. I booted Luit Linux Live CD, and ran it's HDD install script. The Luit Linux is based on Damn Small Linux that uses kernel version 2.4.22. For some reason, it's bootloader LILO install did something wrong and the fresh install wouldn't boot: at boot does this:

    Code:
    GRUB Loading stage1.5.
    GRUB loading, please wait...
    Error 15
    By the way, I don't understand why the bootloader texts refer to GRUB, while the install script definitely was installing LILO.

    I can now boot again with that same Live CD (or any other CD that would boot to Linux), and once loaded, mount the hard disk and check and update it's contents. I'd like to install there as up-to-date GRUB version what that ancient hardware (48MB RAM) can take, and then configure the GRUB to load that install that's sitting on the hdd.

    I will be very grateful for any advice. Unfortunately my knowledge of things like GRUB is very poor, so it's difficult to look up advice by searching the internet.

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    LILO sometimes has trouble overwriting GRUB if it still resides on the MBR.

    You can clear the master boot record only, leaving partition tables alone by going to a terminal and running the following command:

    Code:
    dd if=/dev/zero of=/dev/sda bs=446 count=1
    You can run the above command using a liveCD if need be. If you use sudo, put sudo in front of the command. Don't forget that you'll need to run the lilo command before rebooting, and you can read more about LILO options that are available by running man lilo from the terminal.


    Edit: I just reread your post and might be confused. Are you wanting to keep GRUB, or install LILO?
    Last edited by oz; 04-16-2010 at 09:49 PM.
    oz

  3. #3
    Just Joined!
    Join Date
    Apr 2010
    Posts
    28
    Yes, I'd like to install GRUB instead, I like it's configuration better, and also functionality. There is no GRUB install included in the Luit Linux distribution, but I hope that does not mean that it is not possible to use GRUB to load Luit Linux. From what I understand, all what GRUB cares about is that it can access it's stage files and the menu config file. So, if I'd manage to install it properly (ie, load the MBR with the right stuff, and let the GRUB install create the stage files in the right place, and then write correct config file) then that would be wonderful.

    Regarding your reply, how would cleaning the MBR solve the problem in any context?

  4. $spacer_open
    $spacer_close
  5. #4
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Quote Originally Posted by Passiday View Post
    Yes, I'd like to install GRUB instead, I like it's configuration better, and also functionality. There is no GRUB install included in the Luit Linux distribution, but I hope that does not mean that it is not possible to use GRUB to load Luit Linux.
    If Luit is based on DSL, you can probably use the DSL Wiki page to easily install GRUB:

    Installing Grub - DSL Wiki

    Quote Originally Posted by Passiday View Post
    Regarding your reply, how would cleaning the MBR solve the problem in any context?
    I thought you were trying to install LILO to the MBR, but sometimes LILO and GRUB can conflict, so I was thinking that having no bootloader residing on the MBR would make things easier. Hopefully, the GRUB HowTo above will help you to get GRUB installed and you'll be up and running. It's been years since I last ran DSL and I've never heard of Luit until you posted about it, so I'm just guessing the HowTo might work with Luit. If it doesn't, you should be able to install GRUB from source if there isn't a GRUB package for Luit and a package tool for installing it.
    oz

  6. #5
    Just Joined!
    Join Date
    Apr 2010
    Posts
    28
    Ok, so I used the tutorial (www:damnsmalllinux:org/wiki/index.php/Installing_Grub)

    The site from where this tutorial suggests to download GRUB floppy/CD image, is dead, so I had to choose another option - Super GRUB Disk. I hope that's correct alternative to what is supposed to be used in that tutorial.

    Now, when I boot the Super GRUB disk (based on GNU GRUB version 1.97.2), I really see no place where those GRUB commands that the tutorial teaches could be entered: I am presented with a menu, then I can type Ctrl+e to get to manual command entry mode, or Ctrl+c to get to the command line (prompt is sh:grub>). At no place I could enter something like

    Code:
    title Luit Linux
    root (hd0,0)
    kernel /boot/vmlinuz-2.4.22-xfs
    makeactive
    boot
    and boot. So from what I understand, the tutorial uses other type of GRUB.

    I tried to search up anything that tells what commands are for sh:grub prompt, but there seems to be very poor information on this.

    The best thing I could master, was this:
    Code:
    sh:grub> linux (hd0,1)/boot/vmlinuz-2.4.22-xfs root=/dev/hda1
       [Linux-bzImage, setup=0x1400, size=0xdf9e4]
    sh:grub> boot
    Uncompressing linux... <some quick message that I coulnd't read>
    ... and then my PC rebooted. Perhaps I'm entering bad commands or bad parameters, I have no idea.

    Well, either I need to get another bootable GRUB (any suggestions?), with a version that has better online reference, or someone should teach me how to boot with this sh:grub what I have. Once I will get that existing linux to boot, only then I can start looking for ways how to actually install it from there. That is, unless there is some way how to boot with LiveCD and then do some witchcraft in order to install GRUB to the HDD.

  7. #6
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    I'm assuming that you are installing the older version of GRUB, now known as GRUB Legacy, and not the newer GRUB2. With either of them, keep in mind that you first install the GRUB package to your system, then you'll install GRUB to the MBR.

    The GRUB (Legacy) Manual has step by step instructions with a couple of methods for installing it to the MBR:

    GNU GRUB Manual 0.97

    The best tutorial that I've found for working with GRUB is this one:

    GRUB bootloader - Full tutorial

    They have a link there for the GRUB2 Tutorial if you want to use that version, but I'd recommend sticking with the older GRUB for now.

    The SuperGRUB disk that you mentioned should also be able to install GRUB, but you have to be careful there because they have both, GRUB Legacy and GRUB2 downloads available. SuperGRUB Disk downloads constructed from Legacy can be found here:

    Index of /Super_Grub_Disk/download/binaries/sgd
    oz

  8. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Could you post the partition structure of your Hard disk and contents of /boot/grub/grub.conf file here?
    Boot up from LiveCD of any Linux distro and execute fdisk -l command in Terminal.
    Code:
    su -
    /sbin/fdisk -l
    Post output here.

    * Its small L in fdisk -l.

    You have to mount / partition in LiveCD to copy contents of its /boot/grub/grub.conf file.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #8
    Linux User
    Join Date
    Dec 2007
    Location
    Idaho USA
    Posts
    362
    Now, when I boot the Super GRUB disk (based on GNU GRUB version 1.97.2)
    That version is grub2. grub legacy should be version .97, If I'm to wrong.

  10. #9
    Just Joined!
    Join Date
    Apr 2010
    Posts
    28
    Oh, wow, three replies! This gives me hope I will be able to fix that poor gear for my kids.

    Ozar:
    I'm assuming that you are installing the older version of GRUB, now known as GRUB Legacy, and not the newer GRUB2. With either of them, keep in mind that you first install the GRUB package to your system, then you'll install GRUB to the MBR.
    I haven't got to that point yet. I have boot-broken HDD install, but I can boot Luit Linux LiveCD and do whatever is needed. But I don't feel safe (perhaps superstition) with that setup - when the active OS is in fact loaded in ramdrive, but I need to install the bootloader on the HDD, what the LiveCD-booted OS doesn't use at all. This is why I hoped to boot with some GRUB CD boot disk and then make manual configuration to boot the install that's there on HDD.

    Ok, so I set forth and burned another Super Grub Disc, this time it's based on GNU GRUB version 0.97-os.1 it's syntanx really matches the one used in the tutorial that I referred to above.

    So, I entered the commands:
    Code:
    root (hd0,0)
    kernel /boot/vmlinuz-2.4.22-xfs
    makeactive
    boot
    And, it got much futher than the previous time. Lot's of messages scrolling bye, but the last ones are errors:
    Code:
    hda6: bad access: block=2, count=2
    end_request: I/O error, dev 03:06 (hda), sector 2
    EXT2-fs: unable to read superblock
    hda6: bad access: block=0, count=1
    end_request: I/O error, dev 03:06 (hda), sector 0
    FAT: unable to read boot sector
    hda6: bad access: block=64, count=2
    end_request: I/O error, dev 03:06 (hda), sector 64
    isofs_read_super: bread failed, dev=03:06, iso_blknum=16, block=32
    Kernel panic: VFS: Unable to mount root fs on 03:06
    It's interesting how it refers to hda6, while I have one just hard disk with two simple primary partitions: one for system, other for swap.

    So I am stuck with this particular plan for now, until I am pointed to the right direction.

    devils casper:
    Could you post the partition structure of your Hard disk and contents of /boot/grub/grub.conf file here?
    Here's my partition structure:
    Code:
    Device    Boot Start End  Blocks   Id System
    /dev/hda1  *      1  477  1923232+ 83 Linux
    /dev/hda2       478  525   193536  82 Linux swap
    Regarding the grub.conf file, there is none. Originally the Luit Linux comes with LILO, and, at least for my hardware, the LILO install script fails. But, for the reference, here is the list of files in /boot:
    Code:
    System.map [symbolic link to the file below]
    System.map-2.4.22-xfs
    boot.0300
    config-2.4.22-xfs
    vmlinuz [symbolic link to the file below]
    vmlinuz-2.4.22-xfs
    I don't know, perhaps I really should swipe the MBR clean... And then try to install the GRUB on HDD from within LiveCD, if this manual GRUB setup at boot-time proves to be sooo hard.

  11. #10
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Create /boot/grub/grub.conf file manually.
    Code:
    default=0
    timeout=10
    
    title Linux
    root (hd0,0)
    kernel  /boot/vmlinuz root=/dev/hda1 ro
    Save file and reboot machine. GRUB Menu should appear at startup and Linux will boot up fine.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •