LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-01-2003, 04:38 PM   #1
squall14716
Member
 
Registered: Oct 2003
Distribution: Gentoo, Knoppix
Posts: 62

Rep: Reputation: 15
Reinstalling Lilo using Knoppix CD without reinstalling Knoppix?


I installed Windows XP Pro this time and it replaced the Lilo Boot Manager, so I can no longer boot to the Knoppix I installed to my HD. Obviously, I wouldn't think there would be a Windows Installer for it, so I want to know if it is possible to re-install it using the Knoppix CD without re-installling Knoppix itself?
 
Old 11-01-2003, 05:21 PM   #2
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
Assuming from your question that Windows XP is on hda1 and Knoppix is on hda2, then do:

1. Boot with Knoppix CD

2. Open a root terminal (ctrl-alt-F2) and do the following at the #prompt:

# PS1='\u@\h:\w\$ '
This shows the full path on your root prompt.

# mount /mnt/hda2
# chroot /mnt/hda2
The chroot command changes the root to /mnt/hda2, your Knoppix partition on the hard-disk

# cd /etc
Once you're in /etc, then edit lilo.conf (e.g. vi lilo.conf) and add the appropriate boot options for Knoppix and for Windows XP. Your lilo.conf should still have the correct settings for your existing Knoppix installation. However, I don't use Windows XP, so I can't offer any help with that; try searching this site or googling "lilo.conf Windows XP". Once you've saved your lilo.conf and exited your text editor, then:

# lilo
This writes your new lilo settings

# exit
Get out of chroot

# shutdown -r now
And reboot.

Last edited by spurious; 11-01-2003 at 05:22 PM.
 
Old 11-01-2003, 06:35 PM   #3
schatoor
Senior Member
 
Registered: Jul 2002
Location: a tiny place caled hendrik ido ambacht in the netherlands
Distribution: SuSE, debian, slackware, lfs
Posts: 1,358

Rep: Reputation: 45
That's nearly correct spurious, but it won't work. You will get an error when you run lilo like that. And that's because the way you mount your knoppix partition.
You see, I have used knoppix to install my LFS system and I pulled my hear out trying to get lilo on the mbr after I had succesfully installed my system.
This is what you need to do in addition to what spurious has said. Before issuing the command "mount /dev/hda2", edit the file "/etc/fstab". In that file, change the line with the entery "/dev/hda2" to
"/dev/hda2 / ext3 defaults 1 1"
The thing you must change is the "defaults" bit. I don't know what there is right now, but the fourth option should be "defaults". Never mind the rest.
For the rest, do what spurious has told you.

Last edited by schatoor; 11-01-2003 at 06:37 PM.
 
Old 11-01-2003, 07:43 PM   #4
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
D'oh, forgot about the fstab... I actually do this chroot/lilo trick on a regular basis. I keep two Knoppix partitions: the first one is for my "good" (ie. don't mess around with it) Knoppix 3.2 2003-07-26 install, and the second one is for testing the latest Knoppix release (3.3 has apm problems so I keep it on "testing"), or for trying out new apt-get installs (I learned the hard way that sometimes new software can bork your system).
 
Old 11-01-2003, 07:49 PM   #5
squall14716
Member
 
Registered: Oct 2003
Distribution: Gentoo, Knoppix
Posts: 62

Original Poster
Rep: Reputation: 15
When trying to mount it after changing fstab, it starts whining about /dev/root already being mounted to /. Unmounting it of course kills everything. I guess I'm probably missing something, else it should work, right?
 
Old 11-02-2003, 06:45 AM   #6
schatoor
Senior Member
 
Registered: Jul 2002
Location: a tiny place caled hendrik ido ambacht in the netherlands
Distribution: SuSE, debian, slackware, lfs
Posts: 1,358

Rep: Reputation: 45
Oh so I guess your root is alraidy mounted. What boot options are you giving?
If hda2 is alraidy mounted as root, I guess all you need to do is run lilo and reboot.
 
Old 11-02-2003, 08:07 AM   #7
squall14716
Member
 
Registered: Oct 2003
Distribution: Gentoo, Knoppix
Posts: 62

Original Poster
Rep: Reputation: 15
It says /dev/root is mounted as /. My Knoppix partition is not mounted as root. Otherwise, this would be so much easier.

Is there a boot option to mount hda5 as / automatically?

Last edited by squall14716; 11-02-2003 at 08:12 AM.
 
Old 11-02-2003, 08:50 AM   #8
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
"When trying to mount it after changing fstab, it starts whining about /dev/root already being mounted to /. Unmounting it of course kills everything." In your last post, you indicate that your Knoppix hard-disk partition is hda5.

You need to break this down step-by-step. Please indicate at which step your error occurs:

1. Boot with Knoppix CD

2. as root, edit /etc/fstab (this is the fstab on the Knoppix CD RAM filesystem, not the fstab on your Knoppix hard-disk partition), with schatoor's instructions so you have /dev/hda5 ext3 defaults 1 1

3. mount -t ext3 /dev/hda5 /mnt/hda5

4. chroot /mnt/hda2: now /mnt/hda2 should be / (if you set the prompt environment variable PS1 as I suggested in my above post, then you will see the change in your prompt path)

5. cd /etc and edit lilo.conf. After editing lilo.conf to taste, then run lilo. Re-boot.
 
Old 11-02-2003, 09:04 AM   #9
squall14716
Member
 
Registered: Oct 2003
Distribution: Gentoo, Knoppix
Posts: 62

Original Poster
Rep: Reputation: 15
Ok, following it totally as you said (changing ext3 to ext2 (is ext3 better?)) it seems to have worked. My problem was, I tried to mount hda5 as / instead of /mnt/hda5. Thanks for clearing that up. Soory for being all "n00bish'.

Thanks for all your help.
 
Old 11-02-2003, 09:05 AM   #10
schatoor
Senior Member
 
Registered: Jul 2002
Location: a tiny place caled hendrik ido ambacht in the netherlands
Distribution: SuSE, debian, slackware, lfs
Posts: 1,358

Rep: Reputation: 45
Don't you mean :"chroot /mnt/hda5: now /mnt/hda5" spurious?
 
Old 11-02-2003, 09:46 AM   #11
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
schatoor: oops, typo... but it seems like our work is done here. High-Five!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reinstalling LILO? moosegoose Slackware 5 11-11-2005 02:35 PM
Problem reinstalling lilo thebored Linux - Software 4 04-19-2005 01:30 AM
reinstalling lilo deft Linux - Software 8 04-08-2004 10:03 AM
LILO reinstalling help Andrew Hruska Slackware 3 01-05-2004 08:53 PM
Having some trouble reinstalling lilo cav Linux - General 3 08-27-2003 02:24 PM


All times are GMT -5. The time now is 11:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration