Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help in resolving Partition issues 2

Status
Not open for further replies.

ifxtechie

Technical User
Dec 22, 2000
127
US
Hi,
I need some help.
I installed Mandrake Linux on a machine which is having Win-98. I did the partitioning using Partition-Magic. Now I wanted more space and grabbed from Windows partition and made it as ext2 partition. But when I do this and try to boot my linux it says that incorrect root partition and will not boot.
[ Windows in 1,2 partions,
Linux in 3, 4,5 partitions.
grabbed space from partition 2 so that new partition is 3.]
Can anybody suggest me how to resolve this
Thanks in advance.
Partha
Parthasarathy, Hassan
Parthasarathy, Hassan
 
Boot from a floppy:
remount the root part. and partitions holding /etc, edit
lilo.conf, run lilo and sync a few times. Reboot. If this does not work you will have to try to recover the original partition table. There are a few tools that help with this. If you overwote the partition table you WILL need to
try some form of special recovery.
Partition magic is not a very safe or smart tool.

 
Hi Marsd,
Thanks for the Help. I am booting from the floppy as during the istallation it said that it cannot load the boot record into any of the partitions. Hence i am booting from floppy. I don't think it has any lilo.conf. This si the situation. Any suggestions/advice, highly appreciated.
Thanks
Partha Parthasarathy, Hassan
 
Hi,



If you've added a partition then your partition ids may have changed. Its not too clear from what you say but I'd guess you have maybe one primary and four logical partitions (you can only have four primary partitions on one drive so you must have some logical ones!).



Linux normally allocates the primaries in the order they are found in the partition table which is not necessarily the same order as they are on disk. These would be /dev/hda1, /dev/hda2, /dev/hda3, /dev/hda4. The logical partitions always begin at /dev/hda5 onwards irrespective of how many primaries you have. I would guess that what was /dev/hda5 is now /dev/hda6.



What you have to do is pass an argument to lilo at boot time overriding the 'root' partition in lilo. You do that by bypassing any graphical lilo screen (and possibly holding down 'alt' or 'shift' if it doesn't wait). You need to get the 'boot:' prompt and pass the root partition - something like this :



boot: linux root=/dev/hda6



You may have to try a few more possibilities until you get it to work. Once you've booted OK go and edit /etc/lilo.conf and replace the partition on the 'root=' line with the new partition as just found. Then do (as root) '/sbin/lilo -v' to update the actual boot sector.



It should now be OK...



Regards
 
Thank you very much Infincham. It was really helpful. Now I am running with some problems.
I was able to boot as you said. you gave me the perfect command. After booting, I tried to edit the /etc/lilo.conf file for making the changes for root partion. But it was already having the info as root partition pointing to corrrect partition. It was looking as below :
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
vga=normal
default=windows
keytable=/boot/us.klt
prompt
timeout=50
message=/boot/message
other=/dev/hda1
label=windows
table=/dev/hda
other=/dev/fd0
label=floppy
unsafe
image=/boot/vmlinuz
label=linux
root=/dev/hda6
append="hdb=ide-scsi"
read-only


Then I tried to reboot, but it did not boot, before booting it was telling that if you don't specify the Operating System it will boot from the partition /dev/hda5 [previous Root partition]. Again I needed to enter the root partition to boot.
Another thing is : I am unable to see the newly created partition which is of type linux-ext2. If I say mnt it says that it cannot be mounted as it is not in the /etc/fstab or /etc/mtab files.
Now I am booting Linux with floppy, How can I put my linux boot record also into hard drive so that I can boot from Hard drive itself.
Can you/anybody pls help me in resolving these problems.
Thanks in advance
Parthasarathy Parthasarathy, Hassan
 
Hi,

When you make changes to /etc/lilo.conf you MUST do (as root) '/sbin/lilo' to update the binary boot record. The system does not refer to /etc/lilo.conf at all when it boots - only to the binary boot record generated from the config file in the manner just described. So you need to do a '/sbin/lilo' to get booting normally again.

To mount a partition with a command as simple as 'mount /dev/hda5' requires that the 'missing' information that needs to be passed to mount is in the file /etc/fstab. So, you need to add an entry like this :

/dev/hda5 /usr1 ext2 defaults 1 2

The '/usr1' above is an example of where you might want to mount the partition in the directory tree. If your mount point does not currently exist you need to create it as a one-off with 'mkdir /usr1' (or whatever you want to call it). The long-hand mount command you'd need if you don't have info in /etc/fstab is like this :

mount /dev/hda5 -t ext2 /usr1

Incidentally, /etc/mtab records which filesystems are actually mounted at any given time.

Hope this helps



 
Hi ifincham,
Thanks a lot. It worked. I was able to mount the partition. I followed your instructions and it was a grand success.
But, only thing that is not working is it is unable to look at the partition /dev/hda6 as the root partition. Still it looks at the /dev/hda5 [old boot partition] and it failes as it is unable to look at the root partition.Is there any way that we can look at the partition that linux will be looking next time while booting. If this is set, it will be a painless job to boot with the floppy.
One more thing, now I am booting Linux with floppy, How can I put my linux boot record also into hard drive so that I can boot from Hard drive itself.
Anbody, Pls advice me in this regard
Thanks in advance
Parthasarathy Parthasarathy, Hassan
 
Hi,

This doesn't make a lot of sense. If your /etc/lilo.conf shows 'root=/dev/hda6' in the image block (which it seems to from above posting) and you have run the command '/sbin/lilo -v' as root, then the boot record must point to /dev/hda6. From what you say it sounds as if you still haven't run that command to update the boot record. Did you definitely execute the command '/sbin/lilo -v' as root on the system ? It will respond with various lines saying 'added linux' etc.

Regards

 
I executed that. And I got the output as below:

[root@phost informix]# /sbin/lilo -v
LILO version 21, Copyright 1992-1998 Werner Almesberger

Reading boot sector from /dev/hda
Merging with /boot/boot.b
Warning: device 0x0306 exceeds 1024 cylinder limit
geo_comp_addr: Cylinder number is too big (2228 > 1023)
[root@phost informix]#


After this if I try to boot, then it says that it will boot from /dev/hda5 [which should be /dev/hda6]

The problem may be Dos partion occupies the boot area on the Hard-drive and that may be causing the problems. Any idea on this,
Thanks in advance for any help.
Partha
Parthasarathy, Hassan
 
Flash your bios if possible with a newer bios for your
machine->outside this your options are fairly limited short of repartitioning. Also have a look at the large-disk
howto which is shipped with most distros.

Good Luck.
 
Hi,

As long as your bios supports extended interrupt 13 calls (which it should if it's less than approx five years old) , you should be able to get lilo to access cylinders > 1024 by giving it the 'lba32' parameter at boot time. Just put that parameter on a line in the globals part of your /etc/lilo.conf (remove any line with 'linear') and try '/sbin/lilo -v' again.

If it doesn't work there might be a bios update available for your motherboard that would solve the problem (as per marsd above). Be very careful about flashing (updating) the system bios, however, because a wrong bios could effectively kill the motherboard permanently if you have no way of restoring the original bios. That's not to say don't do it - just check carefully that it is the right bios for your hardware.

Other than that, the only other option is to create a '/boot' partition for linux somewhere under the 1024 cylinder limit of the drive. You can still leave the main linux space above the limit but you'd just create a small partition for the purposes of booting. Based on your current partitions, you could probably make a small primary partition between your two windows partitions, i.e using PQmagic to shrink one a bit to free up the space.

Hope this helps

 
Right: Sorry about that, caution is the byword in this.
This is the only fix for an ancient bios however.
 
Thanks all for your valuable suggestions.
But I could not locate the global part of lilo.conf file.my lilo.conf file looks as below:

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
vga=normal
default=windows
keytable=/boot/us.klt
prompt
timeout=50
message=/boot/message
other=/dev/hda1
label=windows
table=/dev/hda
other=/dev/fd0
label=floppy
unsafe
image=/boot/vmlinuz
label=linux
root=/dev/hda5
append="hdb=ide-scsi"
read-only

Can anybody pls tell me where exactly I should put the line lba32. If I change and if some thing happens and machine doesnot bootup, then can I be able to boot atleast in a single user mode? Can you pls clarify this. Also, after making a small primary partion, how can I transfer my linux boot information to that partition?
Thanks is advance
Parthasarathy

Parthasarathy, Hassan
 
Hi,

When I say the global section, I mean the directives that are not contained under the 'image' blocks - in your case the global directives are all at the top. Before 'prompt' is a good enough place, i.e. like this :

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
vga=normal
default=windows
keytable=/boot/us.klt
lba32
prompt
timeout=50
message=/boot/message
other=/dev/hda1
    label=windows
    table=/dev/hda
other=/dev/fd0
    label=floppy
    unsafe
image=/boot/vmlinuz
    label=linux
    root=/dev/hda5
    append="hdb=ide-scsi"
    read-only

Incidentally, when you run '/sbin/lilo -v' you may still get the warning about > 1024 cylinders but it should write the actual boot sector nonetheless. What might be a problem is if it doesn't say :

added windows
added floppy
added linux

That would make me wonder whether it did actually write the boot sector. You can also run lilo with the -L parm which is equivalent to the 'lba32' keyword although I don't see why you'd need that to install in the MBR (vs to read from the /dev/hda5 partition at boot time). You can try it though :

/sbin/lilo -L -v

With both commands you can test first :

/sbin/lilo -v -t
/sbin/lilo -v -t -L

You could also try 'linear' :

/sbin/lilo -v -t -l

(Remove the -t to actually do them)

Regards




 

Thanks for your real valuable suggestions.
I followed your instructions and I got the results as below:

[root@phost /etc]# /sbin/lilo -l
Warning: device 0x0305 exceeds 1024 cylinder limit
Warning: device 0x0305 exceeds 1024 cylinder limit
Warning: device 0x0305 exceeds 1024 cylinder limit
Added windows *
Added floppy
Warning: device 0x0305 exceeds 1024 cylinder limit
Added linux
[root@phost /etc]#

But unfortunately, I am getting weird results. when I reboted the machine, it stopped telling "LI" at the beginning and it was hanging. I booted through floppy and it came up. Now my Windows partition is not getting booted. I saw in the fdisk, still I see Windows partition is active, but I don't know why it is not being seen by the lilo booter.
Another thing is, I am ready to get rid of the Windows partition if I am able to boot my linux without the use of floppy [only with Hard drive].

Any suggestions/advice, please
Thanks again, as usual,
Regards
Parthasarathy
Parthasarathy, Hassan
 
Hi,

'linear' and 'lba32' are mutually exclusive - if you did /sbin/lilo -l you were using linear mode which evidently doesn't work for you. If you've tried as /sbin/lilo -L -v and it doesn't work then you have tried everything really.

If the floppy boot works fine then logically you should be able to get it working from the hard-disk. If it were a bios limitation you wouldn't be able to boot from floppy either. Its just a matter of getting the correct setting in lilo.conf (lba32, linear or none) and getting lilo to write that into the MBR. Did you actually try the '/sbin/lilo -L -v' (Upper-case L) version ?

Regards
 
You can boot from floppy where the bios will not support extended ide drive sizes or partitions. It sounds like an older bios and large drive, plus the PM extended resize has
arranged things pretty screwy.
A new bios would fix this problem ; as would reinstalling clean. Even if you delete your windows partition
there is no gaurantee that with your current bios and disk geometry linux will boot alone. The most successful fix
for the large disk problem is a modern bios. Everything else is a kludge.
 
Hi,

marsd is quite right on that - the boot files are of course on the floppy which can be read whereas the ones on the hard-disk are in a partition that can't (yet) be reached - a bit like the scenario whereby you need an initrd to boot from a scsi drive.

How new is this machine - what's the make / model ?

Regards
 
Hi, My sincere thanks to both of you for rendering your kind help.
I executed lilo with -L option and it erred out saying that it is nto the correct option. Even in the manpages of lilo it doesnot say about -L option or lba32. Hence I executed with -l option. The following is the output when I executed lilo -L -V

[root@phost /root]# /sbin/lilo -L -v
usage: lilo [ -C config_file ] -q [ -m map_file ] [ -v ... ]
lilo [ -C config_file ] [ -b boot_device ] [ -c ] [ -l ]
[ -i boot_sector ] [ -m map_file ] [ -d delay ]
[ -v ... ] [ -t ] [ -s save_file | -S save_file ]
[ -P fix | -P ignore ] [ -r root_dir ] [ -w ]
lilo [ -C config_file ] [ -m map_file ] -R [ word ... ]
lilo [ -C config_file ] -I name [ options ]
lilo [ -C config_file ] [ -s save_file ] -u | -U [ boot_device ]
lilo -V

[root@phost /root]#


I am wondering why it stopped saying "LI" at the booting time [without linux floppy].
I am using Mandrake 7.1 on IBM pentium II Aptiva E-series 540 machine.
With this situation, do you suggest any work-arounds.
Another thing, can you pls tell me where I can get the latest version of Bios for my machine.
Thanks
Parthasarathy Parthasarathy, Hassan
 
Hi,

Well thats odd - the '-L' switch was added in November 1999. Maybe you have an old version of lilo for some reason. What does '/sbin/lilo -V' say ?

On the bios, I think there is another number missing - e.g. xxxx-540 . As it's IBM, you have to get flash updates from IBM themselves - as far as I know they are always IBM in-house bioses on IBM motherboards.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top