Linux - NewbieThis 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
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.
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#
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
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.
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.