-   Linux - Newbie (
-   -   GRUB problems trying to use Windows and Ubuntu (

seabass 07-11-2007 09:03 AM

GRUB problems trying to use Windows and Ubuntu

Yesterday I decided to install Ubuntu (The latest, Feisty Fawn) onto my computer. The first intallation went completly wrong, and the computer (an ASUS A600 laptop) froze. When I tried to install it again, I noticed that 70 GB of the HD was missing, because the first installation already did a partition.

I asked a Linux knower (Since I'm completly new to Linux) what to do, and he told me to delete the two unused partitions that the first install created. Using the terminal, and then typing sudo fdisk /dev/sda. then deleting them using d. Also the bootflag had to be changed, so that only the partition with Linux would have a star in the list. I did that and all went well for 4 hours, until I wanted to reboot to go into Windows XP. GRUB error 17.

The Linux knower then told me to reinstall Linux. When I did that I was such a dumb ape to use the WHOLE HD. (because he didn't allow me to make a partition with the slidebar), and so I lost Windows. Even worse, Linux couldnt isnstall because of a long error. I tried again and again, but all installs failed. I ended up with 8 Linux partitions, and then I was suggested to throw it all away and start anew (losing everything I had on the computer ofcourse). So I deleted all partitions, and installed Windows and the drivers for my laptop.

When that was ready, I had to reboot, only to get the GRUB error 22.
Now here I am, with an empty computer, with windows that will not boot, a Ubuntu live CD, an ASUS Driver CD and 2 ASUSTEK Recovery CD's.

Since I already looked in this forum i figured that you may wanted the fdisk -l so here it is:

Device Boot start end blocks id System
/dev/sda1* 1 7305 58677381 c w95 FAT32 (LBA)
/dev/sda2 7306 12161 39005820 f w95 ext'd (LBA)
/dev/sda 7306 12161 39005820 b w95 FAT32

Thank you in advance

vashsna 07-11-2007 09:36 AM


When that was ready, I had to reboot, only to get the GRUB error 22.
well first of all the MBR(master boot record) should have been replaced with windows boot up, that's if you did a fresh start on windows and chose to have windows replace the MBR. What windows disk do you use to install it, rescue..?

And for that w95 ext, take a look here.

You may not have to reinstall windows, just install ubuntu again, but set up the partitions yourself. A easy set up is one partition for /, one for /home, and the last one for swap. And make sure you have linux replace the MBR, it should play nice with windows.

seabass 07-11-2007 10:19 AM

I used the Reovery CD of the laptop, and later on the driver CD to install windows. When I printed the partition list before that, there were only Linux partitions and now there are those windows partitions as well. So i figured I did a fresh windows install.

When I do manual partition, it asks me the size (ok I know that), Use it as ... (FAT32,EXT3 etc. got no idea what to pick) and mount point (idem). Sorry but I'm completly new to this. Also, I want to keep using windows aswell.

vashsna 07-11-2007 11:32 AM

Use ext3 for /, and /home then swap is swap it's on the list with ext3 and vfat, etc..
"/" is root this is where the OS, kernel, etc.. are at, /home is your home directory where your personal data is at.
I would recommend you look here and of course the info on linuxquestions to further your venture into linux. Of course the ubuntu web site offers step by step instructions on installing.


later on the driver CD to install windows. When I printed the partition list before that, there were only Linux partitions and now there are those windows partitions as well. So i figured I did a fresh windows install.
The recovery CD reinstalled windows or should have. So when you reinstalled windows the linux partitions from before are still there? Are you using one hard drive? If not windows should have deleted all other partitions. I don't know if you did a clean install of windows, and from the sounds of it with windows not updating the MBR am going to say no. How old is your laptop? And what does this "recovery" CD say on it?
Although to note, a recovery CD is just a image of your windows system with factory defaults, in a manner of speaking. Most if not all "recovery" CD's will have the device drivers on it.

seabass 07-11-2007 11:52 AM

I removed the Linux partitions manually, so there weren't any on the HD. I'm using 1 HD, normally with 2 partitions C and D from windows. My laptop is one year old, and when I boot with the recovery disc I can choose to open a DOS supported by the CD, and I can choose between 3 windows recovery (only to the first partition, to the whole HD, to the whole HD with 2 partitions). Thank you so much for your help till now, I really want my computer back :P

When I edit a partition to
size 3002
type(orsomething) ext3
mount point "/"

it says that during the testing, it found out that there is a not recovered error on the disc. The state now is:

c with 60 GB, ext3, which I try to make a partition at
f with 40 GB FAT32, which I leave alone

vashsna 07-11-2007 12:49 PM


When I edit a partition to
size 3002
type(orsomething) ext3
mount point "/"
Hmmm, well it should be a interactive menu with a number of scroll down menus for you to pick. That's assuming you picked custom set up of partitions.
Are you making root, which am assuming thats 3002MB? I would make it 10GB(10000M) but it depends on all the applications you wish to install. And yes mount point "/", which if you have the option, make it the bootable partition, from what i remember you don't have to do that, but some distro's do. Don't forget about /home, which should be in the some scroll down menu after you click on free space on the drive to edit/create new partition.


I removed the Linux partitions manually
uh, why? Your recovery CD should have removed them, but that's a moot point now.


only to the first partition, to the whole HD
personally i would go with this one.

seabass 07-11-2007 02:54 PM

well this time when I try to make the partition (size 10 GB, ext3, /) It says it has found an error that has not been corrected on the SCSI1(0,0,0)(sda), and it can not continue the process.

So I thought it could be the HD itself. I used Spinrite to do a check on the first partition (since I wanted to make my linux partitions on the first partition, and then the error occurred) but at 30,6087% it started running really slow (about 500 bytes/sec) and it didn't speed up (No errors though). Does that mean that my HD just blew up and I can get a new one?

Thanks in advance

So I can't make partitions on my c. I can't install Ubuntu. My GRUB gives error 22, so I can't go into windows. my list still looks the same:
/dev/sda1* 1 7305 58677381 c w95 FAT32 (LBA)
/dev/sda2 7306 12161 39005820 f w95 ext'd (LBA)
/dev/sda 7306 12161 39005820 b w95 FAT32

I'm turning quite the emo-kid here =P. I'm going to the store tomorrow to see if they can fix the problem, since I'm getting quite annoyed.

vashsna 07-11-2007 06:15 PM

At this point the only thing's i could think of, is you either messed up original partitioning to make room for linux or your hard drive does not like linux. I have never used spinrite, but if you can use this, then you can find a HD scrubber, erase anything, i have not used fdisk in sometime, this program may or may not use it. Somehow wipe the HD, maybe try and find a real windows install disk and start over before you go out and buy a new HD too find out later you really did not need it.

This time make windows with one partition, then install linux which will create the needed space to install by resizing windows partition, am sure there's another way but this is the easiest way that i know. Then do the custom partitioning and so on.

saikee 07-11-2007 06:34 PM

I believe the solution you after is Task B1 or B2 in the last link of my signature.

That should get rid of Grub and boot you Window normally.

When you have Windows running, proceed Ubuntu installation as below

I have installed over 100 distros and believe the correct way to do it is to have the partition ready before the installation.

Your sda1 has 60Gb and I think that can hold at least 3 Windoze inside. You have about 40Gb in the logical partition sda5. If you have just installed Windoze then there should be nothing inside sda5. If this is the case my advice would be :-

(1) Boot up Ubuntu CD and use it as a Live CD

(2) Click "Accessories" then "terminal" and the activate the partitioning program cfdisk by terminal command

sudo cfdisk /dev/sda
Inside cfdisk highlight sda5, select delete, then create sda5 again and make it 10Gb large. You then create sda6 and select 1Gb large, highlight "type" and type "82" for the partition type so that sda6 becomes a swap partition. You should have now

sda5 10Gb partition ID 83 for native Linux
sda6 1Gb Partition ID 82 for swap

You then highlight "write", press return and type "yes" to commit. Then select "quit" and press return to exit cfdisk.
(3) When you modify/create/delete a non-Linux partition, like fat32 in this case, you need to reboot the PC so do it now but leave the Ubuntu CD inside the CDRom .

(4)On a reboot you click hard disk install in Ubuntu desktop. This time you tell the installer to use sda5 for installing Ubuntu and select the "manual" installation , by highlighting sda5, select "edit", format it in "Ext3" filing system, select it to mount "/", then click OK.

(5) When you are asked for the boot loader location you select "MBR".

On completion of the installation there is a 85% that you see Grub again but this time it boots both of your systems.

By the way I have suggested using about 11Gb and there should be about 29Gb unallocated space left inside the hard disk available for future use. I never installed a Ubuntu family distro in a partition larger than 5Gb in the past but recently the hard disk price drops so much I standardise a Linux installation in a 10Gb partition.

seabass 07-11-2007 07:16 PM

cfdisk cannot open disk drive. It looks like the only solution is the HD scrubber or a a steel brush, green soap and a warranty certificate =P

fdisk /mdr (as sudo)
fixmdr (as sudo)

won't work in a terminal, if that was what you meant. It's 2 AM here so I'm getting quite inaccurate.

saikee 07-11-2007 07:31 PM

You have Ubuntu CD, right?

Ubuntu ignores a privileged command issued by a non-root user, as nothing has happened.

Ubuntu accepts a privileged command issued by a non-root user if the command is preceded by "sudo".

Any reason why you ignored my suggested "sudo cfdisk /dev/sda" in Post #9?

Also the Task B1 is done by booting up a bootable floppy! The fdisk there is a Dos version. Linux's version fdisk is a totally different animal!

Task B2 is done by booting a Win2k or XP installation CD!

You have to use Windows own programs to restore Windows MBR.

seabass 07-11-2007 08:20 PM

aaah I see sorry. TO try your solution B1 and B2 I did this:

I booted with my recovery CD from ASUS. It gave me a few options:
- MS-DOS with CD-ROM support
- Recover windows to first partition only
- Recover windows to the entire HD
- Recover windows to the entire HD with 2 partitions

I selected the first, and then used the next lines
bad command
bad command
Invalid media type reading drive C
abort, retry or fail?
Invalid media type reading drive C
abort, retry or fail?

Other CD's I've got from the store are 2 other sets of Recovery CDs (French and English, Dutch being my native), an ASUS A6 Driver and Utility CD and a Nero CD. Am I just missing that boot floppy? If so, can I use the boot floppy of another computer? Sorry for being so inaccurate and sloppy.

For cfdisk /dev/sda, it works perfectly, but I'm still trying to get the mbr fixed first as you said.

saikee 07-11-2007 08:39 PM

Try NO. 1 but put a space between "fdisk" and "/mbr" like

fdisk      /mbr
The fixmbr may not work for you as you have used fat32 partition for XP. fixmbr is known good for xp installed in a ntfs partition and it is "sourced" from the original installation CD.

If you can't fix the MBR for the XP that is no big deal as you don't need it if you have Grub. It is just good for giving you some confidence and also as a good education of what is a MBR.

Once you lose the XP MBR and know how to get it back you will have no fear in booting. That is my message. Just anything to do with boot loaders are recoverable so don't delete a partition or a system just because you don't know how to restore the boot loader. Print out the last link of my signature. It has all the tips you need for the majority of the PC systems.

If you do not have anything in sda5 you can delete it, recreate sda5 and sda6 to install Ubuntu as I have suggested. You may need a pair of sharp eyes when dealing with Ubuntu's installer so take a rest first. The two systems are not going to fly away.

seabass 07-12-2007 05:59 AM

Thank you very much.
A>fdisk /mbr
C>fdisk /mbr
didn't work (same errors as before)
So then I made those partitions, and installed Ubuntu on them with success. When I booted up again, the GRUB worked perfectly. But then, when Ubuntu was loading, it did a forced check on my C, and it found a few dozens of errors, and something like apt-get was not installed (type apt-get install apt, but it didn't work). Also when I opened the GRUB menu I noticed the lack of windows, though the sda1 with windows still exists. Does this mean that my HD is corrupted or windows is corrupted? Now I'm re-installing windows....again. Then I need to do the last step again and see if it works right?

Well I did what I just told, and now I get the fancy GRUB menu with windows included. But this time when I choose windows I get a trap. Is that because the command lines are:
root (hd0,0)
chainloader +1

saikee 07-12-2007 07:55 AM

I don't know how good your XP now. Grub can fire it up using the commands in Post #14.

What I propose to you is try to boot it manually, yes it is cool if you succeed.

When you see Ubuntu Grub screen don't select any system to boot but just press the "c" key and drop yourself into a Grub prompt.

Under the normal circumstance there is NO PC system you cannot boot but you need the systems in good health.

The step to fire up Xp in your case is by commands

root (hd0,0)
chainloader +1

Grub should respond to the first line by saying a partition type "c" has been found, meaning it is fat32
If nothing come out in the second line that means Grub detects no error.
If XP can't boot after the green light (by boot command) has been issued then your XP will most likely needs a re-install.

If you don't know what to do in Grub prompt type "help".

If you want to go back to the original booting screen type

chainloader (hd0)+1

You can install XP back onto the same space and that is the "c" drive. The XP installation will overwrite Grub so you should lose Ubuntu temporarily.

You should concentrate the effort of making XP work first.

At any time you are happy with XP but want to go back to see your mistress Ubuntu you boot up the Ubuntu CD, activate the Grub shell and restore Grub as follow

sudo grub
root (hd0,4)
setup (hd0)
sudo reboot

Now you can go to bed with either XP or Ubuntu from this point onward.


If the fdisk command doesn't work then Asus disc has not supplied fdisk.exe, which is a standard program in MSDOS, in the CD. I would ask for a price reduction, but at the same time get it download from If you have no floppy drive then download FreeDos which has a iso to be burn into a CD. There are so many ways to skin a cat.

All times are GMT -5. The time now is 08:17 AM.