View Full Version : HOWTO: Restore GRUB (if your MBR is messed up)
vnbuddy2002
April 5th, 2005, 02:07 PM
Restore GRUB quite simple in Ubuntu, instead going through all the "gain root access" and play with shell commands, you can use the Ubuntu installation CD to restore it without going through all kinds of hassles.
Here are the steps:
1. Boot your computer up with Ubunto CD
2. Go through all the process until you reech "[!!!] Disk Partition"
3. Select Manual Partition
4. Mount your appropriate linux partions
/
/boot
swap
.....
5. DO NOT FORMAT THEM.
6. Finish the manual partition
7. Say "Yes" when it asks you to save the changes
8. It will give you errors saying that "the system couldn't install ....." after that
9. Ignore them, keep select "continue" until you get back to the Ubuntu installation menu
10. Jump to "Install Grub ...."
11. Once it is finished, just restart your computer
Good luck!.
remmelt
April 6th, 2005, 06:11 AM
Isn't it easier to do this:
1. Pop in the Live CD, boot from it until you reach the desktop.
2. Open a terminal window or switch to a tty.
3. Type "grub"
4. Type "root (hd0,6)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
5. Type "setup (hd0)", ot whatever your harddisk nr is.
6. Quit grub by typing "quit".
7. Reboot.
I may be missing your point though, if so, please forgive me :)
Restore GRUB quite simple in Ubuntu, instead going through all the "gain root access" and play with shell commands, you can use the Ubuntu installation CD to restore it without going through all kinds of hassles.
Here are the steps:
1. Boot your computer up with Ubunto CD
2. Go through all the process until you reech "[!!!] Disk Partition"
3. Select Manual Partition
4. Mount your appropriate linux partions
/
/boot
swap
.....
5. DO NOT FORMAT THEM.
6. Finish the manual partition
7. Say "Yes" when it asks you to save the changes
8. It will give you errors saying that "the system couldn't install ....." after that
9. Ignore them, keep select "continue" until you get back to the Ubuntu installation menu
10. Jump to "Install Grub ...."
11. Once it is finished, just restart your computer
Good luck!.
vnbuddy2002
April 6th, 2005, 12:12 PM
:) Your way is definately faster, but for newbies, many of them try to avoid command line as much as possible. That is why I brought up an alternative.
Tomy
April 6th, 2005, 07:53 PM
:) Your way is definately faster, but for newbies, many of them try to avoid command line as much as possible. That is why I brought up an alternative.
Hey thanks, I never thought of doing this. It worked great for me today.
Last time I messed up grub I used the Live CD method but did not write anything down so today I searched for "grub" and found this post. But I couldn't find a Live CD so I used your method with the Install CD.
Thanks
Tomy
wernst
April 8th, 2005, 01:21 PM
Don't forget that this method, as described, puts GRUB back on the MBR (master boot record) of the hard drive instead of in the root parititon. This is fine for most people, but not if you already have an alternative boot manager.
In other words, if you use something like Boot Magic or System Commander, the commands you've just read will overwrite what you've got.
If you've installed GRUB into the Root Partition instead of the MBR, the commands are a little different. Here's are the instructions that I have for my system:
How to Restore the Grub Menu after a Re-Ghosting:
1. Boot from a Live CD, like Ubuntu Live, Knoppix, Mepis, or similar.
2. Open a Terminal. Go SuperUser (that is, type "su"). Enter root passwords as necessary.
3. Type "grub" which makes a GRUB prompt appear.
4. Type "find /boot/grub/stage1". You'll get a response like "(hd0)" or in my case "(hd0,3)". Use whatever your computer spits out for the following lines.
5. Type "root (hd0,3)".
6. Type "setup (hd0,3)". This is key. Other instructions say to use "(hd0)", and that's fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as "(hd0,3)".
7. Type "quit".
8. Restart the system. Remove the bootable CD.
Hope this helps. Since I use Norton Ghost to make regular backups and restores (I do a lot of testing), I do this all the time...
-Warr
rpakdel
May 12th, 2005, 09:35 AM
Here is another way:
1. Boot with any live CD (I've done it with Knoppix 3.x and Ubuntu)
2. Get a root shell and make a folder (mkdir ubuntu)
3. mount the root (/) partition of ubuntu (e.g. mount /dev/hdb ubuntu if you have two disks)
4. chroot the mounted partition (chroot ubuntu)
5. grub-install /dev/hda [1]
5. Exit the shell
6. Reboot
[1] Important: If you are multi-booting with Windows, make sure you do NOT install the MBR on the active partition (say /dev/hda1) but on the drive (/dev/hda). At least with Windows XP, you will have to re-install it (FIXMBR/FIXBOOT won't work).
Heliode
May 12th, 2005, 10:36 AM
Since all you need for these fixes is a command prompt, you don't need to load the GUI. For Knoppix I believe you type something like 'knoppix 3'. For the Ubuntu Live-cd I don't know. I'll edit this post when I figure it out.
H3AsO4
June 10th, 2005, 05:20 PM
at step 10, I encountered a problem: it asks you if you want to proceed when you click the Install Grub, and in all the previous steps, "yes" or "continue" was the correct response, at step 10, if you select "yes" the ubuntu disk will proceed and attempt to install ubuntu.... which will ruined my current install... ah well.... :(
Restore GRUB quite simple in Ubuntu, instead going through all the "gain root access" and play with shell commands, you can use the Ubuntu installation CD to restore it without going through all kinds of hassles.
Here are the steps:
1. Boot your computer up with Ubunto CD
2. Go through all the process until you reech "[!!!] Disk Partition"
3. Select Manual Partition
4. Mount your appropriate linux partions
/
/boot
swap
.....
5. DO NOT FORMAT THEM.
6. Finish the manual partition
7. Say "Yes" when it asks you to save the changes
8. It will give you errors saying that "the system couldn't install ....." after that
9. Ignore them, keep select "continue" until you get back to the Ubuntu installation menu
10. Jump to "Install Grub ...."
11. Once it is finished, just restart your computer
Good luck!.
jsimmons
June 24th, 2005, 08:29 AM
I currently have a mobile rack so that I can have Ubuntu on one drive, and Windows on another. When I need to change OS's, I turn off the system, swap drives, and turn it back on again. I've decided this is too much of a hassle (and not necessarily easy on the electronics).
I am going to install another SATA drive and I want to move my current Ubuntu install over to that drive (without having to reinstall Ubuntu), and then setup GRUB on my Windows drive so I can dual boot.
Will I experience any problems doing this? The reason I ask is because I'll be moving Ubuntu from /dev/hda to /dev/sdb, and I'm wondering if any OS-specific stuff cares about that kind of thing.
Should I just throw in the towel and reinstall Ubuntu from scratch on the new drive, or is what I want to do doable?
Rikko
August 24th, 2005, 10:26 PM
Hi guys,
The problem I'm having is that Ubuntu installed GRUB onto /hdb1, but my primary partition (as far as my BIOS is concerned) is /sda1
I can run 'grub' and reinstall grub like described by remmelt, but I don't know what the ID of /sda1 is. (hd1,0)? (hd2,1)? What command can I use to get the mapping?
I'm able to boot off the Live CD only at the moment.
Tomy
August 25th, 2005, 10:00 PM
Hi guys,
The problem I'm having is that Ubuntu installed GRUB onto /hdb1, but my primary partition (as far as my BIOS is concerned) is /sda1
I can run 'grub' and reinstall grub like described by remmelt, but I don't know what the ID of /sda1 is. (hd1,0)? (hd2,1)? What command can I use to get the mapping?
I'm able to boot off the Live CD only at the moment.
From the grub prompt trying using the <tab> key to see what choices you have.
grub> root (<tab>
Tomy
Rikko
August 26th, 2005, 01:23 AM
From the grub prompt trying using the <tab> key to see what choices you have.
grub> root (<tab>
Tomy
Thanks Tomy, that got me a little farther.. Now I'm getting a "Partition type is 0x7" (or something very similar - I've since booted back into Windows)... Maybe I'm misunderstanding Grub but I thought it could just be placed into the MBR without needing any partition space.
Or can I mix up the setup() and root() commands to install Grub into sda1's MBR but store the actual files needed on /hdb1?
Geez, just when you thought you know something about computers... :)
j.hill
August 26th, 2005, 08:58 PM
Hey thanks, I never thought of doing this. It worked great for me today.
Last time I messed up grub I used the Live CD method but did not write anything down so today I searched for "grub" and found this post. But I couldn't find a Live CD so I used your method with the Install CD.
Thanks
Tomy
For some reason the Live CD method doesn't work for me. I boot from the Live CD and open a terminal, which tells me "command not found" when I type "grub."
Anyone know what this is about?
Rikko
August 27th, 2005, 10:42 PM
For some reason the Live CD method doesn't work for me. I boot from the Live CD and open a terminal, which tells me "command not found" when I type "grub."
Anyone know what this is about?
I had that as well - the Live CD doesn't seem to actually have the grub command available..
Do you already have Ubuntu installed on a physical drive and just want to reinstall Grub? If so, you just need to mount it. My steps:
Drop to a root terminal
mkdir hda1
mount /dev/hda1 hda1 (mounts that device into ./hda1)
cd hda1/sbin
./grub
Replace hda1 with whatever the physical drive that Ubuntu is installed on happens to be.
Worked for me - I'm just stuck trying to actually install Grub on my NTFS partition somewhere.
j.hill
August 28th, 2005, 09:58 AM
I had that as well - the Live CD doesn't seem to actually have the grub command available..
Do you already have Ubuntu installed on a physical drive and just want to reinstall Grub? If so, you just need to mount it. My steps:
Drop to a root terminal
mkdir hda1
mount /dev/hda1 hda1 (mounts that device into ./hda1)
cd hda1/sbin
./grub
Replace hda1 with whatever the physical drive that Ubuntu is installed on happens to be.
Worked for me - I'm just stuck trying to actually install Grub on my NTFS partition somewhere.
So if my computer is using the notation "hd0" for this sort of thing, I would type
mkdir hd0
?
Seems almost too easy.
Will this conflict in any way with the current location of Grub? And, if this works, will I still edit the Grub menu in /boot/grub/menu.lst?
And is there any danger of seriously screwing up my computer with this method? I'm still an abject n00b, so I'm sort of reluctant to try anything risky.
j.hill
August 30th, 2005, 07:00 PM
Can't I just reinstall Grub through Synaptic?
filemanager
August 31st, 2005, 09:24 AM
I had that as well - the Live CD doesn't seem to actually have the grub command available..
Do you already have Ubuntu installed on a physical drive and just want to reinstall Grub? If so, you just need to mount it. My steps:
Drop to a root terminal
mkdir hda1
mount /dev/hda1 hda1 (mounts that device into ./hda1)
cd hda1/sbin
./grub
Replace hda1 with whatever the physical drive that Ubuntu is installed on happens to be.
Worked for me - I'm just stuck trying to actually install Grub on my NTFS partition somewhere.
at the cd hda5/sbin step I'm getting this error:
bash: cd: hda5/sbin: No such file or directory
j.hill
September 1st, 2005, 10:45 PM
Here is another way:
1. Boot with any live CD (I've done it with Knoppix 3.x and Ubuntu)
2. Get a root shell and make a folder (mkdir ubuntu)
3. mount the root (/) partition of ubuntu (e.g. mount /dev/hdb ubuntu if you have two disks)
4. chroot the mounted partition (chroot ubuntu)
5. grub-install /dev/hda [1]
5. Exit the shell
6. Reboot
[1] Important: If you are multi-booting with Windows, make sure you do NOT install the MBR on the active partition (say /dev/hda1) but on the drive (/dev/hda). At least with Windows XP, you will have to re-install it (FIXMBR/FIXBOOT won't work).
I'm stuck on steps 3 and 4. For step 3, the computer gives me the following ambiguous message: does this mean that I've successfully mounted what needed mounting?
root@ubuntu:/home/ubuntu # mount -t ext3 /dev/hda/ubuntu
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .
Then, when I try to chroot, I get this:
chroot: cannot run command `/bin/bash': No such file or directory
This last bit really confuses me. Obviously /bin/bash exists; I'm using a bash shell to give the chroot command.
What does it all mean?
dragon slayer
September 18th, 2005, 11:01 PM
you can use use ultimate boot cd to rewrite the mbr it's very easy.
download and burn as an iso at http://ubcd.sourceforge.net/download.html .
:) I wanted to get rid of lilo after I tried xandros. Xandros leaves lilo on your mbr, it worked great, it has a lot of tools to :)
vnbuddy2002
September 19th, 2005, 12:42 PM
You had specified the wrong mount syntax. It should be
sudo mkdir /mnt/ubuntu
sudo mount -t ext3 /dev/hda[0 .. whatever here ] /mnt/ubuntu
Make sure you know which partition you are trying to mount
sudo fdisk -l
-----
I'm stuck on steps 3 and 4. For step 3, the computer gives me the following ambiguous message: does this mean that I've successfully mounted what needed mounting?
root@ubuntu:/home/ubuntu # mount -t ext3 /dev/hda/ubuntu
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .
Then, when I try to chroot, I get this:
chroot: cannot run command `/bin/bash': No such file or directory
This last bit really confuses me. Obviously /bin/bash exists; I'm using a bash shell to give the chroot command.
What does it all mean?
rj686
September 19th, 2005, 06:43 PM
how do u mount your appropriate partitions if u can't get past the manual partition screen?(install cd) u just press enter and it doesnt go away.
Xian
September 19th, 2005, 06:48 PM
how do u mount your appropriate partitions if u can't get past the manual partition screen?(install cd) u just press enter and it doesnt go away.
You set the mount points by highlighting partitions in the selection list.
Press the enter key and then edit the mount point.
Do this for each partition.
Then select "Finish partitioning...."
It will ask for confirmation.
ghostintheshell
September 22nd, 2005, 10:12 PM
Aaargh!! Thank you guys!! Very very very much!! You saved my virtual life!
I lost my Grub / MBR and YOU restored it!
After searching too much time on the web, I fell on this topic. I read it completely and applied a mix of your solutions.
Here's the steps I followed to restore GRUB / my initial MBR:
1. Boot with any live CD (I've done it with Ubuntu Live DVD)
2. Get a root shell -> Applications / System Tools / Root Terminal
3. Make a folder -> mkdir /mnt/ubuntu
4. Check the Ubuntu partition -> fdisk -l (Mine is /dev/hda4)
5. Mount the root partition of Ubuntu -> mount -t ext3 /dev/hda4 /mnt/ubuntu (replace /dev/hda4 by your Ubuntu partition determined at the step 4)
6. Chroot the mounted partition -> chroot /mnt/ubuntu
7. Restore Grub / the initial MBR -> grub-install /dev/hda
8. Exit the shell
9. Reboot
That did the trick for me.
Thank you very much again to all of you! ( :bigsmack: )
TakisX
October 10th, 2005, 04:32 PM
When i give fdisk -l nothing hapens
When i give grub-install /dev/sda it says that there is not exista such partition
And the other method
1 boot with live cd
2 give grub ok
3 root (hd0,3) and partition not found
what to do ?
kozaki
October 22nd, 2005, 08:32 AM
UP,
Anybody correct me if I'm wrong,
SATA hard drive where to install grub (MBR) might be (sd0) right ?
willalbro
October 23rd, 2005, 10:20 PM
Well...I run 2 SATA drives with Winblows on one and Ubuntu as my primary drive. I believe your SATA drive would be referred to by GRUB as /dev/sda for primary and /dev/sdb for slave. If you want the primary partition on your primary SATA drive then it would be /dev/sda1. The (hd0,0) naming convention still holds true as well but I digress.
KrazyPenguin
October 30th, 2005, 04:28 PM
I was having problems with my Wife's computer, which is the exact same setup as mine.
Both are an Asus Motherboard but hers is newer.
The problem she was experiencing was the Grub would lock for about 1 minute at stage 1.5.
I did what the dude said in the first post and tried the Install CD.
When I got to partitioning I changed Primary #1 (Breezy is on primary #2 but I don't think that matters).
Primary #1 was mounted as /media/hda1 so I changed it to /
Then I continued and then tried to reisntall grub.
The computer locked up. :(
I rebooted it and this is WEIRD. It no longer gets stuck in GRUB Stage 1.5.
HAPPY HAPPY !!!!
But at the same time :confused:
None of the grub reinstalled. It was stuck at 0%.
I don't care about reasons. It works. That is all that matters.
;-)
rodent43
November 4th, 2005, 04:55 AM
this thread is great and i am hoping it will help me when i get home...but i just gonna post what i have done to my PC here as i am a noob and really done something great :confused:
OK, i have Windows XP x64 on the SATA 1 (200Gb) and after using Ubuntu 5.04 at work i decided to try 5.10 at home...
so i purchased a cheap 80gb SATA and put it in as SATA 2...so far so good...
I installed 64 bit version of 5.10 on to the sata 2 (sdb) drive and all went on ok, grub then wanted to install mbr to hd0,0 and i let it...
once i rebooted i got no selection or grub, windows just booted up...
so i then tried the install again and this time at the grub stage i specified to install the mbr at /dev/sda and then rebooted...this time my screen just scrolled throuhg saying grub grub grub grub (you get the idea)
so i got the ultimate boot cd off the net and used something named cag or gag...that worked for booting the windows drive but not linux
so is there any way i can sort grub out?
i dont mind reinstalling the ubuntu system as i have not even got it to boot yet, so i still need to do the finishing install on that...
any help will be much appreciated...
rodent43
November 7th, 2005, 05:23 AM
ok thought i would update this but i am still having problems if anyone would care to help me out
i also have 2 IDE drives on a PCI ide card in removable drive bays...if i take those out and install ubunut, grub works fine but once i put those back on grub reports
error 17
any help?
daibak
November 9th, 2005, 04:21 PM
After being struck by Ubuntu Breezy Install CD GRUB Error 21 this newbie will proceed more warily. Had to rebuild Windows XP from scratch on HP notebook with factory recovery disks that only took me two weary days incl. all the downloading of three years' computing on this machine. But hey, I'm not ready to give up!
Well now I've clobbered GRUB and MBR on Windows C: drive the original Ubuntu Breezy root and swap partitions I set up on external Firewire Seagate hard drive by Guided Partitioning are probably all that's left intact.
These two Linux partitions were formatted on external SCSI1 (sda) drive by Breezy install partitioner as:
#1 of SCSI1 (0,0,0) (sda) ext3 - I understand this is root, so sda0
#9 of SCSI1 (0,0,0) (sda) swap - logical drive in extended partition, so sda9
Does this mean I can now boot with Ubuntu 5.10 LiveCD and follow the steps below, merely substituting my root partition of Ubuntu as /dev/sda0 in Step 5 (this is the active, primary partition on the external Seagate), and I'll then be back to a dual boot that works for Windows and Breezy off C (hda)? Or not?
Or does someone know a Breezy cheatcode like Knoppix 4.0.2's LiveCD lets you type at first boot prompt
knoppix offhd=/dev/sdaX if you've dumped Knoppix LiveCD earlier on drive X?
Thanks to ghostintheshell for this post, the closest I found - I think - to what I'm seeking.
Aaargh!! Thank you guys!! Very very very much!! You saved my virtual life!
I lost my Grub / MBR and YOU restored it!
After searching too much time on the web, I fell on this topic. I read it completely and applied a mix of your solutions.
Here's the steps I followed to restore GRUB / my initial MBR:
1. Boot with any live CD (I've done it with Ubuntu Live DVD)
2. Get a root shell -> Applications / System Tools / Root Terminal
3. Make a folder -> mkdir /mnt/ubuntu
4. Check the Ubuntu partition -> fdisk -l (Mine is /dev/hda4)
5. Mount the root partition of Ubuntu -> mount -t ext3 /dev/hda4 /mnt/ubuntu (replace /dev/hda4 by your Ubuntu partition determined at the step 4)
6. Chroot the mounted partition -> chroot /mnt/ubuntu
7. Restore Grub / the initial MBR -> grub-install /dev/hda
8. Exit the shell
9. Reboot
That did the trick for me.
Thank you very much again to all of you! ( :bigsmack: )
apps4apps
November 13th, 2005, 11:55 AM
Aaargh!! Thank you guys!! Very very very much!! You saved my virtual life!
I lost my Grub / MBR and YOU restored it!
After searching too much time on the web, I fell on this topic. I read it completely and applied a mix of your solutions.
Here's the steps I followed to restore GRUB / my initial MBR:
1. Boot with any live CD (I've done it with Ubuntu Live DVD)
2. Get a root shell -> Applications / System Tools / Root Terminal
3. Make a folder -> mkdir /mnt/ubuntu
4. Check the Ubuntu partition -> fdisk -l (Mine is /dev/hda4)
5. Mount the root partition of Ubuntu -> mount -t ext3 /dev/hda4 /mnt/ubuntu (replace /dev/hda4 by your Ubuntu partition determined at the step 4)
6. Chroot the mounted partition -> chroot /mnt/ubuntu
7. Restore Grub / the initial MBR -> grub-install /dev/hda
8. Exit the shell
9. Reboot
That did the trick for me.
Thank you very much again to all of you! ( :bigsmack: )
Hi All,
I ran out of space on my original HD and am trying to get a cloned version on a larger drive running but am hitting a large brick wall. The closest I seem to have come so far is to boot with the live CD and try the suggestion above. The problem that I'm running into however is that it won't seem to let me mount the partition. Using fdisk -l to get the partition info to mount I see /dev/hda5 as Linux LVM with an id of 8e. When I try and mount /dev/hda5 I get: /dev/hda5 already mounted or /mnt/ubuntu busy
Any suggestions would be greatly appreciated...
theswan
November 13th, 2005, 08:30 PM
Restore GRUB quite simple in Ubuntu, instead going through all the "gain root access" and play with shell commands, you can use the Ubuntu installation CD to restore it without going through all kinds of hassles.
Here are the steps:
1. Boot your computer up with Ubunto CD
2. Go through all the process until you reech "[!!!] Disk Partition"
3. Select Manual Partition
4. Mount your appropriate linux partions
/
/boot
swap
.....
5. DO NOT FORMAT THEM.
6. Finish the manual partition
7. Say "Yes" when it asks you to save the changes
8. It will give you errors saying that "the system couldn't install ....." after that
9. Ignore them, keep select "continue" until you get back to the Ubuntu installation menu
10. Jump to "Install Grub ...."
11. Once it is finished, just restart your computer
Good luck!.
hello there!
at first time my GRUB works fine...but when i get back to Windows XP and use partitionmagic to do some partioning on some unused space (not the linux drive or swap), then my GRUB failed to work...=( at start i get an ERROR 22.
@vnbuddy2002: i think i'll better follow your instructions as the only LIVE cd i've got is the one that comes with OpenCD. also, i'm not yet really familiar with commandlines thingy in Linux.
just like to ask what do you mean by number 4 in your instructions above?
do you mean the error in number 8 is like 'cannot install because no root directory is found'?
thanks for any help. cheers!
mcrane
November 13th, 2005, 09:03 PM
ok thought i would update this but i am still having problems if anyone would care to help me out
i also have 2 IDE drives on a PCI ide card in removable drive bays...if i take those out and install ubunut, grub works fine but once i put those back on grub reports
error 17
any help?
Sounds like the same problem I'm having. Unfortunately, I can't unplug the drives on the PCI IDE controller (Promise FastTrack66) because one of them contains my Ubuntu installation.
rodent43
November 14th, 2005, 12:04 PM
i dont want to uplug either as they contain my files and games etc...
i am kinda stuck now and either going to try another flavour of linux or just stay on windows :'(
ajgreeny
November 21st, 2005, 04:11 PM
When I install ubuntu I do the default of putting grub in the MBR. Once that is up and running I make sure that my floppy drive is listed in /grub/boot/device.map as
(fd0) /dev/fd0
and if it's not there I add it exactly as shown. (If you don't do this the next bit will fail).
I then do a
sudo grub-install fd0
which gives me a floppy grub boot disk from which I can start up if the mbr gets messed up in some way. Once you've started up you can put grub back on the mbr by doing a
sudo grub-install /dev/hda
OK, I realise this is only any use for people with a floppy disk drive and it can get messed up if you update your linux version and that doesn't update grub for some reason, but so far, touch wood, it's always worked for me, and as long as you know what the linux version update was you should be able to edit the grub menu by highlighting the specific entry in the menu and hitting e, and then changing the numbers on the particular linux entry.
Hope this helps and that I have got things right. Perhaps if my understanding of things is a bit flaky, someone can let me know.
jars_u
November 24th, 2005, 11:05 PM
Ok, I know I'm new at Linux - I've tried several of the different suggestions posted and still no luck dual booting. From the install CD the only thing I can manage is a complete install - nothing with just install GRUB. No luck with the various command line options from the live CD either - although I admit there is bound to be some user error there. Any other suggestions to my specific circumstances will be appreciated. Kubuntu is up and running no problem just can't get back to WinXP.
IDE1 Slave (hdb) (old salvaged HD currently NTFS but plan to reformat for FAT32 once I get dual boot working for file sharing)
SATA (0,0,0)(sda)
#1 Primary NTFS (my WinXP files)
#2 Primary NTFS (kind of an accidental partition but empty at the moment)
#3 Primary ext3 (Kubuntu)
#5 logical SWAP
I've tried the default setting for GRUB at least 3 times during install with no luck, last try was to /dev/sda3 also nothing at boot I get no options and LILO comes up and Kubuntu starts no problem.
Have not tried correcting problem via WinXP re-install for fear of ruining my files (I did back up the key stuff prior to partition) and having a system that is totally dead.
Any help will be greatly appreciated.
jars_u
November 25th, 2005, 07:24 AM
Here are the contents of my menu.lst if that will help:
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/sda3 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,2)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single
## nonaltoption boot targets option
## This option controls options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## ## End Default Options ##
title Ubuntu, kernel 2.6.12-9-386
root (hd1,2)
kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/sda3 ro quiet splash
initrd /boot/initrd.img-2.6.12-9-386
savedefault
boot
title Ubuntu, kernel 2.6.12-9-386 (recovery mode)
root (hd1,2)
kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/sda3 ro single
initrd /boot/initrd.img-2.6.12-9-386
boot
title Ubuntu, memtest86+
root (hd1,2)
kernel /boot/memtest86+.bin
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Home Edition
root (hd1,0)
savedefault
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
xristos
November 25th, 2005, 07:29 AM
I may be missing your point though, if so, please forgive me :)
This way the user must know the correct hd(0,6) .
So I believe that this way is actually more complex
jars_u
November 25th, 2005, 10:22 AM
Ok, sort of figured out my problem. The offender was a 2nd PATA drive I had salvaged from an old computer and installed in my machine. When I removed that and did a clean install of Kubuntu on the partition I had made previous on my SATA drive - the defaults for GRUB worked fine. I can now get back into Windows (who ever thought I would be so happy to the see the Windows welcome screen...) and can also boot to Kubuntu.
Going to try and few other things and see if I can't get that old PATA working and remort it for FAT32 - should be able to use it to share files between Win/Linux right?
Now for the easy question - how do I extend the default time that GRUB gives you to make a selection?
ghostintheshell
November 25th, 2005, 11:19 AM
[...]
Now for the easy question - how do I extend the default time that GRUB gives you to make a selection?
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.bkp
sudo gedit /boot/grub/menu.lst
and modify here:
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 1
timeout X ==> X sec.
commodore
November 26th, 2005, 10:00 AM
I have two grubs accidently. They are on different partitions. Someone sayd I should reinstall grub. I tried to install it on where it was first, but I get this: xfs_freeze: specified file ["/boot/grub"] is not on an XFS filesystem
commodore
November 26th, 2005, 10:36 AM
Ok I am going to tell everything now. I wanted to install a second Ubuntu for testing stuff on it so that I don't mess up my primary Ubuntu install. I wanted to do some partitioning with gparted. It gave me two errors and later it showed that I don't have partitions on my second harddrive (where both Ubuntus are now installed) just unpartitioned space. I didn't make a notice of it. I booted into windows (yes, I have windows too) and it worked (windows has a bit of that second harddrive too :D). Later I installed the second Ubuntu, but when I wanted to go to the primary Ubuntu (I hadn't done it for some time) it didn't work. It gave me an error similar to "can't start tty, job control turned off". I posted a thread to get help and someone said "have you tried reinstalling grub" and gave me a link to this thread. I tried to do that now, but I got the error I discriber in the last post. Is it because the gparted errors? Do I have to throw away both Ubuntus, format the whole harddrive and start installing again those thousands of stuff?
syklitengutt
November 26th, 2005, 11:14 AM
have some difficulties with the two first suggestions.
When booting up my pc, I directly jump into windows.
I tried installing grub from cd and when its finished it jumps straight back to
selecting partitions. Dont know why.
So I then tried to install via live cd.
type su and try the password I have on my linux partition, and it doesnt work.
I also tried every other possible passw. but still it doesnt work.
fdisk:
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 3696 29688088+ 7 HPFS/NTFS
/dev/hda2 3697 14593 87530152+ 5 Extended
/dev/hda5 3697 6307 20972822+ 83 Linux
/dev/hda6 6308 6361 433723+ 82 Linux swap / Solaris
/dev/hda7 6362 14593 66123508+ 7 HPFS/NTFS
where hda1 is parition C: on windows
hda2 is unknown, but I think its where hda5 and hda7 is written to.
hda 5 is my linux (used to be hda6 and hda7 is D: in windows (used to be hda5
so I really need help guys....
ajgreeny
November 28th, 2005, 05:25 AM
Hi commodore.
What is the content of your /grub/boot/device.map file?
As far as I can make out, any disk on which you want to install grub with the "sudo grub-install" command must be listed in the device.map file or you will get the error mesage you mentioned. Try adding an appropriate line to the file as in my first post to this thread, but also note the end of the error message (or at least this is what I see) telling you the error can be ignored and should not cause any problems, and then listing the content of your device.map file and telling you to amend it if needed.
Give it a try.
Carnwaj
November 28th, 2005, 07:09 PM
Just thought I would share my experience of GRUB.
Windows on hda
Ubuntu on hdb
GRUB working fine
One day Windows just doesn't load - it just sits at the splash screen and goes nowhere.
Used XP CD to restore MBR using fixmbr.
I then used the "install CD" method at the top of this post to reinstall GRUB. When I got to the manual partitioning part I noticed that hdb was mounted as /media/hdb. I set this as '/'. I then jumped to the reinstall GRUB part of the install process and everything else worked as described.
Top post from vnbuddy2002
It wasn't all plain sailing - I tried the live CD method and got an error 21 when I tried to root (hd0,0). Tried seaching forums but couldn't get to the bottom of it.
dakota34
December 23rd, 2005, 07:12 PM
very first post worked perfectly for me after a Norton ghost image hosed my grub/mbr.
Couldn't get live cd methods to work.
Have to say, it's a little scary when the install cd asks you if you really want to write the changes to the disk (no changes, you're really just mounting existing) .. but it works!!!!!!!!!!!
Thanks a hell of a lot, this was causing me extreme stress, what with Xmas rolling around etc..
Real lesson: time to get rid of Windows.
TG.:razz:
Bitter Peace
December 28th, 2005, 11:31 AM
Thank you, thank you, thank you, ghostintheshell! This did the trick for me.
Here is the problem I had: Two HDDs, just Ubuntu installed on them (so no dual-boot setup), yesterday it booted just fine, today it didn't. No updates or anything either, I shut the computer down like always and it gave me these mesages on startup today:
module minix not found
...
can't access tty; job control turned off
...
Target filesystem doesn't have /sbin/init
So thank you again, ghostintheshell and everybody else who worked toward this solution.
Aaargh!! Thank you guys!! Very very very much!! You saved my virtual life!
I lost my Grub / MBR and YOU restored it!
After searching too much time on the web, I fell on this topic. I read it completely and applied a mix of your solutions.
Here's the steps I followed to restore GRUB / my initial MBR:
1. Boot with any live CD (I've done it with Ubuntu Live DVD)
2. Get a root shell -> Applications / System Tools / Root Terminal
3. Make a folder -> mkdir /mnt/ubuntu
4. Check the Ubuntu partition -> fdisk -l (Mine is /dev/hda4)
5. Mount the root partition of Ubuntu -> mount -t ext3 /dev/hda4 /mnt/ubuntu (replace /dev/hda4 by your Ubuntu partition determined at the step 4)
6. Chroot the mounted partition -> chroot /mnt/ubuntu
7. Restore Grub / the initial MBR -> grub-install /dev/hda
8. Exit the shell
9. Reboot
That did the trick for me.
Thank you very much again to all of you! ( :bigsmack: )
Carwash
December 29th, 2005, 07:24 AM
Ive completely messed up my system, cant get into Linux or Windows.
Had Windows installed for about 4 weeks on my new system and had left 10gb spare as a partition for linux, got round to installing it yesterday and it didnt go too well. I got upto the bit where it asks if you want to install GRUB, i said "Yes" and it did its business, told me to take out the cd and reboot.
After that it was trying to boot from the PXE-E53, i tried various things and couldnt get it working. Put in the WinXP cd and went to recovery console and tried fixmbr/ fixboot which then gave me the error "ntldr is missing". Tried copying ntldr and ntdetect from the winXP cd in i386 but got the same message.
So... i got told by a friends friend if i could get into linux (usin the live cd) and use GRUB, id be able to fix it and get the MBR / GRUB back. Ive tried the various ways on here to get my system back, but none have worked (prolly my fault though).
My system:
Shuttle SN25P (nForce4 mobo)
AMD Athlon64 3700+ San Diego
2Gb RAM Geil
1 x 80Gb Maxtor SATA HDD (with 2 partitions, WinXP being the main one)
2 x 300Gb Maxtor SATA HDD (No o/s's on either of these)
ATi X1800XL
Now ... the way my hdd's are setup in the BIOS shows that the 80gb hdd is listed 3rd (which would mean its sdc).
When i got into GRUB and did the search, it told me the boot was (HD2,1), so i changed what i needed to to that and on boot up it says :
root (hd2,1)
Error 22: No such partition
Press any key to continue...
Pressing any key takes me back to the GRUB o/s selection screen where it gives me the same error for all the options accept windows which says the following :
Booting 'Windows NT/2000/XP (loader)'
root (hd2,1)
Filesystem type unknown, partition type 0x42
savedefault
maleactive
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1
NTLDR is missing
Peress Ctrl+Alt+Del to restart
Would really rather not have to format and start all over again, im surei dont have to ... its just im completely stuck now and dont know what else to try.
Please help !
--------
Edit:
Fdisk -l
root@ubuntu:/root# sudo fdisk -l
Disk /dev/sda: 300.0 GB, 300090728448 bytes
16 heads, 63 sectors/track, 581463 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 581463 293057320+ 42 SFS
Disk /dev/sdb: 300.0 GB, 300090728448 bytes
16 heads, 63 sectors/track, 581463 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 581463 293057320+ 42 SFS
Disk /dev/sdc: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 8688 69786328+ 7 HPFS/NTFS
/dev/sdc2 * 8689 9907 9791617+ 83 Linux
/dev/sdc3 9908 9964 457852+ 5 Extended
/dev/sdc5 9908 9964 457821 82 Linux swap / Solaris
Disk /dev/sdf: 250.9 GB, 250999209984 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdf1 * 1 30515 245111706 7 HPFS/NTFS
grub> find /boot/grub/stage1
(hd2,1)
Just read this though on the first page... and think it may be what ive done? :(
[1] Important: If you are multi-booting with Windows, make sure you do NOT install the MBR on the active partition (say /dev/hda1) but on the drive (/dev/hda). At least with Windows XP, you will have to re-install it (FIXMBR/FIXBOOT won't work).
j-a-p
January 2nd, 2006, 02:54 PM
I may be missing the point here, but can't you just do:
dd if=/dev/hda of=hdambr bs=512 count=1
to restore the 1st stage loader and the reinstate a backup of the /boot partition?
viraldhimar
January 3rd, 2006, 02:02 AM
Here is another way:
1. Boot with any live CD (I've done it with Knoppix 3.x and Ubuntu)
2. Get a root shell and make a folder (mkdir ubuntu)
3. mount the root (/) partition of ubuntu (e.g. mount /dev/hdb ubuntu if you have two disks)
4. chroot the mounted partition (chroot ubuntu)
5. grub-install /dev/hda [1]
5. Exit the shell
6. Reboot
[1] Important: If you are multi-booting with Windows, make sure you do NOT install the MBR on the active partition (say /dev/hda1) but on the drive (/dev/hda). At least with Windows XP, you will have to re-install it (FIXMBR/FIXBOOT won't work).
Thanks man, this worked great after I tried to reinstall Dell mediaDirect(apparently dell rewrites the bootloader..bad dell very bad...) If you have sata drives just use "sda" instead of hda.
rajaiskandarshah
January 7th, 2006, 01:39 AM
hi guys,
running windows xp and ubuntu on my acer travelmate 2301 notebook for the last 6 months. my prefered os is ubuntu where all of my main documents are.
since last week, i had a small project using visual basic, so i had to run winxp. yesterday morning, i installed a windows update in the morning when prompted, and in the evening winxp eventually(!) crashed. grub works ok and i can get to ubuntu no problem and even browse the files under winxp. but winxp will only get up to the splash screen, then there is the blue screen of death and the computer will restart.
will the following work ?? and any advice ?
1. copy my documents to another computer on the network
2. restart the computer with winxp cd and select the recovery option
3. run the fixmbr command
4. restart the computer as normal to winxp
5. restart the computer with ubuntu install cd and reinstall grub as per the top post
6. restart the computer to grub
any other potential issues ?
adrian15
January 11th, 2006, 05:56 AM
If you do not want to mess up with commands...
Note: This method works very well with system with only one Linux... if you have more than one Linux Super Grub Disk will restore the first Grub that it will find on your partitions.
Download Super Grub Disk (http://adrian15.raulete.net/grub)
Burn into a cdrom (better) or a floppy
Boot from it
Select: your language
Select: Restore Grub on MBR
Select: Auto
You see the message: SGD has done it!
Reboot
You're done.
jonathansizz
February 5th, 2006, 01:54 PM
Hi
I've looked through the posts but none of the methods described seems to be quite what I am looking for. I have Ubuntu 5.10 as my main distro. I installed this first. Later I installed 6.04 preview, and this installed its own GRUB. Now, I want to remove 6.04 altogether but when I tried this GRUB no longer booted my system (presumably as it was looking for the no-longer-existant GRUB from the deleted 6.04 partition). So I reinstalled 6.04 in order to be able to boot into 5.10. What I need is to be able to remove 6.04 but have GRUB boot 5.10 (from the 5.10 partition?). Here is the relevant info:
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 14797 19457 37439482+ 83 Linux
/dev/sda2 1 14216 114189988+ 83 Linux
/dev/sda3 14217 14796 4658850 5 Extended
/dev/sda5 14217 14594 3036253+ 82 Linux swap / Solaris
/dev/sda6 14595 14796 1622533+ 82 Linux swap / Solaris
Partition table entries are not in disk order
ubuntu@ubuntu:~$
I think 6.04 is on sda1 and 5.10 is on sda2. So I think I need to have the asterisk next to sda2? sda5 is the swap for 5.10 and sda6 is the swap for 6.04
What is the best way of fixing this?
Thanks for your help!
jonathansizz
February 5th, 2006, 02:35 PM
Sorry! I posted in the wrong section
Hawkeye501
February 10th, 2006, 08:19 AM
vnbuddy2002 im new to linux, my first install on a Compaq Proliant 3000 server, and I had that problem, GREAT NEWB document! :) helped me fix my prob :D
Hawkeye501
February 10th, 2006, 09:25 AM
ugh i did do something wrong, grub failed to load
phbc50
February 11th, 2006, 04:47 AM
Hello,
After installing another OS I lost the mbr on my HD (hda with ubuntu on hda7), here is the solution that I found to work :
- boot the ubuntu LIVE CD
- go in console, and change user to root with su root
- make a temp dir to mount the ubuntu partition :
mkdir /mnt/hda7
- mount the drive with :
mount -t ext2 /dev/hda7 /hda7
- chroot to the mounted system :
chroot /dev/hda7
- run grub at the promtp : grub
then :
grub> root (<tab>
where <tab> is an actual TAB which returns the hd that grub recognises, in my case hd0 hd1 hd2
then :
grub> root (hd0,5) # in my case the hda7 partition is recognized by grub as (hd0,5)
grub> setup (hd0,5)
grub> exit
then reboot and it worked...
HTH
regards,
phbc50
charsiubao
February 15th, 2006, 09:17 PM
i've used the live cd method to fix the error 17...but i get the error every so often. i feel like that should definitely not be happening so often. any suggestions/comments as to what the problem may be?...
jdpipe
February 16th, 2006, 12:16 AM
If you need to restore your original Windows MBR / boot sector (for example if you messed up during your Ubuntu installation), see this post (http://www.ubuntuforums.org/showpost.php?p=733542&postcount=220).
SVFUSiON
March 5th, 2006, 03:51 PM
i don't see /boot just ext and swap
SVFUSiON
March 5th, 2006, 04:43 PM
here is my problem now, I reinstalled Ubuntu, I hit the "Install GRUB" it installed to the "MBR" or whatever the default is. For some reason, it is still booting to lilo, and I can not even get back to vista. here is my partition tables
Disk /dev/hdc: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 30402 244204033+ 7 HPFS/NTFS
Disk /dev/hdd: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
Windows Vista is Install here/dev/hdd1 3 79889 40262656 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
Ubuntu is here /dev/hdd2 * 79895 151933 36306900 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/hdd3 151933 155056 1574370 5 Extended
Partition 3 does not end on cylinder boundary.
/dev/hdd5 151933 155056 1574338+ 82 Linux swap / Solaris
Disk /dev/sda: 37.0 GB, 37019566080 bytes
255 heads, 63 sectors/track, 4500 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 4499 36138186 7 HPFS/NTFS
At this point i have no idea what is going on,
I can't even find lilo anymore, where is it? where did grub go? How can I get my to normal lol. I use Ubuntu as a main OS but I still need vista to report bugs.
Scunizi
March 18th, 2006, 12:45 AM
This thread was very helpful but I had a slightly different wrenkel that I discovered. I lost my motherboard in a brown-out durning a thunderstorm. After installing a new Asus P4v8x-mx I could boot into windows as normal but not Ubuntu. So I deleted the Ubuntu partitions on my secondary SATA drive and proceeded to reinstall. When finished and trying to reboot to Ubuntu I got the dreaded Error 22 and the previous error mentioned when trying to boot into windows. After rebooting with the Ubuntu install disk and going through the install several times I started looking a the drive designations during the partion process. What I discovered was my primary boot/windows drive was being listed as Sdb instead of Sda. A quick swap of the cables on the motherboard and following the previous instructions fixed everything! I couldn't have done it without reading this thread and a little investigation. Thanks!:-D
armada
March 22nd, 2006, 10:01 PM
Isn't it easier to do this:
1. Pop in the Live CD, boot from it until you reach the desktop.
2. Open a terminal window or switch to a tty.
3. Type "grub"
4. Type "root (hd0,6)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
5. Type "setup (hd0)", ot whatever your harddisk nr is.
6. Quit grub by typing "quit".
7. Reboot.
This did work wonder in restoring the MBR of my Compaq Armada 1750 after I restored the laptop from Ghost. Yet the laptop's special partitition, where the BIOS tools are located, is no longer accessible through pressing F10 duing POST.
I can live with this as I still can access the BIOS settings through using a floppy. Yet I wonder if there is a way to have both Grub and the easy F10 access to the BIOS tools.
I suspect that the original Compaq MBR is Windows-compatible. I may be able to Windows' boot.ini to access the Linux partitions and still keep the original BIOS access intact.
Thanks.
cellarguy
March 23rd, 2006, 12:15 PM
I'm missing one small piece.
When I boot to live CD, how do I become superuser?
Vlammetje
April 8th, 2006, 09:48 AM
Just sudo I guess?
Here's my little problem.
Recently I installed Dapper flight 6 from a Live CD (via espresso) next to my XP install. It booted all fine and wonderful and both OS's worked well. After a while I have the brilliant thought of reinstalling dapper using the same Live CD as before, and this is something I wish I'd never done. During this install, it failed to install Grub. I've tried this over and over and over and over, and grub will not ever install to my PC at all.
Now I'm stuck with a PC that has (presumably) 2 working OS's on it, and no way to get to either of them.
I do have the Live CD. I have all my partitions mounted. Now how do I go about installing grub to the PC while I'm booted on the live disk?? :confused:
Any help would be appreciated
PhilOSparta
May 5th, 2006, 07:08 AM
I have followed all the steps on two identical laptops, one of which has the grub MBR messed up. The messed up laptop is my daughter's and I am communicating via phone with her (I hate being a help desk! :sad: ).
We are stuck on step 4.
When we sudo chroot /mnt/ubuntu , we get this:
chroot: cannot run command `/bin/bash': No such file or directory
This really confuses me. On my good laptop everything is fine.
The only difference in the setups is that I am using a Live Ubuntu CD burned from a downloaded ISO file. My daughter is using a factory Ubuntu Live CD.
Any ideas?
Masterminds
May 27th, 2006, 11:16 AM
thanks mate
StormWatcher
May 27th, 2006, 10:39 PM
Isn't it easier to do this:
1. Pop in the Live CD, boot from it until you reach the desktop.
2. Open a terminal window or switch to a tty.
3. Type "grub"
4. Type "root (hd0,6)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
5. Type "setup (hd0)", ot whatever your harddisk nr is.
6. Quit grub by typing "quit".
7. Reboot.
I may be missing your point though, if so, please forgive me :)
This method did bring back my grub, however I get an error when I boot.
My partition list is:
/dev/hda1 Windows NTFS (Has my XP Pro on it)
/dev/hda2 Extended 3 (Has my Ubuntu on it, and I can mount and look at all my data)
/dev/hda5 Swap
/dev/hda4 Unformatted
I opened a terminal window and did the following:
grub> root (hd0,1)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage_5" exisits... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded. succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,1)/boot/grub/stage2 /boot/grub/menu.list"... succeeded
Done.
The first time I ran this command I did get errors, but it said they were not fatal. I do not know what they where, but now it seems to succeed just fine.
But when I boot my screen looks like:
Booting 'Ubuntu. kernel 2.6.12-10-386 '
root (hd0,2)
Filesystem type unknow, partition type 0x5
kernel /boot/vmlinuz-2.6.12-10-386 root=dev/hda3 ro quiet splash
Error 17: Connot mount selected partition
Press any key to continue...
Also when I boot using the the rescue option and then type:
sh-3.00# grub-install /dev/hda2
I get:
The file /boot/grub/stage1 is not read correctly.
So now I am not sure what I should do.... My linux is on hda2. I have very little knowledge of linux. The menu still boot my Windows XP. I wish it was there other way around.
Thanks for your help. ](*,)
StormWatcher
May 28th, 2006, 09:36 PM
If anyone caree, I was able to fix my problem by editing the menu.lst file in /boot/grub. I changed the file to read:
root (hd0,2)
kernel /boot/vmlinuz-2.6.12-10-386 root=dev/hda3 ro quiet splash
to
root (hd0,1)
kernel /boot/vmlinuz-2.6.12-10-386 root=dev/hda2 ro quiet splash
and all works fine now. This thread helped alot. Thanks.
loko
June 2nd, 2006, 07:39 PM
I want to thank "remmelt" for his great tip, how to handle grub.
this helped me a lot.
BoomAM
June 18th, 2006, 07:10 AM
Im having quite a few problems here.
All of the fixes that have been listed thus far dont work.
Basically, i booted into XP yesterday, set my TPs updator going, and it told me about a 1.3Gb update to the R&R Partition on my TP. So i DLed it & installed it. Anyway. I come to boot the laptop now, and it gets to a screen where it says 'GRUB' at the top, then does nothing. So now i cant access anything at all.
The only live CD/install CDs ive got to hand are the 5.04 ones, ive lost my 6.06 CD, and i havnt got anymore CDs to burn anymore.
Any ideas ppl?
HolyMurderer
June 18th, 2006, 08:37 AM
To me it says:
grub> root (hd0,0)
Filesystem type is fat, partition type 0xc
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/boot/grub/stage2" exists... no
Error 15: File not found
I have Windows at sda1. It's the first partition on the first hdd. I'm having a problem, I just changed default from 0 to 4, for windows becoming the default boot, and now, if in grub I select to boot windows, or wait for auto boot, It shows the grub menu again... :(
the only thing that's not booting is windows. The rest is booting...
The entry (windows part) in menu.lst is:
title Microsoft Windows XP Professional
rootnoverify (hd0,0)
makeactive
chainloader +1
My fdisk -l
Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1853 14884191 c W95 FAT32 (LBA)
/dev/sda2 1854 19452 141363967+ f W95 Ext'd (LBA)
/dev/sda5 1854 9416 60749766 b W95 FAT32
/dev/sda6 9417 9622 1654663+ 82 Linux swap / Solaris
/dev/sda7 9623 17476 63087223+ 83 Linux
/dev/sda8 17477 19452 15872188+ 83 Linux
Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 7297 24321 136753312+ c W95 FAT32 (LBA)
/dev/sdb2 1 7296 58605088+ 83 Linux
Partition table entries are not in disk order
Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 9729 78148161 7 HPFS/NTFS
I remembered now something. First I did grub-install /dev/sda1. I've tried fdisk /mbr and grub isn't removed. So I think grub is not on mbr, but on hdd itself. Is it possible that when I choose the windows option in grub, grub is loading grub again, because is on that hdd and partition?
I don't know if it's stupid, the question, or if it's possible... I'm just in despair, because i need my work on windows and I can't even boot into win xp cd to fixboot :(
Any help please?
airjunman
June 29th, 2006, 06:33 PM
Hey,
I am an absolute beginner to Ubuntu and pretty much the same to Linux... Now I tried playing with a couple of "unknown" type partitions during a session and forgot about it ... some time later my system(which by the way, has happened afew times before too, but thats off the point) ... I hard reset it and since then had a GRUB Error 17
very similar to this post...http://www.ubuntuforums.org/showthread.php?t=199893
I did a
sudo mkdir /mnt/hda6
mount -t ext3 -o rw /dev/hda6 /mnt/hda6
grub-install --root-directory=/mnt/hda6 /dev/hda
Now I seemed to be able to fix the Error 17, but now it boots to a error 22 saying that No such partition hda(0,8) ...
Why can't i just tell grub to boot off hda6 which is my bootable linux partition?
And a lot of people reply saying "reinstall grub", but i really don't have a clue as to how to do that..
Using the Install CD to do it failed.. the Installation just crashed and i didn't see anything about installing GRUB...
I'd really appreciate some help.. Thanks in advance
ericesque
July 1st, 2006, 01:24 AM
Wow. I just had the bought of the century with my MBR.
I installed a fresh dapper a few days ago. Not even considering the consequences, I installed with my external sata drive running. There was an old install of some linux distro on there that I'd never wiped.
Come a few days later when I actually took my lappy away from my desk, I tried to boot and started getting errors from grub. Something about my sata drive not being available and it mentioned superblocks.
So it was on to searching the forums.
I found this thread and tried the live boot method... a couple times. Once before removing the linux install on my sata drive, once with the drive off, and maybe once after I deleted the install. No luck.
So I decided I'd had it and I'd try the first post-- if I fried my current install, so be it.
I fought with the dapper text based installer some as well. I had to abort the install 2 or 3 times before I figured out exactly how to make it reinstall grub. It is a highly particular installer. It even bothered to mention that one of the ext2 partitions that I'd formated with Acronis Disk Director had a... and I quote... "funny looking format". Funny looking format? Is that the technical phrase for it?
Anyway, it finally worked. This thread played a big part in getting there. Big thanks to those who have contributed.
alejandrops
July 3rd, 2006, 09:31 AM
HELP!!!
i've tried everything on this thread but still cant reintall GRUB.
when I type grub-install /dev/sda the answer is:
could not find device for /boot: Not block found or not a block device.
aso when i tyoe inside grub find /boot/grub/stage1 says "error 15: file not found"
both commands after and before chroot my linux part.
any ideas?
heeeelp!!!!
petern
July 12th, 2006, 06:13 PM
Sorry you have had no replies. I have experienced exactly the same frustrations you have. Nobody seems able to explain the 're-install grub' suggestion, and I have been trying to do it with the Knoppix live cd without success.
The only way forward would seem to be to re-install the o/s, hopefully without losing everything in the process.
To access/boot your Windoze partition, use Knoppix (as root), or System Rescue or a Win 98 boot floppy/Win 2000 install cd, and type this:
fdisk /mbr
Then at least Windows will boot, and you can do what needs to be done later.
Vostronius
July 17th, 2006, 12:59 AM
ok, so this is my situation, I had windows XP and Ubuntu 6.06 both working perfectly with GRUB as the boot loader. But then I had to reinstall Windows, and then GRUB stopped showing up and letting me switch between the os at start up, after trying everything on this forum to no avail, I decided to try system commander, so I got that when I went to reboot, system commander wouldn't work, it just said "boot >>" and then it wouldn't do anything, so now I can't even get into Windows, so I am forced to use the live cd from an old ubuntu 5.10 to do anything. And it didn't work when I tried using the live mode or install mode on my ubuntu 6.06 cd. Please help, thx in advance.
Dural
July 27th, 2006, 07:57 PM
GRUB is screwed up on my computer. I have two hard drives (both are ATA so they are called hdc (Windows XP) & hdd (Kubuntu Dapper Drake). I put each OS on its own hard drive so that (in theory) should one happen to get messed up, the other would be fine. Later on, I had a seperate problem with Kubuntu (it messed up my screen resolution) and after asking for help at various forums and having all solutions fail, I angrily decided to reinstall Kubuntu. Unfortunately, the graphical install froze as it was copying the files to the hard drive, so I restarted the system. The first time, I was greeted with GRUB Error 22, so I then tried to fix the Master Boot Record using a Windows XP CD (shown here: http://www.neowin.net/forum/index.php?showtopic=292614), only to realize that it would not work because GRUB could not load, giving me GRUB Error 15. I was about to try the suggestions on this thread, but rushing to solutions is what got me into various messes involving both Ubuntu ahd Kubuntu Dapper Drake so I want to wait and see what you guys have to say.
System Specs:
Processor: AMD Sempron 3100+
Memory: 1 GB
Video Card: Nvidia GeForce 4Ti 4200 (128 MB)
boot order was:
Hard Drive 1: hdd (40 GB ATA /w the Kubuntu Dapper Drake install)
Hard Drive 2: hdc (80 GB ATA /w Windows XP SP2)
I would add my fdisk -l output, but I am typing this from a laptop (not the affected computer) running Windows XP SP2.
Any help would be much appreciated.
akurashy
July 30th, 2006, 11:15 PM
Okay guys, I really need a hand here
I installed windows today in another partition, MBR took over , this is how I messed up
Right now it's a miracle i'm logged in to my ubuntu partition, i've been playing with lady luck for a while
I installed GRUB again but the problem is
root (hd0,1) gives me "can't mount"
then i tried editing with (hd0,2) which worked
then noticed that it didn't work , then noticed that the hda mounting said "2" and changed it to "3" and it started to boot
as you see i have a mess right now
i want to install my GRUB correctly and flawless, knowing that my linux partition is safe i'm glad because i have a lot of data here
my fstab
david@akulinux:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
and this is my menu.lst
david@akulinux:~$ cat /boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda2 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,1)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## ## End Default Options ##
splashimage=(hd0,1)/boot/grub/default-splash.xpm.gz
title Ubuntu, kernel 2.6.17
root (hd0,1)
kernel /boot/vmlinuz-2.6.17 root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.17
savedefault
boot
title Ubuntu, kernel 2.6.17 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.17 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.17
boot
title Ubuntu, kernel 2.6.15-26-k7
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-k7 root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.15-26-k7
savedefault
boot
title Ubuntu, kernel 2.6.15-26-k7 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-k7 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.15-26-k7
boot
title Ubuntu, kernel 2.6.15-23-k7
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-23-k7 root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.15-23-k7
savedefault
boot
title Ubuntu, kernel 2.6.15-23-k7 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-23-k7 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.15-23-k7
boot
title Ubuntu, kernel 2.6.15-22-k7
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-22-k7 root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.15-22-k7
savedefault
boot
title Ubuntu, kernel 2.6.15-22-k7 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-22-k7 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.15-22-k7
boot
title Ubuntu, kernel 2.6.15.4
root (hd0,1)
kernel /boot/vmlinuz-2.6.15.4 root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.15.4
savedefault
boot
title Ubuntu, kernel 2.6.15.4 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15.4 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.15.4
boot
title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Arch Linux
root (hd0,3)
kernel /boot/vmlinuz26 root=/dev/hda4 ro
initrd /boot/initrd26.img
savedefault
boot
i don't know how i did it but i had to edit this
root (hd0,2)
kernel /boot/vmlinuz-2.6.15-26-k7 root=/dev/hda3 ro quiet splash
initrd /boot/initrd.img-2.6.15-26-k7
savedefault
boot
i'm actually very nervous right now , to be honest is my first time playing with GRUB and i don't want to make any mistakes >_<
anyway i hope anyone here can help me
KillrBuckeye
August 6th, 2006, 11:45 PM
My MBR seems to be really screwed up after moving, deleting, and creating some partitions on my only hard drive. I have tried rewriting Grub to the MBR many times (both via the Grub floppy, and within Ubuntu), but I keep getting an error message upon reboot:
DISK BOOT FAILURE, INSERT SYSTEM DISKA ND PRESS ENTER
(Yes, I know it is trying to boot from the HDD since I have tried disabling everything else in the boot order). However, if I boot from a Grub floppy, I can specify the 'menu.lst' file and everything works fine. Further, I can use a LiveCD and choose "Boot from first hard disk", and it works fine. The problem is definitely with my MBR or something I'm doing wrong while writing to it... :(
My grub folder is on my /boot partition, which is hd0,0. I have tried writing to the MBR in the following ways:
1) grub> root (hd0,0)
setup (hd0,0)
2) grub> root(hd0,0)
setup (hd0)
3) sudo grub-install /dev/hdb
(yes, my only hard drive is primary slave, or hdb)
Nothing works, and I have no idea what to try now. Any suggestions?
xgravix
September 4th, 2006, 12:43 AM
Um, could someone kindly delete the misinformation in the first post? Following the instructions results in your ubuntu installation on disk being partially wiped and replaced with garbage when the installer crashes. 6.06 LTS.
I was able to correctly restore my GRUB using the command line, but it is too late thanks to this HOWTO which has been posted all over the internet.
magnum2000
September 23rd, 2006, 08:31 AM
Hi all.
I have reinstalled Winzozz and now grub isn't enabled.
I'm trying to restore GRUB but nothing to do...
This is my configuration:
/dev/hda1 WINDOWS
/dev/hda2 /
/dev/hda3 /swap
This is the log
root@ubuntu:/# grub-install --root-directory=/boot /dev/hda
Could not find device for /boot/boot: Not found or not a block device.
root@ubuntu:/# /sbin/grub
Probing devices to guess BIOS drives. This may take a long time.
root@ubuntu:/# /sbin/update-grub
Searching for GRUB installation directory ... found: /boot/grub
Testing for an existing GRUB menu.list file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.15-26-k7
Found kernel: /boot/vmlinuz-2.6.15-26-386
Found kernel: /boot/vmlinuz-2.6.15-23-386
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done
Now no one MBR start :(
Suggestions?
oscabat
September 24th, 2006, 04:19 AM
My situation is a little different:
I have two hard drives - 1 Windows, 1 Ubuntu
I want to format both of them, so I first formatted my Ubuntu one. Apparently, there must have been some GRUB files on my Windows hard drive as well, as it still attempts to load GRUB (and now I get error 17). I can't really restore GRUB from either of my hard drives because both of them are NTFS, and so I can't mount them (at least, I assume that's why).
What can I do to boot back into Windows?
wolf202
November 8th, 2006, 05:14 PM
Ok so I reinstalled windows and it messed grub so i'm trying to reinstall it with a live cd. I've been trying all the methods on the master list.
http://ubuntuforums.org/showthread.php?t=24113
The thing is when I type "root (hdX,X) or whatever I can never find one that works I don't know what to choose
This is the picture of my hdd setup can someone tell me what to type because find /boot/grub/stage1" does not work.
http://img.photobucket.com/albums/v440/wolf202/a279e0b3.png
The 51GB partition is Windows the 40GB partition is Ubuntu, the others are just NTFS Data Storage
BTW, I'm using the Edgy Eft AMD64 live CD also I can boot my ubuntu with the Super Grub Disk (http://adrian15.raulete.net/grub/tiki-index.php)
-wolf
venky80
November 12th, 2006, 12:42 AM
OK guys I think the thread basically lost the point after a while
therefore I am listing the problem again and letting ppl know what solved it for me.
PROBLEM: RE INSTALLING WINDOWS IN A DUAL BOOT SYSTM WIPES THE MBR and HENCE U DONT HAVE GRUB NOW TO MULTIBOOT.
SOLUTION : BOOT WITH LIVE CD
OPEN TERMINAL WINDOW
$ sudo fdisk -l
this should list all ur Hard disk
my root was /dev/hda4
then
$ SUDO GRUB
grub> root (hd0,3)
I dont know why it was hd0,3 and not hd0,4 but it worked
then
grub> setup (hd0)
grub> quit
problem fixed
always using SUDO works
hope it helps
dabotsonline
November 15th, 2006, 08:11 PM
Hey guys,
I have a dual-boot setup of Win XP (hda1 / (hd0,0)) and Ubuntu Edgy ext3 (hda2 / (hd0,1)). extended is hda3 and linux-swap is hda5.
GRUB hung on "GRUB Loading stage1.5" a few weeks ago, with the menu never appearing, and I solved it by booting into Edgy Desktop CD and entering the following:
ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu# cd /mnt
root@ubuntu:/mnt# ls
root@ubuntu:/mnt# cd
root@ubuntu:~# mkdir /mnt/ubuntu
root@ubuntu:~# mount -t ext3 /dev/hda2 /mnt/ubuntu
root@ubuntu:~# chroot /mnt/ubuntu
root@ubuntu:/# grub-install /dev/hda
This originally solved the problem.
However, I experienced the same problem today and, when I entered "grub-install /dev/hda", I was confronted with the following message:
/dev/hda: Not found or not a block device.
So I tried replacing the last line with a suggestion I found elsewhere:
grub-install /dev/hda --root-directory=/mnt/ubuntu/boot/grub
however, this was the response:
mkdir: cannot create directory `/mnt/ubuntu/boot/grub/boot': No such file or directory
Why has it added an extra 'boot' at the end? There are no further subdirectories within /mnt/ubuntu/boot/grub .
I then tried the following:
grub> root(hd0,1)
but I got this back:
Error 27: Unrecognized command
and when I typed:
grub> setup(hd0)
I got the same response. When I tried it in an attempt before this one, I think it said "Unrecognized drive" or something similar.
Incidentally, given my dual boot setup, should I have instead written, "setup(hd0,1)"? I have attached my menu.lst below.
I then tried the final suugestion I found on here.
The Edgy Alternate CD "Partition disks" sections indicates that:
#1 primary ntfs /media/hda1
Bootable flag: on
#2 primary ext3 /media/hda2
Mount point: /media/hda2
Bootable flag: off
#5 logical swap swap
The suggestion on here seemed to say that I should change the mount point of /media/hda2 to /, and also set the bootable flag to on; but should I also leave the /media/hda1 bootable flag on as well?
Thanks,
Nick
Here is my /mnt/ubuntu/boot/grub/menu.lst:
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=bfe5aabb-1181-4c09-8c06-25e4d70074c0 ro
# kopt_2_6=root=/dev/hda2 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,1)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## ## End Default Options ##
title Ubuntu, kernel 2.6.17-10-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot
title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.17-10-generic
boot
title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
quiet
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1
Is this bit:
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1
significant?
dabotsonline
November 17th, 2006, 03:09 PM
I've fixed the problem: http://ubuntuforums.org/showpost.php?p=1769691&postcount=5 :D
marx2k
November 29th, 2006, 01:55 AM
Isn't it easier to do this:
1. Pop in the Live CD, boot from it until you reach the desktop.
2. Open a terminal window or switch to a tty.
3. Type "grub"
4. Type "root (hd0,6)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
5. Type "setup (hd0)", ot whatever your harddisk nr is.
6. Quit grub by typing "quit".
7. Reboot.
I may be missing your point though, if so, please forgive me :)
Best instructions ever. I have now saved 2 systems with this method.
marx2k
November 29th, 2006, 02:49 AM
Actually, scratch that...
When I use "Boot from first hard disk" from the liveCD, it works...
if I dont use a CD and try to boot from the first hard disk... it gives me Error 22: No Such Partition or something like that...
WHat gives??
marx2k
November 29th, 2006, 03:11 AM
Ok looks like on this system:
Disk /dev/hda: 13.6 GB, 13676544000 bytes
255 heads, 63 sectors/track, 1662 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1662 13349983+ 7 HPFS/NTFS
Disk /dev/hdb: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 14946 120053713+ 7 HPFS/NTFS
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 38913 292085797+ f W95 Ext'd (LBA)
/dev/sda5 2551 15298 102398278+ 7 HPFS/NTFS
/dev/sda6 28047 38913 87289146 7 HPFS/NTFS
/dev/sda7 15299 16573 10241406 83 Linux
/dev/sda8 16574 27839 90494113+ 83 Linux
/dev/sda9 27840 28046 1662696 82 Linux swap / Solaris
grub was trying to boot from (2,6)
I had to edit that at boot time to be (0,6)
Not sure why it set itself up that way.
Roberto Rosselli
December 1st, 2006, 03:41 AM
Hi all, I have
* Windows on hda (several partitions)
* /boot on hdb1
* / on hdb2
What should I type to restore grub?
Thanks in advance!
Roberto
zigot
December 12th, 2006, 01:32 AM
I had the same problem. After playing arround with all the methods described without success, I've found that (for some reason) none of my partitions were active.
This is the way I've solved it:
- burned an iso of the Super Grub Disk (what a great tool)
- used the CD to activate my hd0
- I reseted and booted into fully operational Ubuntu installation via Super Grub Disk
- then I sudo-ed into grub, did the "root (hd0,x)" and "setup (hd0)" <-- just to be sure
- I restarted the system and that was it :)
intrepidus
December 12th, 2006, 04:25 PM
I need to reinstall grub to get XP working, but I don't know what drive grub is on. I know it's my primary drive, but I don't know what sata it is.
Is there a way to find out what drive is sda, sdb, sdc, sdd, etc.? And which one hd(0,0) is?
shahin
December 27th, 2006, 01:04 AM
wow I must say SGD, Super Grub Disk, is a life saver. I foundout about it about an hour ago and burned the iso and was just able to recover my Windows XP stuff and erase the old mbr. I am now reinstalling Ubuntu 6.10 and hope that will install a good copy of grub so I can double boot. I'll keep you posted. I think other ways would work also, but for absolute beginners like myself the software rocks. The url where you can get it is posted in previous comments but here it is again:
http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html
shahin
December 27th, 2006, 01:28 AM
ok reinstalling ubuntu did not work. I am able to log into xp when I remove the mbr grub enteries with SGD but I can not reinstall ubuntu with the desktop cd:-(. I get error 18. Since I am installing ubuntu on a 80 G drive I wonder, is the size of the drive really? I think the last time the two (Ubuntu and XP) were working on this pc it was the same setup. I changed the setings in bios also but did not get rid of the error.
In previous posts there is mentione of live cd vs. Install CD. Just making sure, by live you mean the desktop cd? And install is the other one? that one should give me more options? I tried to change the /root to logical, but the desktop install did not allowe me to do this.
shahin
December 27th, 2006, 10:32 AM
I had the same problem. After playing arround with all the methods described without success, I've found that (for some reason) none of my partitions were active.
This is the way I've solved it:
- burned an iso of the Super Grub Disk (what a great tool)
- used the CD to activate my hd0
- I reseted and booted into fully operational Ubuntu installation via Super Grub Disk
- then I sudo-ed into grub, did the "root (hd0,x)" and "setup (hd0)" <-- just to be sure
- I restarted the system and that was it :)
Would you please state ( as much as you recall ) how you did the following:
used the CD to activate hd0? What options did you use from the CD?
reseted and booted into fully operational Ubuntu?
setup hd0? How? I followed some of the procedures in previous post successfully but I still get the same error ie. error 18. Do you recall what error you got? I may just be having a different problem. I admit I have to read some of the material about grub to findout exactly what it does. The super grub disk page has some good advice. But regarding error 18 it just briefly discusses some of the procedures stated here.
Cleric.
January 2nd, 2007, 01:25 AM
I recently installed Windows XP on a drive that shared a computer with one harboring Ubuntu Edgy.
When I tried booting from Edgy, I got the same GRUB Error 21 message that most people seem to be getting.
So, I followed the majority of the instructions on the first and last few pages of this thread, but much to my dismay, nothing has worked yet.
When I am under GRUB in the terminal and I type the "/boot/grub/stage1" command to attempt to find out my boot partition number, but "Error 15: File Not Found" is the only response I get.
I used "sudo fdisk -l" in the terminal to get my hard drive info, and the boot path is "/dev/hda1" but the only thing that happens when I try "root (hd0,0)" under GRUB in the terminal is "Error 21: Selected disk does not exist."
Nothing else has worked so far, either.
Any hints on what might be wrong and what I can do?
ucsdrake
January 2nd, 2007, 03:16 AM
When I am under GRUB in the terminal and I type the "/boot/grub/stage1" command to attempt to find out my boot partition number, but "Error 15: File Not Found" is the only response I get.
you need to type in the "find /boot/grub/stage1"
but personally i dont know how to actually change the location of my grub from its location on the internal HDD (which by following those instructions is (hd0,3) to my external HDD which i know is (hd1), has 4 partitions
1. Windows NTFS
2. Win/Lin Shared Fat32
3. Linux Swap (swap)
4. General Linux (Ext3)
would that mean that i want to change my location to (hd1,3) and if so where in the instructions of
Quote:
Originally Posted by remmelt View Post
Isn't it easier to do this:
1. Pop in the Live CD, boot from it until you reach the desktop.
2. Open a terminal window or switch to a tty.
3. Type "grub"
4. Type "root (hd0,6)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
5. Type "setup (hd0)", ot whatever your harddisk nr is.
6. Quit grub by typing "quit".
7. Reboot.
I may be missing your point though, if so, please forgive me
ajare
January 2nd, 2007, 03:23 AM
I recently installed Windows XP on a drive that shared a computer with one harboring Ubuntu Edgy.
When I tried booting from Edgy, I got the same GRUB Error 21 message that most people seem to be getting.
So, I followed the majority of the instructions on the first and last few pages of this thread, but much to my dismay, nothing has worked yet.
When I am under GRUB in the terminal and I type the "/boot/grub/stage1" command to attempt to find out my boot partition number, but "Error 15: File Not Found" is the only response I get.
I used "sudo fdisk -l" in the terminal to get my hard drive info, and the boot path is "/dev/hda1" but the only thing that happens when I try "root (hd0,0)" under GRUB in the terminal is "Error 21: Selected disk does not exist."
Nothing else has worked so far, either.
Any hints on what might be wrong and what I can do?
---------------------------------------------------------------------------------------------------------
I might be barking up the wrong tree but the command in GRUB is
"find /boot/grub/stage1"
I recall getting the same error when I tried to save time by using the command line before booting into the GUI. Once the live cd was into the GUI though I reinstalled GRUB without problems.
in a terminal...
> grub
grub> find /boot/grub/stage1
(hd0,1)
(hd0,2)
grub> root (hd0,1)
grub> setup (hd0)
grub> quit
this installs grub to the MBR, note the issues raised in earlier posts if you have other boot programs installed.
ucsdrake
January 2nd, 2007, 02:30 PM
I recall getting the same error when I tried to save time by using the command line before booting into the GUI. Once the live cd was into the GUI though I reinstalled GRUB without problems.
in a terminal...
> grub
grub> find /boot/grub/stage1
(hd0,1)
(hd0,2)
grub> root (hd0,1)
grub> setup (hd0)
grub> quit
this installs grub to the MBR, note the issues raised in earlier posts if you have other boot programs installed.
you go from
grub> root (hd0,1)
to
grub> setup (hd0)
from my understanding the ,1 was avery important part of this fix ... do we need to add the ,1 or not?
sorry i just want to make sure i get all the steps right before i go forward seeing as i'm having problems as it is and i dont want to make it worse lol
ajare
January 3rd, 2007, 02:19 PM
you go from
grub> root (hd0,1)
to
grub> setup (hd0)
from my understanding the ,1 was avery important part of this fix ... do we need to add the ,1 or not?
sorry i just want to make sure i get all the steps right before i go forward seeing as i'm having problems as it is and i dont want to make it worse lol
ucsdrake,
I can't see any typos in what I wrote and it worked for my amd64 3500+ installation of 6.10.
I can't say more then that. Now I just need to solve my wireless problems...
sblanzio
January 4th, 2007, 07:06 AM
hi this can help anybody...
I substituted my HD with a larger one and used partimage to move linux partition to the new HD... but I had a continuos Grub Error 15 at boot (without any specified "file not found").
I tried to do anything suggested in this thread but i kept having this problem.
Then i understood it was a BIOS problem. In fact my bios allowes to select a priority in HD booting access. Even if i moved my last HD from master to slave it still was at the top of the bios hd boot priority.
So i changed properly this value and finally the correct grub has loaded.
hth
bye
sblanzio
pichalsi
January 11th, 2007, 05:26 PM
This guide sure helped a lot of people :) I just messed with partitions a little bit so my grub did not boot. Solution? Fire up LiveCD, use Konqueror to Google "Ubuntu howto restore GRUB" and the solution is right there. I have to love this ! Thumbs up
bugz0r
January 12th, 2007, 07:08 PM
The screen freezes at the splash screen.
bugz0r
January 12th, 2007, 08:00 PM
and when I use the method in the first post there is never a root file system. see screenshot.
geezerone
January 16th, 2007, 03:33 PM
Has anyone had problems using SATA drives in conjunction with IDE (PATA) drives? I ask this as I have had to physically unplug the power to any IDE drives otherwise GRUB installs to the MBR of the IDE drive. Have had this happen on all my machines so isn't a one off.
:KS
Foolishgrunt
January 21st, 2007, 03:37 AM
OK, so here's my problem. I'm running a dual boot with Edgy and Windows XP. Recently I started having all sorts of trouble with getting GRUB to boot properly, and I eventually resorted to popping in the Windows XP CD and restoring the MBR from there. Now Windows works fine, but it bypasses GRUB entirely and I can't figure out how to get back to Ubuntu.
I've looked at a lot of the solutions offered here, and they all seem to involve booting from the linux CD. But for some insane reason which I still can't figure out, my CD drive will read practically any disc except the Ubuntu disc. (I've tried burning multiple copies from multiple computers. None of them work, so I'm quite sure it's a problem with my drive.) Can anyone help me restore GRUB without the use of a CD?
GeoPirate
February 17th, 2007, 08:50 AM
Ok I am trying to get triple boot working. I was running XP and xubuntu. I installed ubuntu and the xubuntu dissapeared off my grub, how do I add xubuntu back to grub or edit the grub menu? FYI xp is hd0, xubuntu is hd4 and ubuntu is hd5
when I put in the command " find /boot/grub/stage1 " the output is " (hd0,5)"
thanks in advance!
irrational_e
March 6th, 2007, 11:07 AM
I have been trying for a WEEK without any remote sniff of success to fix GRUB.
My setup:
Hda = WIndows XP. Master on IDE0 (Work drive)
Hdd = Windows XP. Slave on IDE1 (Occasional backup drive that I now wanted to remove)
Sda = Ubuntu Edgy on S-Ata (Hopefully new work drive)
The problem:
Installed Edgy with all drives in the machine, removing the hdd cause GRUB error21 in Stage 1.5
I finally fixed the problem after thinking about it for a while and trying out some things.
There are 2 files in /boot/grub. device.map and menu.lst that make a difference. Basically they tell what shows up on the GRUB menu on bootup it seems.
steps:
1: Remove Hdd
2: Boot using Ubuntu Edgy install CD
3: Mount the Edgy drive as explained earlier like this:
In the install CD gui open a terminal or use ctrl+alt+f1 for a different term.
Changes as root user!
> sudo bash """switch to root user"""
> mkdir ubuntumnt """make a mount poin