LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-14-2006, 11:35 AM   #1
gherb
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Rep: Reputation: 0
repairing GRUB/bootloader for Suse 8.2


Hi all...newbie here. I have SuSE 8.2 retail version installed and was working fine. However since I reformatted my Win XP partition and reinstalled XP, the boot loader/GRUB has disappeared. I also inadvertently threw out my 8.2 installation discs.

Is there an easy way to repair this without having to download a complete ISO? I wouldn't mind upgrading to 10 but would like to keep all the functionality 8.2. I understand that the open source distro of SuSe 10 is lacking in a lot of packages.

Thank You.
 
Old 01-14-2006, 12:43 PM   #2
anti.corp
Member
 
Registered: Nov 2005
Location: Copenhagen
Distribution: Debian E, Vectorlinux 5.1std, Arch, Gentoo 2006.0
Posts: 576

Rep: Reputation: 30
Hi and welcome to LQ.

Write this in a command line:

Code:
$ ls -l /etc/lilo.conf
If it returns 'no such file or directory' you are using grub.

To restore lilo type the following:

Code:
$ su
It returns:
Code:
Password: <type your root password here>
Then type:
Code:
# /sbin/lilo -v
Thats it.

If you are using grub do the following:

Code:
$ su
It returns:
Code:
Password: <type your root password here>
Then type:
Code:
# grub-install /dev/hda
Thats it.

Hope this helps you out
 
Old 01-14-2006, 12:51 PM   #3
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 18, 19, RHL 5.2
Posts: 546

Rep: Reputation: 43
That's all well and good, but I don't think gherb can get to a command line.

There are a few options open to you. In any case you will need to get a hold of either a Live CD or an installation CD. There is a Live CD for SuSE 8.2 out there. Search and ye shall find. If you have Knoppix or DSL that will work too. Once you have the Live CD you will be able to boot up and gain access to your original install.

You would mount the orignal partitions and then you can go about installing GRUB. The GRUB manual will tell you all you need to know about reinstalling.

I'm not as familiar with SuSE as other distributions, but usually installation CD's will allow you to boot up and go into rescue mode. Once in rescue mode it is the same process of mounting the original partitions and installing GRUB.

Bill

ps - Look into upgrading, you may be suprised at what is available in a newer version. It will also help from a maintenance standpoint.
 
Old 01-14-2006, 01:12 PM   #4
anti.corp
Member
 
Registered: Nov 2005
Location: Copenhagen
Distribution: Debian E, Vectorlinux 5.1std, Arch, Gentoo 2006.0
Posts: 576

Rep: Reputation: 30
Quote:
Originally Posted by wmakowski
That's all well and good, but I don't think gherb can get to a command line.
Maybe. But if he can't reach the command line, it is quite easy to get there using ultimate boot cd, and pick 'drop to console'.

It can be downloaded here:
http://www.ultimatebootcd.com/

He can also use a live cd example Knoppix to get into a terminal.

Last edited by anti.corp; 01-14-2006 at 01:14 PM.
 
Old 01-14-2006, 05:22 PM   #5
gherb
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for the replies. However, I just decided to screw it and stick with Microsoft....


(just kidding...!)

I will try these tomorrow before I go to work. I can get to a DOS command through Windows but obviously not in Linux. not so smart of me to lose the install discs...I just dont know what happened to them...All my discs are usually in one place. I have a bad habit of tidying up and organizing things rather late at night when I have been drinking...

I think you are correct that the GRUB or LILO was installed on the mbr...

Ill start with the ultimate boot CD suggestion...if that doesnt work I will try the live cd...

A few questions about upgrading to SuSe 10, however. The Novell info says that the open source version does not have as many packages as the retail. The list included a lot of key things such as acrobat reader, etc. I dont Necessarily want to shell out the 80 bucks for a retail version. Once I get my 8.1 version working, can I upgrade that to a v10 retail by updating it...or by selectively uploading packages? I am curious how much more funcionality, etc. I would get from upgrading.

Thanks again...all help is welcomed warmly.
 
Old 01-15-2006, 09:16 AM   #6
anti.corp
Member
 
Registered: Nov 2005
Location: Copenhagen
Distribution: Debian E, Vectorlinux 5.1std, Arch, Gentoo 2006.0
Posts: 576

Rep: Reputation: 30
Quote:
Originally Posted by gherb

A few questions about upgrading to SuSe 10, however. The Novell info says that the open source version does not have as many packages as the retail. The list included a lot of key things such as acrobat reader, etc. I dont Necessarily want to shell out the 80 bucks for a retail version. Once I get my 8.1 version working, can I upgrade that to a v10 retail by updating it...or by selectively uploading packages? I am curious how much more funcionality, etc. I would get from upgrading.

Thanks again...all help is welcomed warmly.
If you are planning to upgrade I suggest that you download
SuSe 10 eval. Don't let the 'eval' thing scare you away. This version is in no way crippled.

It's hard to say, how much better the version 10 compared to 8.1. It really depends on your needs. If your replace hardware pretty often, upgrading etc. Then SuSe 10 is the best choice. But on the other hand SuSe 10 is also pretty 'heavy' to run, so unless your PC is pretty much up to date I wont recommend it.

If your good old 8.1 is filling your needs...then I see no reason to mess that up.

 
Old 01-15-2006, 09:19 AM   #7
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,377

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
"Screw it and stick with Microsoft?" Awww... c'mon. Try again. The water's fine. Really.

Here's what happened: when you installed XP, it overwrote the master boot record (MBR), which is what your computer's BIOS uses as the very first stage of "booting" a hard-disk. The MBR is what locates the Windows-NT boot-loader, NTLDR.EXE.

Linux uses one of two boot-loaders, LILO or (I recommend...) GRUB. Both do the same thing, and both of them can boot Windows. You boot-up a Linux "rescue" CD, which gives you a stand-alone copy of Linux, and you use grub-install to put back the Grub MBR. Then, you edit grub.conf to put in the menu-entry for Windows-XP, exactly as the Grub manual explains.

However... the thing that you really should do|have-done is to install Linux on a separate disk-drive. Now you can fool with Linux just as much as you like, just by specifying that drive (rather than the Windows drive) as the one to "boot from." You can do that, if you like, in your BIOS. In this way, you can always .. reliably .. get back to the known-territory of Windows any time you like. You can install or reinstall Windows, on its drive, as often as you wish, without affecting Linux, on its drive, or vice-versa.

Most PC's have two on-board IDE-chains (and external controller-cards are available for a song...), which means that you can install two more drives in addition to the "one" that you have and the CD/DVD-ROM. Any of these devices can be selected for booting.

Don't led one bad learning-experience be your last. It's learning, and every one of us not only has gone through it, but goes through it frequently.
 
Old 01-15-2006, 10:25 AM   #8
spx2
Member
 
Registered: Dec 2005
Distribution: debian
Posts: 160

Rep: Reputation: 30
now for all ppl who are going to try this later
wouldnt it be nice if there was a posibility to store
on a diskette the partition table mbr and stuff
to be able to rewrite it to hdd after someone
messes that up ?
or any command
 
Old 01-15-2006, 11:33 AM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
No need

There is a bootable Grub floppy (or burn into a CD for laptop users) that boots every system in a PC.

If you like I can confirm that there isn't a PC system that cannot be booted by it! I have a box with 100+ systems and everyone answers its call. What is remarkable is you use the same 3 lines to boot any Dos, Windows, BSD, Solaris. You can boot every Linux by the same method too if it has a boot loader inside its root partition.

The problem is people don't realise its power. You can make one in Fedora, Suse or any Linux that has Grub. If you haven't had Grub in the Linux the floppy can still be made from a Live CD that has Grub.

It is also no need to worry about the lost of partition table. Just make a record of it about the size of each partition. The partition table can be re-built from scratch without affecting the data inside the partitions.

I have rebuilt hard disks with 50 to 60 partitions about a dozen times from scratch and have yet to lose my data.

Last edited by saikee; 01-15-2006 at 11:35 AM.
 
Old 01-15-2006, 05:18 PM   #10
gherb
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by antiloaded
Hi and welcome to LQ.

Write this in a command line:

Code:
$ ls -l /etc/lilo.conf
If it returns 'no such file or directory' you are using grub.

To restore lilo type the following:

Code:
$ su
It returns:
Code:
Password: <type your root password here>
Then type:
Code:
# /sbin/lilo -v
Thats it.

If you are using grub do the following:

Code:
$ su
It returns:
Code:
Password: <type your root password here>
Then type:
Code:
# grub-install /dev/hda
Thats it.

Hope this helps you out

Antiloaded...thaks for the help. I used the basic version of the ultimate boot cd, went to the drop console, but when I typed the command lines you suggested it just kept saying "unknown command."

My linux partition is on my hda, which is where my windows OS is as well. Any suggestions?

Meanwhile, I am going to download a live CD from Suse and see if I have any luck with that. If worse comes to worst I can always reformat and reinstall on that linux partition. Or I can use my 18 gig scsi drive, and install Suse 10.0 eval there, assuming my current bios will let me select the scsi as a bootable device. My last mobo would not...

Another option that looks appealing is to create a GRUB bootable floopy as Saikee suggested. Thanks to everyone for the help...we'll get this fixed soon I am sure.

Last edited by gherb; 01-15-2006 at 05:20 PM.
 
Old 01-15-2006, 05:45 PM   #11
gherb
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Newsflash! I found my 8.2 install discs...working from this point to repair GRUB...if no luck I will simply reinstall.

Any suggestions for the repair now that I have the discs?
 
Old 01-15-2006, 06:22 PM   #12
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I have written this so many times but the best standard method to rescue an unbootable Linux is to use a LiVE CD.

Boot to it and find out the partition of your Linux, using command
Code:
fdisk -l
Once you have identify the root partition (i.e. "/") of the Linux, say hda6 then you can made a temp directory in the /mnt of the Live CD linux, mount the unbootable Linux, change root to it and replicate it boot loader into the MBR.
Code:
mkdir /mnt/temp
mount /dev/hda6 /mnt/temp
chroot /mnt/temp
grub-install /dev/hda
exit
reboot
The method work for any Linux. If it uses Lilo replace the grub-install line with
Code:
lilo -b /dev/hda
 
Old 01-15-2006, 06:52 PM   #13
gherb
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
OK, now I have big problems...

I reinstalled Suse 8.2 since so much of my hardware has changed since the first install. Now it seems that GRUB doesn't give me the option to boot into XP. I am worried I formatted over my XP partition which had a lot of my inportant files in it.

I don't think that happened because it looked like the partitions it wanted to reformat were the smaller partitions I had the existing 8.2 (and the swap file? pardon the Windows terminolgy if I used the wrong term.)

When I try to look at the C drive it tells me

Could not mount device.
The reported error was:
mount: wrong fs type, bad option, bad superblock on /dev/hda1,
or too many mounted file systems

I try unmounting the D and E drives in the KDE destop but it tells me

Could not unmount device.
The reported error was:
umount: /windows/D: device is busy

Can someone tell me
first: how I can search for the windows partition to make sure it is still there
second: how I can have GRUB give me the option og booting into Windows by default if no action is taken after, say, 5 seconds?

My wife and I both use the machine and I need the XP environment for her and because I use a lot of the Windows apps for work...


Thanks...


Here's some additional info: in YaST control center Boot loader configuration, the available sections are Linux (default), flopp, and failsafe

Last edited by gherb; 01-15-2006 at 06:58 PM.
 
Old 01-15-2006, 07:30 PM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
The first instruction of my last thread should tell you if your Windows partition is still there as XP uses NTFS partition and has partition ID 0x7 or 7.

Show the content of "fdisk -l" here because I am sure you don't want people giving you advise to erase your XP by mistake.
 
Old 01-15-2006, 07:56 PM   #15
gherb
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by saikee
The first instruction of my last thread should tell you if your Windows partition is still there as XP uses NTFS partition and has partition ID 0x7 or 7.

Show the content of "fdisk -l" here because I am sure you don't want people giving you advise to erase your XP by mistake.
Saikee...thanks for the help. Before I saw this post I had opened xterm and with my brother onj the phone, who is well versed in Linux, had me use fdisk and yes the NTFS partition is still there...so it seems to be an issue with the GRUB.

In an hour or so when he is at home we will try to edit the grub.conf file to add the Windows partition as a bootable option in GRUB.

I'll be sure he reads your post as well before we proceed. I was sure I had not reformatted the NTFS partition but when it wasn't showing in GRUB I almost starded smoking cigarettes again.

Thanks so much. I'll keep you posted.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUSE 10 won't allow me to use GRUB as a bootloader Jongi Suse/Novell 13 02-17-2006 06:47 AM
How can I disable the grub bootloader and enable the lilo bootloader? abefroman Linux - General 1 08-06-2005 08:53 AM
repairing GRUB deardron Linux - Software 5 12-29-2003 04:11 PM
help booting windows on Suse 8.2 Grub bootloader intenseprod Linux - Newbie 1 07-27-2003 10:35 PM
Need help repairing GRUB! Please! DJSpaceMouse Linux - Software 19 05-27-2003 01:44 PM


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