LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 07-11-2007, 08:03 AM   #1
seabass
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Rep: Reputation: 0
GRUB problems trying to use Windows and Ubuntu


Hello

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
 
Old 07-11-2007, 08:36 AM   #2
vashsna
Member
 
Registered: Oct 2006
Location: USA
Distribution: Mint, FreeBSD, Gentoo
Posts: 50

Rep: Reputation: 15
Quote:
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.
 
Old 07-11-2007, 09:19 AM   #3
seabass
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
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.
 
Old 07-11-2007, 10:32 AM   #4
vashsna
Member
 
Registered: Oct 2006
Location: USA
Distribution: Mint, FreeBSD, Gentoo
Posts: 50

Rep: Reputation: 15
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.

Quote:
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.
 
Old 07-11-2007, 10:52 AM   #5
seabass
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
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

EDIT:
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

Last edited by seabass; 07-11-2007 at 11:16 AM.
 
Old 07-11-2007, 11:49 AM   #6
vashsna
Member
 
Registered: Oct 2006
Location: USA
Distribution: Mint, FreeBSD, Gentoo
Posts: 50

Rep: Reputation: 15
Quote:
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.


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

Quote:
only to the first partition, to the whole HD
personally i would go with this one.
 
Old 07-11-2007, 01:54 PM   #7
seabass
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
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

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

Last edited by seabass; 07-11-2007 at 03:22 PM.
 
Old 07-11-2007, 05:15 PM   #8
vashsna
Member
 
Registered: Oct 2006
Location: USA
Distribution: Mint, FreeBSD, Gentoo
Posts: 50

Rep: Reputation: 15
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.
 
Old 07-11-2007, 05:34 PM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
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
Code:
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.

Last edited by saikee; 07-11-2007 at 06:01 PM.
 
Old 07-11-2007, 06:16 PM   #10
seabass
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
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.

Last edited by seabass; 07-11-2007 at 06:21 PM.
 
Old 07-11-2007, 06:31 PM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
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.

Last edited by saikee; 07-11-2007 at 06:35 PM.
 
Old 07-11-2007, 07:20 PM   #12
seabass
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
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
A>fixmbr
bad command
A>fdisk/mbr
bad command
C>fixmbr
Invalid media type reading drive C
abort, retry or fail?
C>fdisk/mbr
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.
 
Old 07-11-2007, 07:39 PM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Try NO. 1 but put a space between "fdisk" and "/mbr" like
Code:
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.

Last edited by saikee; 07-11-2007 at 07:50 PM.
 
Old 07-12-2007, 04:59 AM   #14
seabass
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
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?

EDIT:
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)
makeactive
savedefault
chainloader +1

Last edited by seabass; 07-12-2007 at 06:26 AM.
 
Old 07-12-2007, 06:55 AM   #15
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
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
Code:
root (hd0,0)
chainloader +1
boot
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
Code:
chainloader (hd0)+1
boot
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
Code:
sudo grub
root (hd0,4)
setup (hd0)
quit
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 bootdisk.com. 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.

Last edited by saikee; 07-12-2007 at 07:00 AM.
 
  


Reply

Tags
grub



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
Windows wipes out GRUB - can't load Ubuntu! vincebs Linux - General 3 07-17-2006 03:09 PM
GRUB Problems On Installing Windows After Ubuntu!!! crash_override_me Ubuntu 10 06-21-2006 03:53 AM
change boot ubuntu/windows grub The_guy1 Linux - Newbie 2 04-15-2006 01:12 PM
ubuntu: windows took over MBR and can't restore grub eantoranz Linux - Software 3 02-03-2006 08:29 PM
GRUB config for FC3/Ubuntu/Windows AndrewZorn Linux - General 3 04-06-2005 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:13 AM.

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
Open Source Consulting | Domain Registration