LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 10-23-2009, 09:37 AM   #1
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Rep: Reputation: 33
Smile Booting into linux when your boot sector is gone?


Hi people!

Here's my situation.

I have a computer that had two hard drives.

Disk0 was an IDE drive that contained Windows ME (as the C: drive).

Disk1 has two partitions. The first contains Windows 2000 Server (seen as the D: drive). The second contains an old installation of Mandrake Linux.

I have removed the first drive, which contained the boot sector/information for all the drives. It had a menu when I would boot up so I could choose the OS I wanted.

After I removed that drive I had to rebuild the boot sector on the second drive so I could use Windows 2000. However, I can't access my Linux any more as the system now boots straight into Windows. I know there is a boot disk you can use to access Linux. This machine has both a floppy drive and a CD-ROM. I have the Ultimate Boot CD, don't know if that will help, I'm not sure what to look for on it.

How can I access my Linux partition using a boot disk?

Thanks.
 
Old 10-23-2009, 10:52 AM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Use any live CD to boot into a linux environment. Then you want to chroot into the Mandrake install to reinstall grub or lilo. See the "Grub Booting Tips" in my signature, specifically steps B3 or B5.

Note that you may also have some fstab problems since you removed the drive, especially if Mandrake no longer feels like this is drive 2.
 
Old 10-23-2009, 11:12 AM   #3
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by pljvaldez View Post
Use any live CD to boot into a linux environment.
I do have a live CD somewhere of Knoppix, however, I don't know how to chroot? I want to get into my Mandrake desktop. I have done this before many years ago when the 1024 cylinder problem existed, back then I had to use a boot floppy to get into my Linux. I no longer have that boot floppy. I don't really want to install grub or anything, using a boot floppy or CD would be fine.

Thanks!
 
Old 10-23-2009, 11:30 AM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
You should be able to use one of the boot tools on the Ultimate Boot CD like XOSL, SmartBoot Manager, or Super Grub Disk. In order to boot, you'll need to figure out the information in the /boot directory of your mandrake install. Things like the kernel image and initrd.

The easiest thing in the long run would be to chroot into the mandrake install and then install grub or lilo to the root partition (i.e. /, not the Master Boot Record of the hard disk). Then use your boot disk to chainload that.
 
Old 10-23-2009, 11:47 AM   #5
ssaha
Member
 
Registered: Feb 2009
Location: Kolkata,India
Distribution: Fedora 8,Ubuntu 8.04, 8.10, 9.04, 9.10
Posts: 108

Rep: Reputation: 18
try this and report back here
http://softwareroxer.blogspot.com/20...der-after.html
 
Old 10-23-2009, 01:28 PM   #6
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
@pljvaldez: I looked on the Ultimate Boot CD under Linux Boot Disks and it has the following entries: Tom's Boot Disk v. 2.0.103, BasicLinux v3.4.0 and Trinux v0.89. Which one should I use? Oh, and I really don't want to/can't afford to mess up this Windows installation, so I am thinking your second paragraph is a good idea. Install the loader into the Mandrake install, and then use a boot diskette to access it, right? Is that what you mean by chainload?

@ssaha: I forgot to mention. Mandrake uses LILO, and not GRUB. I don't even think GRUB was an option on that version. It's possible GRUB would work, however I really REALLY don't want to mess with the disk (MBR) or with the partition where Windows 2000 is. I need it.

I was kind of hoping I could just make a boot diskette that would "see" my Linux partition...
 
Old 10-23-2009, 01:54 PM   #7
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Quote:
Originally Posted by Avatar View Post
Install the loader into the Mandrake install, and then use a boot diskette to access it, right? Is that what you mean by chainload?
That's exactly what I mean by chainloading. You'll want to boot a live CD and do the following
Code:
mkdir /mnt/temp
mount /dev/hda8 /mnt/temp
chroot /mnt/temp
lilo –b /dev/hda8
Of course, change /dev/hda8 to whatever your Mandrake partition is. While you're in the chroot environment, you should also check out your fstab and make sure that it's also pointing at the correct partition now that you've removed a drive.
 
Old 10-26-2009, 08:27 AM   #8
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Is there any way to know what disk/partition Mandrake is on? like a command to see the different drives? I believe it was on hdb3 but it has been a long time and I'm not sure if I remember correctly.
 
Old 10-26-2009, 10:48 AM   #9
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
fdisk -l should list all partitions on a disk.
 
Old 10-26-2009, 10:53 AM   #10
hurry_hui
Member
 
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Blog Entries: 1

Rep: Reputation: 52
Yes there is.

To know in what disk partition the Mandrake resides, boot with Knoppix LiveCD or any CD that uses Grub. When the menu appears, press 'C' to enter Grub prompt.


at 'grub >' enter 'geometry (hd0)' press ENTER then. You can also enter 'geometry (hd1) after that.

Please post both the output here.

We can also boot the Mandrake directly if you install lilo in its root partition.
 
Old 10-26-2009, 11:33 AM   #11
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
OK! I have managed to boot into Knoppix (turns out I had to replace my CD-ROM drive to do so).

Here is the requested output.

Code:
grub> geometry (hd0)
drive 0x80: C/H/S = 0/255/63, The number of sectors = 156312576, /dev/sda
   Partition num: 0,  Filesystem type unknown, partition type 0x7
   Partition num: 4,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 5,  Filesystem type unknown, partition type 0x82
   Partition num: 6,  Filesystem type is ext2fs, partition type 0x83

grub> geometry (hd1)

Error 21: Selected disk does not exist
The disk is a SATA disk. I think partition 5 is a swap drive.

So my command will look like:
Code:
mkdir /mnt/temp
mount /dev/sda4 /mnt/temp
chroot /mnt/temp
lilo –b /dev/sda4
Should the last line be "lilo -b /mnt/temp" instead?

And when I do the above given command to re-install LILO, it won't affect Windows 2000, right?
 
Old 10-26-2009, 11:47 AM   #12
hurry_hui
Member
 
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Blog Entries: 1

Rep: Reputation: 52
So before running the command you should change /dev/sda4 to either /dev/sda5 or /dev/sda7. Yes you're right /dev/sda6 is SWAP.

line 'lilo -b /dev/sda4' is to create boot partition for lilo. /mnt/tmp is your chrooted environment.

As for lilo command, I am afraid I cannot help you, please ask someone else for help.

CMIIW
 
Old 10-26-2009, 11:52 AM   #13
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Well, IIRC, I had the disk partitioned as: sda4=/, sda5=swap and sda6=/home ( could be wrong on the last one but it was for user files)

Why change /dev/sda4 to /dev/sda5? Won't I be chrooting into my swap file then?
 
Old 10-26-2009, 12:03 PM   #14
hurry_hui
Member
 
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Blog Entries: 1

Rep: Reputation: 52
Your swap is in /dev/sda6, somebody CMIIW. Your root is /dev/sda5, home is in /dev/sda7.

If you install Lilo in / partition, you can also try to boot Knoppix disc entering grub prompt and type this.

root (hd0,4) press ENTER
chainload +1 press ENTER
boot press ENTER

HTH
 
Old 10-26-2009, 01:23 PM   #15
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Foiled...

I can't even do the first thing:
"knoppix@Microknoppix:/mnt$ mkdir /mnt/temp
mkdir: cannot create directory `/mnt/temp': Permission denied"

What can I do?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how can a boot sector be repaired to then allow grub to install for chainload booting james2b Linux - Newbie 20 10-08-2009 09:07 PM
How to create a boot sector under Linux? Keithj Linux - Hardware 6 06-17-2008 04:35 PM
Setting up a /boot sector after windows and linux are installed? lifeforce4 Linux - Newbie 11 02-19-2008 04:47 PM
Linux Boot partition - maximum sector on HD VicRic Linux - General 3 10-07-2006 02:47 PM
Linux Installation: Boot Sector too big!! dewang Linux - Software 2 01-15-2001 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:12 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