[SOLVED] Booting into linux when your boot sector is gone?
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
@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...
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.
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.