LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-05-2004, 11:18 AM   #1
escargot22026
LQ Newbie
 
Registered: Aug 2004
Location: Virginia
Distribution: Gentoo
Posts: 25

Rep: Reputation: 15
Angry How do you clean up grub?


I have installed Slackware on a hard drive whose master boot record contains grub. During the configuration step, it runs liloconfig. I was told that the best way to boot is off the mbr, so I selected install onto mbr as the place to install lilo. After installation was complete, I tried to boot up the computer, but it wouldn't recognize that /dev/hda was bootable. The BIOS gave me a "BOOT DISK ERROR - PLEASE INSERT SYSTEM DISK AND PRESS RETURN" error. No, there was no floppy in the drive at that time. The computer would, however, boot up off the floppy I created during installation and into Slackware. I was told that my problem is that grub wasn't removed properly, and that "grub is a bitch to clean up." I followed the instructions given to me: I reformatted the hard drive into FAT32 so that a Win98 boot disk would recognize it, made a Windows 98 boot disk, and ran 'fdisk /mbr' from the boot disk. I did this several times, from different locations (ie. A:\\> fdisk /mbr, C:\\> fdisk /mbr), and then repartitioned and reformated the drive so it was Linux-compatible, and reinstalled Slackware twice as I was instructed. Still wouldn't boot off the hard drive. I installed it one last time, installing lilo on the root partition instead. I booted off the floppy into Slackware, and used Linux's fdisk to make the root partition bootable. Rebooted, still didn't work. This worked when I was using Fedora and grub was on the mbr, and I haven't changed any BIOS settings. What is going on? I would be very appreciative if anyone could give me some help.

Thanks in advance.
Regards,
Edward S. Rice

PS. I'm using the bare.i kernel and my hd is an ATI. That doesn't have anything to do with it does it? The setup installed Slackware on my drive properly with the same kernel. . .

Last edited by escargot22026; 08-05-2004 at 11:22 AM.
 
Old 08-05-2004, 11:31 AM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
There is a command to free mbr in Gnu/Linux :

dd if=/dev/zero of=/dev/hda count=1 bs=446

But before that, did you try to change the switch on hd to auto/cable select and in the bios accordingly, a friend has a similar problem and solved it like that.
 
Old 08-05-2004, 02:01 PM   #3
escargot22026
LQ Newbie
 
Registered: Aug 2004
Location: Virginia
Distribution: Gentoo
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Cedrik
But before that, did you try to change the switch on hd to auto/cable select and in the bios accordingly, a friend has a similar problem and solved it like that.
Change in what way? At the present time, I have two hard drives. The Linux hard drive is on the ribbon cable where it says "MASTER", and the jumper is set so that it is also master. Do you suggest that I switch the jumper to cable select?
 
Old 08-05-2004, 02:13 PM   #4
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Well I don't know in your case, my friend have only one hd...

There is an interesting link for work with the mbr here like save and restore it and load a mbr from the ATAPI site to your hd, read closely.
 
Old 08-05-2004, 03:21 PM   #5
escargot22026
LQ Newbie
 
Registered: Aug 2004
Location: Virginia
Distribution: Gentoo
Posts: 25

Original Poster
Rep: Reputation: 15
Well, I took out the second hard drive just to make things simpler. I set the Linux hd to cable select, and the BIOS recognizes it as master. I performed the dd command you mentioned, and just to make sure it worked, I used dd to do a reverse copy and copy the MBR to a text file. I then converted it to hexadecimal, and read it to confirm that it was completely all zeros. As I had thought, it was. I reinstalled LILO, copied the new MBR to a text file, and it wasn't zeros anymore. I don't know how to read it, but it did say LILO on the top row near the right, so I assume that it is correct.
I boot up, "DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER"


That's not supposed to happen. . .

Any ideas?

Regards,
Edward S. Rice
 
Old 08-05-2004, 03:37 PM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Is the bootable flag set for the partition?
When using cable select with 2-on-1 they should both be set to cable select.
 
Old 08-06-2004, 01:33 AM   #7
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
The command :
dd if=/dev/zero of=/dev/hda count=1 bs=446

fills of zero's the boot sector of the mbr (= location where the bootloader is) but there is another :

dd if=/dev/zero of=/dev/hda count=1 bs=512
fills of zero's the boot sector of the mbr and the data boot record too (dbr = partition table) So with this command your partitions are erased (but maybe it will cleanup the drive)

If switching to cable select did not help, consider re switch the drive to master but do not connect your second drive yet to save it if you did an error in commands.

[edit]

If you save your mbr like :
dd if=/dev/hda of=boot.mbr count=1 bs=512

and then :
xdd boot.mbr

Do you see the 55aa number at the end of the output ?

Last edited by Cedrik; 08-06-2004 at 01:44 AM.
 
Old 08-06-2004, 12:48 PM   #8
escargot22026
LQ Newbie
 
Registered: Aug 2004
Location: Virginia
Distribution: Gentoo
Posts: 25

Original Poster
Rep: Reputation: 15
Ah.. solved the problem. Yes, this is a weird way of doing it, but I reinstalled the operating system that included grub with it, but selected lilo as the boot loader while installing. I then booted up onto that operating system to make sure it worked. Then, I installed Slackware with lilo, and everything worked. I have no clue why it worked, it was just a random attempt... thank you for all your help.

Regards,
Edward S. Rice
 
  


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
want to do a clean install pete424 Linux - Newbie 3 03-04-2005 02:03 AM
Clean install - grub prompt Phlow101 Linux - Newbie 8 12-13-2004 09:10 AM
Make Clean quwaie Linux - General 3 01-16-2004 01:16 PM
clean install, but three selection in the grub wood Linux - General 4 10-25-2003 02:04 PM
How can I do a clean-up? J_Szucs Linux - Newbie 3 04-30-2002 04:17 PM

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

All times are GMT -5. The time now is 02:52 AM.

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