Free Republic
Browse · Search
Topics · Post Article

Skip to comments.

[Vanity:Tech Support] Lilo vs Grub :p (Linux)
Self | 5/11/2014 | Bikkuri

Posted on 05/10/2014 9:41:34 PM PDT by Bikkuri

Need Tech Support on Linux

TOPICS: Computers/Internet
KEYWORDS: grub; lilo; linux
Ok, while trying to get an encrypted HDD back, I installed Lilo (didn't realize it was a boot loader)..
1 posted on 05/10/2014 9:41:35 PM PDT by Bikkuri
[ Post Reply | Private Reply | View Replies]

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
You don't specify your distro, but maybe something like
4 posted on 05/10/2014 10:32:46 PM PDT by TChad (The Obamacare motto: Dulce et decorum est pro patria mori.)
[ Post Reply | Private Reply | To 1 | View Replies]

To: Bikkuri

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.

5 posted on 05/10/2014 10:50:00 PM PDT by dadfly
[ Post Reply | Private Reply | To 1 | 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: Greysard

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..

7 posted on 05/11/2014 2:13:58 AM PDT by Bikkuri (Molon Labe)
[ Post Reply | Private Reply | To 3 | View Replies]

To: dadfly; PieterCasparzen

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)....

8 posted on 05/11/2014 2:23:29 AM PDT by Bikkuri (Molon Labe)
[ Post Reply | Private Reply | To 5 | View Replies]

To: Bikkuri

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]

To: Bikkuri; rdb3; Calvinist_Dark_Lord; JosephW; Only1choice____Freedom; amigatec; Still Thinking; ...

10 posted on 05/11/2014 10:45:12 AM PDT by ShadowAce (Linux -- The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 1 | View Replies]

To: Bikkuri
When you installed lilo, it should have made a copy of the boot record on that hard drive. Look for a file called "boot.0300" or "boot.0800" or similar. This is a copy of the MBR as lilo found it, before lilo changed it.
-s save-file
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.

I 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.
11 posted on 05/11/2014 10:55:02 AM PDT by Cboldt
[ Post Reply | Private Reply | To 1 | View Replies]

To: Bikkuri
Oh, to manually restore the boot record that lilo copied for you, use `dd /boot/boot.NNNN /dev/sda`, assuming the boot record that lilo created was on the device "sda".

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:

That 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.

12 posted on 05/11/2014 11:21:09 AM PDT by Cboldt
[ Post Reply | Private Reply | To 1 | View Replies]

To: Bikkuri

Try the thread listed below. If that doesn’t work, ping me.

13 posted on 05/11/2014 3:34:27 PM PDT by BuckeyeTexan (There are those that break and bend. I'm the other kind. ~Steve Earle)
[ Post Reply | Private Reply | To 1 | View Replies]

To: Cboldt; PieterCasparzen; dadfly; ShadowAce

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 >.<)

14 posted on 05/13/2014 12:14:01 PM PDT by Bikkuri (Molon Labe)
[ Post Reply | Private Reply | To 11 | View Replies]

To: Bikkuri
sda vs sdb, you mean ;)

Yeah, that will get you every time.

15 posted on 05/13/2014 12:17:51 PM PDT by Cboldt
[ Post Reply | Private Reply | To 14 | View Replies]

To: Cboldt

Yup, caught the ‘sb’ typos right after I hit send... knew you would understand ;D

16 posted on 05/13/2014 12:19:30 PM PDT by Bikkuri (Molon Labe)
[ Post Reply | Private Reply | To 15 | View Replies]

"Freedom is the sure possession of those alone
who have the courage to defend it."


Please support Free Republic
click the pic

17 posted on 05/13/2014 12:19:59 PM PDT by trisham (Zen is not easy. It takes effort to attain nothingness. And then what do you have? Bupkis.)
[ Post Reply | Private Reply | To 1 | View Replies]

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.

Free Republic
Browse · Search
Topics · Post Article

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