LinuxQuestions.org
Help answer threads with 0 replies.
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-17-2009, 02:29 AM   #1
linuxshadow
LQ Newbie
 
Registered: Jun 2008
Posts: 18

Rep: Reputation: 0
Grub 17 Error??


I have never been successful in getting out of this issue ever.
Ubuntu 7.04 was running on my Machine with Win Xp.
Suddenly yesterday I see GRUB 17 Error.

Code:
ubuntu@ubuntu:/boot$ sudo fdisk -l
omitting empty partition (5)

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x31a431a3

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2642    21221833+   c  W95 FAT32 (LBA)
/dev/sda2            2643        5284    21217280    c  W95 FAT32 (LBA)
Partition 2 does not end on cylinder boundary.
/dev/sda3            5285       13058    62444655    5  Extended
/dev/sda4           13059       15608    20482875    7  HPFS/NTFS
/dev/sda5            5285        7158    15052842   83  Linux
/dev/sda6            7159        7290     1060258+  82  Linux swap / Solaris
/dev/sda7            7291        9900    20964793+   b  W95 FAT32
/dev/sda8            9901       12450    20482843+   b  W95 FAT32
/dev/sda9           12451       13058     4883728+  83  Linux
The Linux Partition is /dev/sda5.But I dont know how can I bring grub back.

Now The issue is I have Live/Install CD of Ubuntu.I dont see recovery mode of Ubuntu.So I logged through Live CD.And Enter the grub prompt.
But I din't understand how can I run these commands which says:
Code:
root (hd0,1)
setup (hd0)
I know the above ntry is incorrect but what Will be the right entry seeing my fdisk -l?

Code:
ubuntu@ubuntu:~$ grub
Probing devices to guess BIOS drives. This may take a long time.

       [Minimal BASH-like line editing is supported.   For
       the   first   word,  TAB  lists  possible  command
       completions.  Anywhere else TAB lists the possible
       completions of a device/filename. ]
grub> root(sd1,0)                 
root(sd1,0)

Error 27: Unrecognized command
grub> root (sd1,0)
root (sd1,0)

Error 23: Error while parsing number
grub> root (hd0,0)
root (hd0,0)

Error 21: Selected disk does not exist
grub> root (sd0,0)
root (sd0,0)

Error 23: Error while parsing number
grub> root (sd0,1)
root (sd0,1)
--------------------------------------------------------------------------
root@ubuntu:/boot/grub# grub --device.map=device.map
bash: grub: command not found
root@ubuntu:/boot/grub# grub       
bash: grub: command not found
root@ubuntu:/boot/grub# whereis grub
bash: whereis: command not found
root@ubuntu:/boot/grub# cd ..
root@ubuntu:/boot# ls
System.map-2.6.27-7-generic  initrd.img-2.6.27-7-generic
abi-2.6.27-7-generic         memtest86+.bin
config-2.6.27-7-generic      vmcoreinfo-2.6.27-7-generic
grub                 vmlinuz-2.6.27-7-generic
root@ubuntu:/boot# grub
bash: grub: command not found
root@ubuntu:/boot# cd grub
root@ubuntu:/boot/grub# ls
default        fat_stage1_5      menu.lst         stage1
device.map     installed-version  minix_stage1_5     stage2
e2fs_stage1_5  jfs_stage1_5      reiserfs_stage1_5  xfs_stage1_5
root@ubuntu:/boot/grub# grub
bash: grub: command not found
root@ubuntu:/boot/grub#


pls help
 
Old 01-17-2009, 03:06 AM   #2
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
In Ubuntu you have to run grub undo sudo to do anything meaningful. Otherwise the messages are meaningless. Blame the Ubuntu developers. From a terminal session, try
Code:
sudo grub    <<< Enter your password when asked.
root (hd0,4)
setup (hd0)
quit

Last edited by syg00; 01-17-2009 at 03:32 PM. Reason: Aded the grub command
 
Old 01-17-2009, 10:38 AM   #3
linuxshadow
LQ Newbie
 
Registered: Jun 2008
Posts: 18

Original Poster
Rep: Reputation: 0
Should I try:
Code:
grub (sd0,4)  or (hd0,4)
And one thing to ask you that how will I get grub prompt?Can you explain once again
 
Old 01-17-2009, 11:35 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,217

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
Your fdisk -l output shows Linux on sda5 and sda9. You don't indicate what sda9 is. You said sda5 has your Ubuntu so do what syg00 suggests. You should be able to open a terminal and type: sudo grub, and get to a grub prompt (grub>) and here you enter the commands syg00 suggested. If your Ubuntu root partition is on sda5 that will work.
 
Old 01-17-2009, 03:32 PM   #5
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
Sorry about that - have amended the post above. After the "sudo grub" you will be in grub command mode.

Thanks yancek.
 
Old 01-18-2009, 08:04 AM   #6
linuxshadow
LQ Newbie
 
Registered: Jun 2008
Posts: 18

Original Poster
Rep: Reputation: 0
You mean sd0,4 is the right one...Agreed !!
But Just one Doubt...
You said
Code:
 setup (hd0)
What does that indicate?
Which is the Best way to know on which partition my linux stand at?
 
Old 01-18-2009, 10:27 AM   #7
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:
You mean sd0,4 is the right one...Agreed !!
NO! When you run the fdisk -l command, the partition shows as sda5. In Grub, count begins at zero (0) not one (1) so that (hd0,4) in Grub is the same as sda5 from fdisk.

Quote:
setup (hd0)
root (hd0,4) shows that partition as the root partition where the majority of Grub boot loader files are. The 'setup (hd0)' copies the stage1 file to the master boot record of that drive and has it pointing to the (hd0,4) partition to access the remaining bootloader files of Grub.
 
Old 01-18-2009, 10:14 PM   #8
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,462
Blog Entries: 6

Rep: Reputation: 51
Have You watched a youtube video for "Fixing GRUB Error"
Thats really great Stuff.
All it hints at:

Go to grub prompt:
Code:
grub> cat (hd0, < Followed by tab>
Opens up list of the partitions and try finding the one in  which vmlinuz and initrd stays.
Say hd0,4 in your case
grub > setup (hd0)  < will install your grub >
grub > reboot
Just search at youtube and you will really appreciate the attempt..
BOL
 
Old 01-19-2009, 11:48 AM   #9
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
Quote:
Originally Posted by linuxshadow View Post
Code:
ubuntu@ubuntu:/boot$ sudo fdisk -l
omitting empty partition (5)

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x31a431a3

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2642    21221833+   c  W95 FAT32 (LBA)
/dev/sda2            2643        5284    21217280    c  W95 FAT32 (LBA)
Partition 2 does not end on cylinder boundary.
/dev/sda3            5285       13058    62444655    5  Extended
/dev/sda4           13059       15608    20482875    7  HPFS/NTFS
/dev/sda5            5285        7158    15052842   83  Linux
/dev/sda6            7159        7290     1060258+  82  Linux swap / Solaris
/dev/sda7            7291        9900    20964793+   b  W95 FAT32
/dev/sda8            9901       12450    20482843+   b  W95 FAT32
/dev/sda9           12451       13058     4883728+  83  Linux
Any time fdisk reports an "omitting empty partition(X)" warning, unfortunately that means your partition table is corrupt; that is most likely why you are having problems with Grub. How about posting the output of the following commands:
Code:
sudo fdisk -lu
sudo sfdisk -d
Most likely we can fix your partition table without too much effort, but I need to see the the actual sector boundaries of all your partitions to get a better idea of what might be the cause of your "omitting extra partition(5)" error. We can work from there if you want.

Last edited by CJS; 01-19-2009 at 11:50 AM.
 
Old 01-19-2009, 02:45 PM   #10
fbianconi
Member
 
Registered: Apr 2008
Location: argentina
Distribution: Arch
Posts: 86

Rep: Reputation: 22
My suggestion in order to fix corrupt partition table is using TestDisk
 
  


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
install kubuntu 8.10 with lilo rather than grub (because of grub error 18) dukeinlondon Ubuntu 7 12-27-2008 06:53 PM
Loading Grub 1.5 Please Wait...... Grub Failed Error 18 2words4uready Linux - Newbie 5 06-12-2008 05:37 PM
Grub error 17, and wont reinstall using grub-install! chiefreborn Linux - General 6 06-06-2007 10:29 AM
Grub Error 17: Cannot mount selected partition and other Grub problems Sebastian Naitsabes Linux - General 1 07-05-2005 08:33 AM


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