Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: ShadowAce

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?


2 posted on 05/10/2014 9:43:49 PM PDT by Bikkuri (Molon Labe)
[ Post Reply | Private Reply | To 1 | View Replies ]


To: Bikkuri
Did you try booting from a Live CD and then running grub-install?

Still I am not sure how much this will help you with the encryption. There are just too many ways to encrypt stuff.

3 posted on 05/10/2014 10:03:18 PM PDT by Greysard
[ Post Reply | Private Reply | To 2 | View Replies ]

To: Bikkuri

when you run grub-install, at the end it’s apparently supposed to overwrite the MBR for itself.

just check out the man page,

man grub-install

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 ?


6 posted on 05/11/2014 1:44:58 AM PDT by PieterCasparzen (We have to fix things ourselves)
[ Post Reply | Private Reply | To 2 | View Replies ]

To: Bikkuri
"...Duel-Boot."

That is a most apt description of a machine with Linux and Windows operating systems installed.

9 posted on 05/11/2014 8:39:30 AM PDT by Bloody Sam Roberts (Only Liberals can look at an amendment that says “shall not be infringed" and see blank parchment.)
[ Post Reply | Private Reply | To 2 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson