Skip to comments.[Vanity:Tech Support] Lilo vs Grub :p (Linux)
Posted on 05/10/2014 9:41:34 PM PDT by Bikkuri
Need Tech Support on Linux
I Want to uninstall Lilo and get my Grub2 back .. I DO have (reinstalled) Grub, but it is still using Lilo to boot, and it is not allowing me to have Duel-Boot. I rarely use Win, but now I don’t even have the option :/
Any idea how I can get Grub back as the Boot-Loader?
Still I am not sure how much this will help you with the encryption. There are just too many ways to encrypt stuff.
i think i remember that grub has to be written into the master boot record for correct installation. if the mbr still points to lilo, the system will boot lilo. you should be able to configure lilo to dual boot though.
when you run grub-install, at the end it’s apparently supposed to overwrite the MBR for itself.
just check out the man page,
i wrote a boot loader years ago.
The MBR is 512 bytes which begins with executable code.
The last 50 bytes of the MBR are 4 16-byte entries of the partition table, and a 2-byte signature that is always 0x55AA.
So there can only be a max of 4 bootable partitions. There can be more partitions through some extended data, but only these 4 partitions will be bootable.
The small amount of code in the MBR will load other disk sectors which will contain the boot loader program in its full form.
Of course, that’s why the MBR needs to be the grub MBR in order to have grub run.
We must also note that the 4 partition table entries each begin with a status byte; 0x80, means the partition is the “active” partition and no doubt this is pointing to a partition where lilo is then loaded from. “Not the active partition” is 0x00; any other value, 0x01 through 0x7F is technically invalid. So basically, if the high order bit is set, it’s the active partition.
The 400 some bytes of code in the MBR would be seeing which partition was active and loading sectors starting at that partition and executing a jmp to run the code.
THe MBR can be updated with extreme caution, of course. I have no problem doing it because I’m paranoid when it comes to computers, so I simply make sure I’ve got things correct before I overwrite it.
Basically, one uses the unix dd command.
Basically, dd takes an input and output parameter, among others.
The input can be either a sector number to start at, or a file.
The output can ALSO be either a sector number to start at, or a file.
So one simply reads sector zero and writes it to a file.
Then one uses a hex editor to edit the file.
The file, of course, will be exactly 512 bytes, and must remain so.
After editing, dd is used to write the file back to sector zero.
If you mess up badly enough, you need to boot from some other media, cuz your hard drive will not boot.
Do you only have one partition table entry ?
If you only have one partition table entry, then the problem is that grub install has not really replaced lilo in that partition.
Of course, there is no harm in using dd to read sector zero and write it to a file, and looking at it with a hex editor.
you can also, of course, disassemble the file to see the assembler code in source form, using objdump -d as well.
But that would just be an exercise because you really just want to analyze the partition table entries.
the xxd command will show you a file as both ascii and hex, of course.
Is lilo still installed ? if so, what does its configuration say ?
What does the grub configuration say ?
Did you specify the hard drive to install grub on, and was that the drive lilo was previously installed on ?
What does your /etc/fstab have in it ?
Are you using logical volumes, i.e., does /etc/fstab have a line like /dev/VolGroup00/LogVol00 and so forth ?
No, did not re-run Live-CD.. don’t think it is needed; and my encrypted is now reformated to normal ext4, so encryption is not the issue atm..
dafly, correct, it is all in the MBR..
Pieter.. I am nervous to go back to assembly.. it has been over 30 years since I have messed with it and (HeX)..
Since I know my MBR is working, I just need a way to uninstall Lilo safely, then reinstall/update Grub...
Honestly, the Windows is not important at all.. I use it to play games (think last time I used it was 4+ months ago).. I can use Photoshop on my VB in Linux (BTW, someone was asking for my ver/distro.. Mint 16 (Petra), KDE)..
I am just trying to do this the safest way.. I could easily solve this by doing fresh install.. but I would have to rebuild again until the next LTS.. (Mint 17, which I am going to stick with until next LTS, at this point)....
That is a most apt description of a machine with Linux and Windows operating systems installed.
-s save-fileI use lilo, and don't know grub, but I'll guess that grub has a widget that will overwrite or make new the MBR, to suit itself (I think it does this automatically, with the command `grub-install /dev/XXX`). Assuming this to be the case, you shouldn;t have to do anything other than installing grub.
When lilo writes a new boot sector, it preserves the former contents of the boot sector in a file, named by default /boot/boot.NNNN, where NNNN is the hexadecimal representation of the major and minor device numbers of the drive/partition.
This option defines the backup save file in one of three ways: a save directory (default is '/boot') using the default filename 'boot.NNNN' in the defined directory; a pathname template to which '.NNNN' is appended (default would be '/boot/boot'); or the full pathname of the file, which must include the correct '.NNNN' suffix. When used with the -u option, the full file pathname must be set.
You can get lilo to boot Windows, if you want to try lilo, maybe stay with it. Edit /etc/lilo.conf, adding something like this:
other=/dev/sda1That assumes you have Windows on the first partition of sda.
After you edit /etc/lilo.conf, you have to run lilo again, to make the changes effective.
Try the thread listed below. If that doesn’t work, ping me.
Apologies about not getting back sooner.. going through hours of searches (along with advice here), I was overlooking the simplest thing.. I had originally installed the loader on sbd (but Lilo was installed on sba..)..
Fixed now with just a simple terminal install to sbd and update ;^)
Thank you all for assistance ;^)
(kicking myself in butt for overlooking that >.<)
Yeah, that will get you every time.
Yup, caught the ‘sb’ typos right after I hit send... knew you would understand ;D
"Freedom is the sure possession of those alone
who have the courage to defend it."
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.