Solved

Linux won't boot from HDD

Posted on 1998-12-05
28
393 Views
Last Modified: 2013-12-15
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.
0
Comment
Question by:Theophilus
  • 13
  • 8
  • 3
  • +2
28 Comments
 

Expert Comment

by:ercann
ID: 1631790
Do you configure your Lilo. if not run liloconfig
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631791
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.
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631792
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
0
 

Expert Comment

by:ercann
ID: 1631793
The liloconfig is in /shbin
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631794
'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.
0
 
LVL 3

Expert Comment

by:mhomann
ID: 1631795
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...

0
 

Expert Comment

by:ercann
ID: 1631796
Try to run e2fsck.



P.S I run slackware on my box.
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631797
mhomann

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

Author Comment

by:Theophilus
ID: 1631798
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        
0
 
LVL 1

Accepted Solution

by:
talwyn earned 250 total points
ID: 1631799
Ok, First lets check your  Lilo.conf file .
          it should be in your /etc directory if it exits.
           Also check to see if you have lilo in /sbin or in                /usr/sbin  

  If you don't have Lilo  and you do have a Dos partition  let me know .. you will use loadlin instead.  I can help you with that too  but its rarer so the info below is for Lilo and how to configure it by hand.          


Inside /etc/lilo.conf should have some info like this:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/sda
#compact        # faster, but won't work on all systems.
delay = 50
vga = normal    # force sane state
append = "ether=10,0x300,eth0 ether=5,0x210,eth1"
# ramdisk = 0     # paranoia setting
# End LILO global section
# Linux bootable partition config begins
image = /vmlinuz.233
  root = /dev/sda1
  label = linux-new
  read-only

# DOS bootable partition config begins
other = /dev/sdb1
  label = DOS
  loader = /boot/any_d.b
  table = /dev/sdb
# DOS bootable partition config ends
#-------------------------End of Lilo.Conf-------------
     
     
If  lilo exists but lilo.conf does not create a text file from the above ... ( you will need to put in the proper device names and you probably don't need but one section.  

locate a kernel image .. there should be one in your / directory it is usually named vmlinuz.  if there isn't one ... compile your kernel with a 'make zImage' and rename the image vmlinuz and put it in /

  Now  so far you should have a  lilo.conf in /etc and a vmlinuz in /   if this is true go to the directory containing the lilo program.   run lilo

 it should ouptput something like

 * added linux-new
 * added DOS

 (Note I use two ethernet cards you should comment or erase the "append ="

Ok at this point Lilo has created a new boot sector ... it has saved the old one in  /boot/boot.NNNN  wher NNNN can be the device (like sda1) .  Go ahead and reboot the machine ... You should see  the letters LILO appear  and a brief pause and the boot disk will be started.  

  If this does not work re-boot from your linux floppy change to the directory with lilo and run lilo -u to restore your existing boot sector.  Let me know if this happens.

           --Talwyn


0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631800
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)).
0
 
LVL 1

Expert Comment

by:talwyn
ID: 1631801
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
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631802
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.
0
 
LVL 3

Expert Comment

by:mhomann
ID: 1631803
try without that 'linear' keyword...
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 1

Expert Comment

by:talwyn
ID: 1631804
 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  

0
 
LVL 1

Expert Comment

by:talwyn
ID: 1631805
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
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631806
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.


0
 
LVL 1

Expert Comment

by:talwyn
ID: 1631807
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
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631808
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.


0
 
LVL 1

Expert Comment

by:talwyn
ID: 1631809
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
0
 

Expert Comment

by:raslan
ID: 1631810
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
0
 

Expert Comment

by:raslan
ID: 1631811
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
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631812
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.
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631813
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.
0
 
LVL 1

Expert Comment

by:talwyn
ID: 1631814
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
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631815
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.
0
 
LVL 1

Author Comment

by:Theophilus
ID: 1631816
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).
0
 
LVL 1

Expert Comment

by:talwyn
ID: 1631817
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now