LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB error 22 <linux uninstalled, windows wont boot> (https://www.linuxquestions.org/questions/linux-newbie-8/grub-error-22-linux-uninstalled-windows-wont-boot-640364/)

Snow Keld 05-06-2008 03:41 PM

GRUB error 22 <linux uninstalled, windows wont boot>
 
ok, well i downloaded mandriva linux and made a partition.

this is'nt my computer so i was betting on the fact that i would still be able to boot on Windows, i was unable to, it botted on linux automaticly.

thus i decided to delete the linuz partition (using the disk i installed it with)

now i'm running on the linux disk trying to find out how to fix the mess.

the error that comes up when i try to boot off the hard drive is

GRUB Loading stage1.5…

GRUB loading, please wait…
Error 22



i cant find the windows disk either.





somone please help :(

sfjoe 05-06-2008 04:47 PM

default boot
 
Every install I've ever seen picks up that you have multiple OSes installed and adds them to the grub menu. I believe it defaults to Linux but you can interrupt the boot process manually or set the default OS to be something besides Linux. I think the best way for you would be to go back and reinstall Linux, then when it boots up check the grub documentation for the way to set the default OS.
Another possibility would be to go find a DOS bootable disk and boot into a DOS prompt and type :
fdisk /mbr
I take no reponsibility for what that might hose.

Dazed_75 05-06-2008 04:54 PM

| ok, well i downloaded mandriva linux and made a partition.
|
This is not clear about what you did with existing partition(s) and what new partition(s) you created. Also whether you did this manually or used the install program to do it. So you MAY need to provide more information to get a useful answer.

I am going to make some assumptions (see below) to try to give you an answer now.

|
| this is'nt my computer so i was betting on the fact that i would still | be able to boot on Windows, i was unable to, it botted on linux
| automaticly.
|

This would be normal although there should have been a menu at boot time for a few seconds to allow you to choose whether to boot XP or linux. The menu would have defaulted to linux if you did not make a selection in those few seconds. This is making the assumption that you had not partitioned the disk to get rid of the windows partition.

If you did get rid of the windows partition (whether intentionally or by accident), you are now SOL because you reused that same disk space so windows and the user's data is now wiped out (hopefully they can re-install and restore from a backup). But let's assume the windows partition is still there first.

|
| thus i decided to delete the linuz partition (using the disk i
| installed it with)
|

This is the root of the grub error. When you installed linux, the installatation replaced the windows MBR (Master Boot Record) with a more capable one that gets instructions from a file which is normally in the Linux partition containing instructions on how to boot the system in a variety of ways including to windows (if it still exists). When you removed this partition, the grub MBR could no longer find its instructions and gives the error you mention below. Even if Windows is still present in its own partition, GRUB has no way to find it.

|
| now i'm running on the linux disk trying to find out how to fix the
| mess.
|
|
| the error that comes up when i try to boot off the hard drive is
|
| GRUB Loading stage1.5…
|
| GRUB loading, please wait…
| Error 22
|
|
| i cant find the windows disk either.
|

While running the linux live cd, open a terminal window (there should be a menu entry for that though I don't use Mandriva so I do not know where). Once the terminal is open, type the command "sfdisk -l" without the quotes and press enter. You might have to use "sudo sfdisk -l" depending on how the Mandriva CD is set up. You should get output something like:

Disk /dev/sda: 9729 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 3781 3782- 30378883+ 7 HPFS/NTFS
/dev/sda2 3782 8182 4401 35351032+ 83 Linux
/dev/sda3 8183 9728 1546 12418245 f W95 Ext'd (LBA)
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 9364 9728 365 2931862+ 82 Linux swap/Solaris

Your details will be different, but if you show no lines that begin with /dev/... then all partitions are gone and your friend will need to re-install windows and restore from backup.

If there is at least one such line and the last column of it shows either HPFS/NTFS or FAT32 (or a variation of that), then the windows partition may be intact. In that case all you should have to do is restore the windows boot record and there are a variety of ways to do that documented all over the internet. Here are a couple but it would be good for you to look them up for more complete descriptions before doing them.

1) if your friend has a Windows XP install disk, try booting up with it and selecting the 'R' recovery console. When you get a prompt, type FIXMBR and press ENTER.

2) download and make a CD of the UltimateBootCD or some other recovery disk. Follow the directions they give to restore a windows MBR.

Reboot the machine (without the CD) and, hopefully, windows will be back.
If it is, the C: drive (windows partition) will be smaller than it originally was but can be resized to be the entire disk again. I don't think I will take the time to explain that right now.

Good Luck!

Snow Keld 05-08-2008 09:01 AM

thank you for all of the help, but i raised the question on my own forum as well, i was suggested to install lilo to give the duel boot and choose what operating system to boot from, just always choose windows and it works just fine.


by the way, thank you all for your help, this problem didn't deter me from linux at all (honestly makes me hate windows all the more) i got a new comp today and will be putting linux on it :D (no windows partition this time :P)


All times are GMT -5. The time now is 10:11 PM.