LinuxQuestions.org
Review your favorite Linux distribution.
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 05-05-2008, 01:34 AM   #1
aids4n
LQ Newbie
 
Registered: May 2008
Posts: 16

Rep: Reputation: 0
Grub Error 21 on Fresh Ubuntu install


I am trying to install Ubuntu onto my 1TB hard disk. This goes well until it asks me to restart (after removing the disk). After doing the Dell BIOS loading, I get a Grub error 21. I have looked around but cannot figure out what to do. I have already burned SuperGrub to a disk but I could not figure how to run it. I am new to Linux. Along with the 1TB hd, I have two 150GB hds. I accidentally wiped those so I have 0 partitions on any of the hds. I popped in the Ubuntu install and told it to use the 1TB drive.

Can anyone give detailed and very very simple steps to fixing this Grub error 21 before I go back to Windows xp :P

Thanks
 
Old 05-05-2008, 04:16 AM   #2
yowi
Member
 
Registered: Dec 2002
Location: Au
Distribution: Debian
Posts: 209

Rep: Reputation: 54
Did you find out what grub error 21 means?
 
Old 05-05-2008, 05:35 AM   #3
danie_w
LQ Newbie
 
Registered: Apr 2006
Location: Centurion, Gauteng, South Africa
Distribution: Fedora 16, Ubuntu 12.04
Posts: 19

Rep: Reputation: 0
I think it was similar to my problem of the menu.lst in /boot/grub which had incorrect (hd0,y) instead of (hdx,y) after installing. Here x denotes the (nth-1) physical hard drive that the BIOS sees - I think? i.e. If your 1TB drive is the 2nd drive in the list that the installer sees (instead of the first one -- hd0 ) then the installer seems to write the "(hd0," part instead of "(hd1," in menu.lst. If was the third drive it should have written the "(hd2," part.
One way of testing this is to boot from a live (or install) CD and mount the required drive and check the /boot/grub/menu.lst and note all the active commands (those not starting with "#")(which you can then type in happily at the grub prompt upon rebooting and changing of course the "0"). If this is the case you "simply" have to fix menu.lst yourself by editing it via the above method (of manually mounting). Need help with mounting?
This is way I am happy with Fedora -- sorry about that, I couldn't resist the temptation ;^).
(You came here without googling "grub error 21", right?)
 
Old 05-05-2008, 12:07 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,871

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Grub error 21 is 'selected disk does not exist'. So Grub can't find the drive. Could be something as simple as a loose connection to your drive. If you need help with this we will need more information. When you installed Ubuntu did you have your other disks connected? What can't you figure out about Super Grub Disk? Where did you instal Grub?

Last edited by yancek; 05-05-2008 at 12:08 PM.
 
Old 05-05-2008, 12:10 PM   #5
nix2ways
LQ Newbie
 
Registered: Sep 2006
Location: Huddersfield, UK
Distribution: Debian
Posts: 22

Rep: Reputation: 15
From the official manual:

21 : Selected disk does not exist
This error is returned if the device part of a device- or full file name refers to a disk or BIOS device that is not present or not recognized by the BIOS in the system.

Some more information would help you get a better answer. Are you dual booting with Windows? If so, how did you set up the partitions with the Ubuntu installer? Is this the Ubuntu installed grub that's returning this error?

You can re-install grub from your Ubuntu live CD as follows:


How to restore Grub from a live Ubuntu cd.

This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter.

Code:
sudo grub
This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands
Code:
find /boot/grub/stage1
This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)
Code:
root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr
Code:
setup (hd0)
Finally exit the grub shell
Code:
quit
That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Last edited by nix2ways; 05-05-2008 at 12:12 PM.
 
Old 05-05-2008, 01:43 PM   #6
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
First it would help if we knew more of the hd setup. Is the 1TB a USB or are all the hd sd or ata? If you can boot your ubuntu disk and from terminal as root give us the result of 'fdisk -ls' without the quote marks.
 
Old 05-06-2008, 12:08 AM   #7
aids4n
LQ Newbie
 
Registered: May 2008
Posts: 16

Original Poster
Rep: Reputation: 0
I deleted all partitions and managed to get ubuntu installed. I can't get my wireless running (but thats another post). I am now trying to install windows xp on one of the other 150gb disks. But when Windows will not let me install on the 150gb disk. It will only let me use the 1tb disk which is partitioned from my Ubuntu install. I would have to delete the partitions to let Windows use the 1tb disk. I want Windows on one of the 150gb disks, not the 1tb. How can I get Windows XP to install on the 150gb disk without trying to make me delete the 1tb partitions to install there?

Last edited by aids4n; 05-06-2008 at 12:30 AM.
 
Old 05-06-2008, 07:35 AM   #8
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Please supply the information I asked for in my previous post. That command will give us your hd arrangement as bios sees them and then can give you a better and more detailed answer on installing your windows.
 
Old 05-06-2008, 10:07 AM   #9
PhillipHuang
Member
 
Registered: Aug 2006
Location: Shen Zhen
Distribution: Ubuntu 10.04
Posts: 198

Rep: Reputation: 33
Hi aids4n,

>After doing the Dell BIOS loading, I get a Grub error 21.
Some Dell products modify their BIOS, and sometimes a few Linux distro can not boot at the first time after install OS successfully. Which type is your Dell PC?

Hope the below is useful.
http://www.linuxquestions.org/questi...ex-320-633869/

-Phillip
 
Old 05-06-2008, 03:37 PM   #10
aids4n
LQ Newbie
 
Registered: May 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Here is the fdisk:

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x008ea730

Device Boot Start End Blocks Id System
/dev/sda1 * 1 120845 970687431 83 Linux
/dev/sda2 120846 121601 6072570 5 Extended
/dev/sda5 120846 121601 6072538+ 82 Linux swap / Solaris

Disk /dev/sdb: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x24fa1af1

Device Boot Start End Blocks Id System

Disk /dev/sdc: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x27392738

Device Boot Start End Blocks Id System
 
Old 05-06-2008, 04:00 PM   #11
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Windows will want to install in the sda hd. You can accomplish this a couple of ways. Probably the easiest is to remove ubuntu and install windows then reinstall ubuntu. With this amount of storage you need to think it through. Do you want an operating system on the 1 tb or would you rather use it for storage. I personally would give about 12 gig to windows and 12 gig to ubuntu and use the rest for combined storage and I would do it on the 160 gig hd. To do this you will have to change the order of your hd boots. Do you plan on using a virtual machine or will you be using more distros and booting from a bootloader such as grub?
 
Old 05-06-2008, 07:45 PM   #12
aids4n
LQ Newbie
 
Registered: May 2008
Posts: 16

Original Poster
Rep: Reputation: 0
What I did was move the two 150gb disks into slots 0 and 1. I put the 1tb disk on slot 2. I partitioned the first 150gb disk in half and installed windows on it. Will install Ubuntu on the other half. I know that I need a root and a swap partition. Do I need to create a home partition if I intend to use the 1tb and second 150gb disks for storage? I have 80007mb of free space on the first 150gb disk. Should I subtract 2gb from that to make a swap partition and use the rest for root?

And when making the swap and root partitions, I would leave the type of partition option to Primary; the Location as Beginning, and the use as option as Ext3. The only things I would change when making either partition is the Mount point (which would be / and swap) and the size. Correct?

edit: saw that there was an option under where the Ext3 was to be swap area. used it. So my question is, I can just use my 1tb and 150gb disks as storage area for both if I partition them as FAT2 right? I don't need to name them /home

Last edited by aids4n; 05-06-2008 at 07:50 PM.
 
Old 05-06-2008, 08:43 PM   #13
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Ok I am not familiar with a ubuntu install but most linux installs will by default find the rest of the first hd and suggest a partition arrangement and ask if you want to use the rest of the disk. Yes linux and windows both will read fat 32files. Doing a default installation should also set you up with a grub menu list which on boot should let you choose between windows or ubuntu. Go for it, we will be around if you have any more questions
 
Old 05-06-2008, 09:40 PM   #14
aids4n
LQ Newbie
 
Registered: May 2008
Posts: 16

Original Poster
Rep: Reputation: 0
It's up and running. Only thing left is to look for my drivers to install in Ubuntu. Thanks for the help. I would of been lost and given up without yall.
 
  


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
Ubuntu 6.10.. Loading Stage 1.5.. Grub Error 2? New install, only o/s?? HELP MEEEE!!! Donkey_kong Linux - Newbie 4 09-01-2011 04:24 AM
GRUB hard disk error on fresh ubuntu RAID install dreamer.redeemer Linux - Software 6 01-30-2008 03:33 AM
Grub error 17 after XP-Ubuntu dual install Grrblt Linux - General 12 09-17-2007 06:00 PM
GRUB (this is what I see after a fresh install) free_andrew Slackware 8 12-10-2003 09:12 PM
Gentoo Grub Error (Fresh Install) dkaplowitz Linux - Distributions 6 11-21-2003 03:55 PM


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