Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Boot problem: 2 operating systems try to boot [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Laura
n00b
n00b


Joined: 14 Dec 2005
Posts: 18
Location: California

PostPosted: Sat Mar 31, 2007 7:49 am    Post subject: Boot problem: 2 operating systems try to boot [Solved] Reply with quote

I am afraid I have a rather unusual problem. I recently decided to install linux on my new macbook. First I installed ubuntu, but after a while I decided I didn't like it, and that I would install gentoo instead (I am a longtime gentoo user). Since I had already partitioned my hard drive with a linux and a swap partition (as well as 2 partions for mac OSX), I thought I would not need to re-partition again. I thought (mistakenly?) that just running mke2fs would erase the existing data on my linux partition and I could start over with a gentoo installation.

So, I ran mke2fs -j on my linux partition, and proceeded with the typical gentoo installation. Finally, I installed and configured LILO and was ready to reboot. I also already had rEFIt installed, which allows you to select which partition to boot from on a mac. But here is the problem: When I rebooted, rEFIt listed TWO linux hard-drive options in its boot menu. It does not matter which one I select, the same thing happens:

First, the Ubuntu boot sequence starts (it looks just like it did before). It gets to the second step: mounting root file system.

Then the screen goes black for a second, and then another screen with "Gentoo linux" at the top comes up and says that it cannot mount /proc because it is already mounted. It prompts me for my password to enter interactive boot mode, but when I enter my password nothing happens. At this point, the system is frozen and I must reboot with the power button.

I tried booting again from the live CD to see if I could find the Ubuntu files, but when I mount my linux partition from the live CD, I cannot see any files from my Ubuntu installation, only Gentoo.

So, here are my questions: do you think it is possible to salvage this situation by somehow fixing the bootloaders? Or must I start the installation over from scratch? And if I do re-install from scratch, how do I thoroughly erase my partition beforehand to ensure that this does not happen again? Any help is appreciated!

Thanks,
Laura


Last edited by Laura on Mon Apr 02, 2007 12:02 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54216
Location: 56N 3W

PostPosted: Sat Mar 31, 2007 11:39 am    Post subject: Reply with quote

Laura,

mke2fs erases the filesystem but bootloaders often work outside the filesystem too.
Your gentoo install will be intact and correct however your boot loader may welll still have remmanents of ubuntu.

You mentioned that you are using lilo. Reconfiguring lilo is not suffcient. You must also run /sbin/lilo to write lilos new block list.
If you omit this step, lilo loads whatever its old block list happens to contain, probably unbuntus' startup. IF some of the old blocks have been reused, it just gets in a mess.

It sounds like you are attempting to run Gentoo on top of your old ubuntu kernel which will fail as your old kernels modules can no longer be found.

I said "mke2fs erases the filesystem" thats actually not strictly true. It sets up a new superblock, inode tables, free space map and creates a new top level directory but the data that was there before remains in place. Its only wiped if the blocks it used to occupy get over writen in the filesystem creation process.
Thats the difference between unallocated and empty. Very few filesystems actually destroy the data in deleted files because its both difficult and takes time.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Laura
n00b
n00b


Joined: 14 Dec 2005
Posts: 18
Location: California

PostPosted: Sat Mar 31, 2007 7:57 pm    Post subject: Reply with quote

I had already run /sbin/lilo, but I just tried again, just in case. Unfortunately, it didn't help. However, I noticed something else: the version of LILO which comes up first when I boot is 22.6.1, which is a different version than I installed for Gentoo (I think it was 22.7.?). So it seems that there are actually two instances of LILO being called at startup.

I think that the problem may lie with rEFIt. I tried re-running the rEFIt partitioning tool (which for some reason insists on labelling my linux partion as FAT32, but this is a known problem, and seems to have no ill effects). This did not help. I see some bug reports for rEFIt with references to duplicate linux boot icons... One of them recommends "dd if=/dev/zero of=/dev/sda3 bs=512 count=1" to wipe the partition's boot sector.

http://sourceforge.net/tracker/index.php?func=detail&aid=1535014&group_id=161917&atid=821764

What do you think?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54216
Location: 56N 3W

PostPosted: Sat Mar 31, 2007 10:01 pm    Post subject: Reply with quote

Laura,

Well, if you have two different versions of lilo, they must be installed in different places. That would be a problem, since the old one is being run first.
If you want to try wiping boot sectors, be sure you have an alternate means to boot and make a backup of the boot sector to a file, using dd, in case you regret the wipe later. Then at least you can put the boot sector back.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Laura
n00b
n00b


Joined: 14 Dec 2005
Posts: 18
Location: California

PostPosted: Sun Apr 01, 2007 11:59 pm    Post subject: Reply with quote

I tried erasing the boot sector of /dev/sda3 with dd and re-running fdisk and lilo, but this did not help. However, I seem to have solved this problem by running:

/sbin/lilo -M /dev/sda mbr

I guess there was still conflicting Ubuntu information in the master boot record and this fixed it. In any case, there are still two linux icons in rEFIt, but now they both successfully boot Gentoo.

Thanks for your help!

-Laura
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum