LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub Error 21 on Fresh Ubuntu install (https://www.linuxquestions.org/questions/linux-newbie-8/grub-error-21-on-fresh-ubuntu-install-639930/)

aids4n 05-05-2008 12:34 AM

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

yowi 05-05-2008 03:16 AM

Did you find out what grub error 21 means?

danie_w 05-05-2008 04:35 AM

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?)

yancek 05-05-2008 11:07 AM

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?

nix2ways 05-05-2008 11:10 AM

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.

Larry Webb 05-05-2008 12:43 PM

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.

aids4n 05-05-2008 11:08 PM

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?

Larry Webb 05-06-2008 06:35 AM

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.

PhillipHuang 05-06-2008 09:07 AM

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

aids4n 05-06-2008 02:37 PM

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

Larry Webb 05-06-2008 03:00 PM

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?

aids4n 05-06-2008 06:45 PM

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

Larry Webb 05-06-2008 07:43 PM

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

aids4n 05-06-2008 08:40 PM

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. :)


All times are GMT -5. The time now is 09:34 PM.