LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-16-2005, 03:08 AM   #1
choboNO1
LQ Newbie
 
Registered: Jan 2005
Distribution: Mandrakes 10.1
Posts: 6

Rep: Reputation: 0
How to get into debian without boot loader?


Hi, I have a winxp/linux dual boot system.
Today, I had to format windows and reinstall it.
The MBR of course got erased so i have no way of booting into linux from grub.
I also don't have a linux boot floppy....
So, is there any other way i can get into debian without reinstalling it?
thanks.[/u]
 
Old 09-16-2005, 04:52 AM   #2
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Easy, it is called "change root" and the command is chroot in Linux

You just load any Linux live CD, make a temporary directory, mount your Debian partition and then do a charge root

assuming your Debian is in hda2 and after booting to a Live CD, log in as root at terminal prompt just type

mkdir /mnt/my_debian
mount /dev/hda2 /mnt/my_debian
chroot /mnt/my_debian

Now you are inside Debian. Want its boot loader Lilo back, no problem, just type

lilo -b /dev/hda

and Lilo will be installed in the MBR (no number after hda means MBR).
 
Old 09-16-2005, 08:42 AM   #3
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
Let's say that Debian uses GRUB as a bootloader...and you want it back. So use a LiveCD which uses GRUB too (I recommend Knoppix). Alternative to chroot, you may run "grub" and you'll get a GRUB shell, where you type "find /boot/grub/stage1". You should get an output like "(hd0,1)". So, you'll have to run "root (hd0,1)", then "setup (hd0)" and this should get GRUB back into the MBR.
The other way around is to copy Debian's root partition boot sector (also using a LiveCD), copy the resulted file in C:, then add an entry in boot.ini. If you're interested, I can detail on the latter.

Last edited by harken; 09-16-2005 at 09:05 AM.
 
Old 09-16-2005, 09:01 AM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
harken,

Pre-packaged Debain always uses Lilo as far as my CDs are concerned. So is Knoppix.

As such Grub may not be available at root terminal. If it does, possibly in a Live Knoppix CD, it would not have the neccessary files in place to run the "setup" command. You also need to run "root" command at Grub prompt for Grub to identify the partition to obtain the Stage1/2 files, otherwise it will default to the one you are currently running Linux.

It is therefore beneficial to face the music head on and get Lilo and Grub to boot each other. The two are remarkably similar.

lilo -b /dev/hda in Lilo is the same as

grub-install /dev/hda in Grub

The latter is equivalent to "root (i,j)"+"setup(i,j)" you have suggested.

Not my intention to undermine your advice given out here but I think you may welcome a clarification, as try it out yourself.
 
Old 09-16-2005, 09:14 AM   #5
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
Thanks for correcting me in the "root" matter. I perfectly knew that (I just reinstalled GRUB into the MBR a few hours ago) so that was a typo, which has now been corrected.
I think we don't obtain the same Debian CDs because mine have always used GRUB, just like Knoppix. Actually I burnt today the Knoppix 4.0 DVD and used it to reinstall GRUB (see the paranthesis above).

OMG, my post number makes me look like some evil entity right now!

Last edited by harken; 09-16-2005 at 09:18 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
wireless Keyboard not working to select boot options (Grub boot loader) psrini_vasan Fedora 7 12-16-2009 05:45 PM
Grub boot loader menu shows two linux boot options pramos Linux - Newbie 3 09-12-2004 11:40 PM
Boot loader Debian Sarge tungsten Debian 16 04-14-2004 06:27 AM
better boot loader for Debian (Knoppix HD install) ptesone Debian 2 03-17-2004 01:02 PM
How to add a boot record which used to startup windows under my Grub boot loader? yunxiang Linux - Newbie 6 02-01-2003 02:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration