Link to home
Start Free TrialLog in
Avatar of Theophilus
Theophilus

asked on

Linux won't boot from HDD

I have a computer with one HDD running only Linux. When I boot from floppy everything works ok (although it takes forever) but when I try to boot from the hard disk my screen fills with an endless series of 0's (zeros). Does anybody have any idea how to fix this? Any help would be appreciated.
Avatar of ercann
ercann

Do you configure your Lilo. if not run liloconfig
Avatar of Theophilus

ASKER

I'm afraid there's nothing called liloconfig on my computer. I logged in as root and typed cd / then find -name liloconfig -print with no results.
In the setup program (yast) there's the option of configuring lilo. The setup there is as follows:

lilo is installed to the master boot record
boot delay is 1
linear option is checked
The liloconfig is in /shbin
'Fraid not. No such directory (I have sbin though, but no liloconfig there). Maybe it would help if I told you which distribution I have (I should have done that originaly). I have S.u.S.E. 5.2.0-5.
with SuSE, its quite easy:
1. log in as root
2. start yast
3. System Administration->Kernel and bootconfiguration->LILO configuration

there you are! here you can set up LILO, which is needed for booting from harddisk...

Try to run e2fsck.



P.S I run slackware on my box.
mhomann

I've already done that (see my previous comment for how it is set up).
ercann

I ran e2fsck like you suggested and it found some errors. It said it fixed it but I still have the same problem booting from HDD. Here's part of the output from e2fsck if it might help. (no problems were reported up to this point)

Pass 5: Checking group summary information
Fix summary information<y>? yes

Block bitmap differences: -4912 -4913 -4914 -4915 -4916 -60118 -60119 -60120 -60
121 -60122 -60123 -60124 -91461 -91462 -91463 -91464 -91465 -91466 -91467 -34529
1 -345292 -345293 -345294 -345295 -345296 -345297 -348033 -348034 -348035 -34803
6 -348037 -348038 -354443 -354444 -354445 -354446 -354447 -354448 -354449.  FIXE
D
Free blocks count wrong for group 0 (3245, counted=3250).  FIXED
Free blocks count wrong for group 7 (5321, counted=5328).  FIXED
Free blocks count wrong for group 11 (6101, counted=6108).  FIXED
Free blocks count wrong for group 42 (5916, counted=5929).  FIXED
Free blocks count wrong for group 43 (5147, counted=5154).  FIXED
Free blocks count wrong (312497, counted=312536).  FIXED        
ASKER CERTIFIED SOLUTION
Avatar of talwyn
talwyn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't have a DOS partition.
lilo is in /sbin
vmlinuz is in /
lilo.conf is in /etc and looks like this


# LILO Konfigurations-Datei
# Start LILO global Section
append="reserve=0x300 ether=4,0x300,eth0"
boot=/dev/hda
#compact        # faster, but won't work on all systems.
linear
read-only
prompt
timeout=10
vga = normal    # force sane state
# End LILO global section
#
# Linux bootable partition config begins
image = /vmlinuz
root = /dev/hda1
label = Linux
# Linux bootable partition config ends

I ran lilo and got the output "Added Linux".

I rebooted and got L000000000000000 (ad infinitum)

I might also add (in case it makes a difference) that I installed Lilo to the Master Boot Record. I have 2 partitions (/ (about 500MB) and swap (about 20MB)).
HMM,  You are using linear I see and it still did not work. Ok this means one of a couple of things is wrong

           a) your partition is not marked active
                (go back and check if it isn't then make it                       active)

          B) The L0000000 error may indicate a problem with the              System map file which may need to be regenerated.

            C) The L0000 may indicate that your bios is not reporting the correct disk geometry to LiLO.  Go into your Motherboard's Setup or to your Harddisk manual and get the information for the
    Heads
    Cylinders
    Sectors

   In your liloconfig add these options as listed below  substitute the numbers for the ??:



-------------------------------------------------------------
       # LILO Konfigurations-Datei
       # Start LILO global Section
       append="reserve=0x300 ether=4,0x300,eth0"
       boot=/dev/hda
       #compact        # faster, but won't work on all systems.
       linear        
     
       bios=0x80        #
       sectors = ??     #
       heads   = ??     #  Add these options.
       cylinders=????   #
       read-only      
       #prompt          #You only have Linux why wait?
       timeout=10
       vga = normal    # force sane state
       # End LILO global section
       #
       # Linux bootable partition config begins
       image = /vmlinuz
       root = /dev/hda1
       label = Linux
       # Linux bootable partition config ends
----------------------------------------------------------------


  After editing re-run lilo which should then add Linux again.
Reboot the system.  Let me know how LILO responds. There is a verbose mode we can use to get more info if it still isn't working.

   -Talwyn
Bootable? Well.... er.... actualy.... no (*blush*). (It is now though)

Hmmm.... here's something interesting... The lable on my drive says

1050 Cylenders
16 Heads
63 Sectors / Track

but the setup program reports

Fdisk detected the following hard drive geometry:                            
Disk /dev/hda 32 Heads 63 Sectors 525 Cylinders.                
One cylinder has 1032192 Bytes.                

The setup program reports twice the number of heads but half the number of cylenders (same result?).

I tried inserting the code you suggested with the numbers above (63, 16, 1050) but when I ran lilo it gave me an error message "Syntax error near line ## in file /etc/lilo.conf" with ## being the number of the first line of code I inserted. I commented them out one at a time but the number just moved to the next line. Here's what my lilo.conf looked like after editing:

# LILO Konfigurations-Datei
# Start LILO global Section
append="reserve=0x300 ether=4,0x300,eth0"
boot=/dev/hda
#compact        # faster, but won't work on all systems.
linear

#Added at Talwyns suggestion
#
bios=0x80
sectors = 63
heads = 16
cylinders = 1050
#
#End Talwyns suggestion

read-only
#prompt
timeout=10
vga = normal    # force sane state
# End LILO global section
#
# Linux bootable partition config begins
image = /vmlinuz
root = /dev/hda1
label = Linux
# Linux bootable partition config ends
#

So I commented all the lines out and ran lilo then rebooted to see if making the partition bootable would be enough. It wasn't.

Is the system map file you mentioned /boot/map? How do I regenerate it? (Unfortunatly the file /usr/doc/support-db/sdb/system_map.html is in German.)

Oh, btw, it probably doesn't matter but if it might give you a clue, what I get isn't actualy L000000 but L 00 00 00.
try without that 'linear' keyword...
 Oops I forgot a line.

You should add:

  disk = /dev/hba
   bios = 0x80
   sectors =63
   heads = 16
   cylinders = 1050


You can also  specify an option
  Verbose = 3

This will hopefully give us a little more information to work with.

Another thing to check out:

       In your CMOS setup program there may exist an option for translation for DOS operating systems.  What this does is changes the # cylinders to be less than 1024 and increases the # heads until an equivalent capacity can be reached.   You can turn this option off if it exists since Linux accesses the drive directly.
 
                         --Talwyn  

Also  be sure to re-run  the lilo program after editing and before you reboot.  If you don't your changes don't get saved to the boot sector.

           --Talwyn
I added the extra line (disk=/dev/hda) ran lilo and it went ok (added lilo *). I rebooted but same problem.

I ran lilo -v -v -v (is that what you meant by verbose=3?). The output scrolled way off the top of the screen so I did it again and redirected it into a file. This is (in part) what I got.

Caching device /dev/hda (0x0300)
Caching device /dev/hda1 (0x0301)
Caching device /dev/hda2 (0x0302)

.

Caching device /dev/sdb6 (0x0816)
Caching device /dev/sdb7 (0x0817)
Caching device /dev/sdb8 (0x0818)
Reading boot sector from /dev/hda
Merging with /boot/boot.b
Device 0x0301: BIOS drive 0x80, 16 heads, 1050 cylinders,
               63 sectors. Partition offset: 63 sectors.
Secondary loader: 8 sectors.
Device 0x0301: BIOS drive 0x80, 16 heads, 1050 cylinders,
               63 sectors. Partition offset: 63 sectors.
Boot image: /vmlinuz
Device 0x0301: BIOS drive 0x80, 16 heads, 1050 cylinders,
               63 sectors. Partition offset: 63 sectors.
Setup length is 9 sectors.
Mapped 1038 sectors.
Added Linux *
    <dev=0xc0,hd=5,cyl=249,sct=76>
    "ro root=301 reserve=0x300 ether=4,0x300,eth0"
/boot/boot.0300 exists - no backup copy made.
Map file size: 9216 bytes.
Writing boot sector.

Even though lilo reports 1050 cylinders, fdisk still reports 525.

CMOS reports 1050 cylenders, 16 heads.


Actually I meant  for you to add a line to lilo.conf
 verbose = 3

;)

  There is a possibility that you may need to re-partion and format your drive.  The reason this is a possibility is that the drive geometry appears to reported to Linux as if it were a DOS system.  If you can set LBA or PIO mode > 0  on your IDE controller this may help.  

  after you add the line to lilo.conf  re-run lilo and then reboot.  Note down any new info besides L00000
 
        --Talwyn
The -v -v -v option seems to have the same effect as adding verbose= 3 to lilo.conf when I run lilo. ( I found the -v -v -v option in the man page for lilo. )

 The computer I am using is an old Ambra 486 and isn't exactly what you could call standard.  The CMOS setup doesn't allow me to set LBA. (I'm not sure whether that's because it's an Ambra or because it's so old.) I added the line you suggested and rebooted.  A lot of information scrolled past rather quickly so I probably didn't catch everything but I didn't notice anything special. (No error messages and it seemed to detect the drive properly.)

 I would prefer not to have to format my drive and reinstall everything but I will if I have to.  Before I do, maybe you could tell me what should be looking for.


Hmm, well I was trying to see if there was any info on what lilo was seeing upon boot-up.

   You say that you have an old 486 does it see the whole of your drive or only part of it?

  What happens if you set lilo's geometry to the numbers reported by fdisk?  Maybe we can match the existing geometry.

disk = /dev/hba
         bios = 0x80
         sectors =63
         heads = 32
         cylinders = 525

Were you able to find anything about Harddrive translation in your CMOS?

          --Talwyn
ok
i had the same problem and i solved it

first u should reinstall linux but this time the right way
u have to make the following partitions in order:
/boot --------------->only for booting 50 mb
/ ------------------->only for root 80 mb
swap -----------------> 100 mb
/usr -----------------> more than 600 mb
/usr/local ------------->optional
/tmp ---------------->50mb
/home -------------> as many as u like depend on how many users

u should install lilo on the master boot record

ok

        i hope it works
ok
i had the same problem and i solved it

first u should reinstall linux but this time the right way
u have to make the following partitions in order:
/boot --------------->only for booting 50 mb
/ ------------------->only for root 80 mb
swap -----------------> 100 mb
/usr -----------------> more than 600 mb
/usr/local ------------->optional
/tmp ---------------->50mb
/home -------------> as many as u like depend on how many users

u should install lilo on the master boot record

ok

        i hope it works
Talwyn:

Actually I'm not quite sure about the size of my drive. When I bought it, I was told that it was 540  megabytes. Fdisk seems to think that it is 525. The BIOS says that it is 516.It used to be in another computer and it detected the entire 540 megabytes at bootup.  This computer however, doesn't report the size of the disk. ( By the way, how can I find out how much free space  there is  left on my disk? )

I changed the number of heads and sectors and ran lilo. The output was unchanged except for the number of heads and sectors. I rebooted but with the same result.

The CMOS setup is very limited. Nothing about LBA or such. Just the system time, the hard disk geometry and a couple of other things.
raslan:

I probably will have to reformat the disk and reinstall Linux and I will probably partition it similar to what you say. However, it may be difficult to have 600 megabytes for /usr since I only have a total of 525 megabytes.
Theophilus, at the command line type df  this will print the mounted filesystems size and the amount of freespace.


  As far as your HD geometry goes it would seem that a re-install may be needed.   One more thing ... does your CMOS have a IDE auto-configuration option?   Try running it and see how it reports your disk.  

  If you re-install  make sure when you re-partition that it agrees with the settings in CMOS.  

   You may be limited to 504 Megs on your 486 if this is the case set  CMOS to 1024 cylinders 16 heads and 63 sectors.  Set Lilo to the same specs after re-partitioning. Install Lilo to the Boot Block.
                  --Talwyn
Well, at least something different happened this time. I reinstalled Linux. When the setup program finished it rebooted - from the hard disk! And it went ok.

But I only have one keyboard and one moniter to share between two computers. To see if the network was working I changed to the Win95 computer (bad idea, I know, but what am I to do? I can't afford another moniter.) and when I changed back, the Linux computer wouldn't respond to the keyboard. I was forced to shut it off and reboot without being able to do a shutdown first. When it rebooted I had the same problem back again :(

I am going to try reinstalling it again and see what happens.
I finaly got around to reinstalling Linux. When the installation program finishes, it says it has to reboot to commit the installation. I removed the floppy before hitting return to continue and it booted from the hdd with no problem. It then asked me to configure a couple more things and rebooted again. Again without any problem. Then I logged in as root and did a reboot and got the same problem again.

I recently bought my first copy of Linux Journal (December issue) and it had a letter from a reader that describes a problem similar to mine.

"... One embarrassing problem for me lately has been the need to boot from floppy, because a hard drive was too large for my BIOS and I couldn't configure LILO properly. A recent response to another reader in the 'Best of Tech Support' column supplied my answer, and now it boots fine.

The technician who installed the drive under Windows 95 had to shorten it to accommodate the BIOS and Windows 95..."

I've looked for the article mentioned on the 'Net but haven't found it yet. It seems to be the same problem since my drive is to big for DOS (540 MB).
Well, what you have to do is format it for 504 megabytes.

You must re-install ALL parttions.

  use the following in CMOS

    1024 cylinders, 16 heads and 63 sectors.

in lilo use the disk subsection with the same settings.

re-install windows if you are using it then install Linux.

 
   This should take care of the problem....

  Possible when you rebooted as root lilo.conf got re-written.  


  I never made a lilo boot floppy but it sounds like you may need one.  try changing permisions on  lilo.conf

  chmod  a -wx  lilo.conf

this should leave
 
    r--r--r--  as permissions on the file.  
and hopefully will keep it safe.