LinuxQuestions.org
Visit Jeremy's Blog.
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 03-14-2009, 06:02 PM   #1
Qbob
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Rep: Reputation: 0
Grub Error 2 after clean install of XUbuntu 8.04


I've just tried to install Xubuntu 8.04 on a mini-ITX-based server box in which I have replaced the hard drive with a new one. I had a server install of Ubuntu 6.10 running without any problems on the old drive.

The XUbuntu install seemed to proceed OK until I tried to boot into the system for the first time. This is when I got "Error 2" from Grub.

The system has a CD drive and the HDD on the same IDE channel. The HDD is set up as slave as was the old one (this is the only arrangement that works because of cable layout, because I only have one suitable cable and the fact that the CD doesn't have jumpers on it to set it to master/slave).

If I disconnect the CD drive and set the HDD jumper to device 0, I am able to boot into the system. However this inconvenient and I had no such problem with the 6.10 install.

I have tried reconnecting the CD and unsetting it as a boot device in the BIOS and the Grub error comes back.

I have no idea what to do now. I have found numerous mentions of this grub error but none seem to apply to my problem.

I'm posting in the newbie forum because, even though I have intermittent experience of dabbling with various Linuxes over many years, I have had no problems before now in getting it to boot. I know nothing about grub other than what I have read this afternoon so I feel like a newbie as far as this issue is concerned!

Any suggestions will be much appreciated!

Qbob
 
Old 03-14-2009, 06:21 PM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
post the contents of your

/boot/grub/menu.lst file



Your CD drive is /dev/sdb?
 
Old 03-14-2009, 06:32 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,527

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Have you tried simply switching the devices between connectors (leave the jumpers alone) ?.
 
Old 03-14-2009, 07:17 PM   #4
Qbob
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
Have you tried simply switching the devices between connectors (leave the jumpers alone) ?.
Because it is a mini-ITX system, space is very tight and the IDE cable isn't a normal one anyway. One of the connectors is for a laptop type IDE connection and the other has a special adaptor hardwired on to it to connect a slimline-style CD drive. I bought the system used a couple of years ago and yesterday was the first time I had opened it up. Now that I know what is inside I might try to get hold of another IDE lead so that I can put the devices on separate IDE channels which might sort this out.

On the other hand, this hardware used to work with the old hard drive and with Ubuntu 6.10 so in theory I shouldn't need to rearrange anything.

Qbob
 
Old 03-14-2009, 07:39 PM   #5
Qbob
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by amani View Post
post the contents of your

/boot/grub/menu.lst file



Your CD drive is /dev/sdb?
OK, with the CD reattached and going into rescue install:

Partitions are /dev/sda1, /dev/sda2, /dev/sda5.

I go into shell in /dev/sda1.

Here the CD shows up as /dev/scd0.

(BTW both CD and HDD are IDE devices. It confused me that they were showing up as /dev/s* but I understand this is normal these days?)

Content of /boot/grub/menu.lst is as follows (NB hand typed as I don't have a way to transfer the listing to here at the moment. I've missed out comment lines):

#...
default 0
timeout 3
hiddenmenu
#...

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0, 0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=... ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic

.. similar section for recovery mode

... final section for memtest86

[EOF]

Any clues?

Thanks

Qbob
 
Old 03-15-2009, 12:13 AM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,217

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
Quote:
Grub Error 2 : Bad file or directory type
This error is returned if a file requested is not a regular file, but something like a symbolic link, directory, or FIFO.
Not quite certain about your set up. You installed Xubuntu on a new hard drive. Did you remove the hard drive on which you had Ubuntu? You show three Linux partitions, sda1, sda2 and sda5. What is on each? Do you have Ubuntu and Xubuntu or just xubuntu?

When you checked on the menu.lst file, did you check to see if you actually had the kernel (vmlinuz) file mentioned in it in the /boot directory?
 
Old 03-15-2009, 03:44 PM   #7
Qbob
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Post

Quote:
Originally Posted by yancek View Post
Not quite certain about your set up. You installed Xubuntu on a new hard drive. Did you remove the hard drive on which you had Ubuntu? You show three Linux partitions, sda1, sda2 and sda5. What is on each? Do you have Ubuntu and Xubuntu or just xubuntu?
I swapped out the old drive for the new one - there is only room for one!
It was clean - as far as Linux installations anyway. I think it had been formatted FAT32 and I tried it out very briefly in a USB caddy - just to check it was functional more than anything else.

Only Xubuntu is installed on the new disk.

The 3 partitions are the ones the Xubuntu installer set up by default.

/dev/sda1 is the majority of the disk and contains bin, boot, ... etc, ..., home, ... root, usr, var, vmlinuz.


If I do fdisk -l /dev/sda in the rescue shell, it tells me the following (note copied by hand from screen display):

Code:
Disk /dev/sda1: 160.0GB 16....  bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x54....

   Device Boot   Start     End    Blocks   Id  System
/dev/sda1 *          1   19281 154874601   83  Linux
/dev/sda2        19282   19457   1413720    5  Extended
/dev/sda5        19282   19457   1413688+  82  Linux swap / Solaris


Quote:
Originally Posted by yancek View Post
When you checked on the menu.lst file, did you check to see if you actually had the kernel (vmlinuz) file mentioned in it in the /boot directory?
I didn't but I have now and it is there.

~~
Qbob
 
Old 03-15-2009, 08:00 PM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,217

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
sda1 is your Linux root partition, sda2 is the extended paritition which can hold logical partitions but no system or data files and sda5 is swap. So, your boot files have to be on sda1 or, not on the system. If you have these two files: vmlinuz-2.6.24-19-generic, initrd.img-2.6.24-19-generic in your /boot directory and all the stage1, stage1.5 files in Grub directory, the entry you posted for Kubunt (root hd0,0) etc...) should work. You might try using the installation CD and re-installing Grub. Login as root:

sudo grub (hit enter key, should get grub prompt: grub>)
root (hd0,0)
setup (hd0)
quit

If this doesn't work, it may be hardware or you may need to clean the machine or it may be a problem with cables. You have no jumpers on the CD, no possibility to set it to Cable Select? How old is the computer?
 
Old 03-16-2009, 06:10 PM   #9
Qbob
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by yancek View Post
... You might try using the installation CD and re-installing Grub. Login as root:

sudo grub (hit enter key, should get grub prompt: grub>)
root (hd0,0)
setup (hd0)
quit
I tried precisely that last night, but to no avail unfortunately.

Quote:
If this doesn't work, it may be hardware or you may need to clean the machine or it may be a problem with cables. You have no jumpers on the CD, no possibility to set it to Cable Select? How old is the computer?
No there is no jumper on the CD.I found a review of my case that indicated that the hard drive had to be slave if only one cable was used. I have ordered a new IDE cable today (it is a standard connector at the motherboard end, laptop at the drive end) so I will try putting the 2 devices on separate channels when that comes.

I have had the machine for 2 years but I bought it used. It was probably a year or two old when I got it. I have actually been really pleased with it as it was fairly cheap, is very small, quiet, low power consumption and ideal for leaving switched on as a server.

Tonight, to rule out the hardware change I have made (i.e. replacing the hard drive) I reinstalled Ubuntu 6.10. I did the command line install from the alternative CD. This installed and booted absolutely fine. It did a repartition of the disk - wiping the 8.04 install - and I let it do the guided partitioning, no input from me, just like I did with 8.04. The same partitions were set up as for the 8.04 install and as far as I could tell the same grub parameters were set.

To me this rules out the new disk as being the source of the problem. Given that I have also tested a Live CD of 8.04 on the system, it seems to me the only thing going wrong is grub and that something must have changed between 6.10 and 8.04.

~~
Qbob
 
Old 03-16-2009, 07:14 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,527

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Mmmm - when you get the blank screen after POST, hit the <Esc> key (you've got 3 seconds). Then pick the recovery option - do you get any better messages ?.
 
Old 03-18-2009, 06:34 PM   #11
Qbob
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
I reinstalled 8.04 having replaced my original failed install of 8.04 with 6.10 to rule out the change in hardware being the source of the problem.

I find that 8.04 now works! I have no idea why because I followed exactly the same installation procedure (default installation, default guided partitioning of whole disk). My new menu.lst looks like my old one etc.

I honestly did not expect that attempting a second installation would make any difference at all and only did it because I had overwritten the first attempt with 6.10.

Anyone coming across this thread with a similar problem: my advice is to try installing again, it might just work a second time!

Thanks to those who so kindly offered their assistance with this. I hope I did not waste their time too much. I guess this one remains a mystery.

~~
Qbob
 
  


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
Xubuntu: Grub Error 2 after fresh install netjack Ubuntu 1 01-11-2009 06:09 AM
GRUB loading, please wait... Error 22 after supposed clean install goucho29 Linux - Newbie 5 01-23-2007 09:05 PM
install grub to new clean hard drive? Hosiah Linux - General 5 07-21-2006 09:02 PM
Clean install - grub prompt Phlow101 Linux - Newbie 8 12-13-2004 09:10 AM
clean install, but three selection in the grub wood Linux - General 4 10-25-2003 02:04 PM


All times are GMT -5. The time now is 10:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration