View Full Version : Grub/XP/Vista Bootloader
talsemgeest
December 18th, 2008, 05:37 AM
How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 11.10)
This How-to is for windows dual booters who reinstall an operating system only to find that it has taken away access to their other operating system.
Whether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide will walk you through it.
All three parts of this tutorial require that you boot from a cd. If you don't know how to do this, check here. (http://www.hiren.info/pages/bios-boot-cdrom)
If you have made a mistake and want to revert the changes, simply follow the instructions for reinstalling the previous bootloader. For example, if you have installed vista over ubuntu, try to get the ubuntu bootloader back, but want to get the vista bootloader back, simply follow my instructions for installing the vista bootloader.
How to restore the Ubuntu grub bootloader (9.10 and beyond)
First you need to find out what your drives are called. You can do this by going to a terminal and typing: sudo fdisk -l
From that you need to find the device name of your Ubuntu drive, something like “/dev/sda5″.
So, still in the terminal, type:
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5And then, to reinstall the grub: sudo grub-install --root-directory=/media/sda5 /dev/sdaPush enter and you’re done! Of course you need to replace “/dev/sda5″ and “/dev/sda” with what you found in the fdisk output.
How to restore the Ubuntu grub bootloader (9.04 and older)
First of all, all credit for this part of the tutorial goes to catlet (http://ubuntuforums.org/showpost.php?p=1308395&postcount=1). I am simply rewriting his tutorial to have all three bootloaders in this tutorial.
So, lets begin. To restore the grub, you must boot off the ubuntu live cd. Any ubuntu live cd will do.
Once there, open a terminal (Applications>Accessories>Terminal) and type this:
sudo grubNext, you need to find which hard drive ubuntu and the grub is installed to. You do this by running this command:
find /boot/grub/stage1Take note of what it returns (something like (hd0,1).)
Now you need to tell Grub where it is installed. Using the output of the last command, change this one and run it:
root (hd<a>,<b>)Replacing <a> and <b> with what you got back before. For example, if "find /boot/grub/stage1" gave me "(hd0,1)", you would run "root (hd0,1)"
Ok, so thats the configuration over and done with. Now we just need to run one command to install the Grub to your hard drive:
setup (hd0)Now to quit and check if it has worked:
quitsudo rebootMake sure you have taken the live cd out of your disc tray. All going well, you should start back up and see the grub once again.
How to restore the Windows XP bootloader
For this you will need your Windows XP installation CD. Boot into it now.
You will get to a part where it asks if you want to repair or recover. To do so, press "r".
If prompted, enter your Windows XP administrator password. This will leave you at at a command line, so type in the following two commands:
fixbootfixmbrThen type exit then remove your XP cd. If everything has gone well, you should come to your XP bootloader.
How to restore the Windows Vista or 7 bootloader
To restore the Windows Vista/7 bootloader, you must first boot off your Windows Vista/7 installation DVD.
If you have one of the many OEM computers that didnt come with a Vista/7 installation disk, you can get the same effect with a Vista recovery disk, which you can download for Vista (http://neosmart.net/blog/2008/windows-vista-recovery-disc-download) or Win 7 (http://neosmart.net/blog/2009/windows-7-system-repair-discs/).
When you get to the Regional settings, select your Location/Keyboard setting then click next. On the next page you must click on "Repair your computer."
On the next page, if it finds your Windows Vista/7 installation, make sure it is UNSELECTED before clicking next.
Then click on "Command prompt". From there, type in the folowing:
bootrec.exe /fixbootbootrec.exe /fixmbrNow close the two windows and click "Restart."
Take out your Vista/7 DVD and hopefully, you will be left with your Windows Vista/7 Bootloader.
maxideci
July 6th, 2009, 07:29 AM
Hi,
Nice tutorial there, I will work on it, but, I am not sure if the situation I find myself is same or not.
I have Dell Studio with preinstalled Vista Home SP1.
I made a 20 GB raw partion and installed Linux with Grub Bootloader.
On the initial boot screen (Grub), I see option of selecting Linux or Windows.
Next, using EasyBCD, I configured the Vista bootloader to show boot option of Microsoft Vista and Linux.
Currently, this is how the boot sequence is on my notebook.
->Initial boot screen : Grub (1-Linux, 2-Windows Vista)
->Once I select Windows, I get is another boot selection option 1-Microsoft Vista, 2-Linux.
What I prefer is to have only one boot option screen that is second one (Which i suppose is Windows Vista's bootloader), at the same time I want to keep Linux partition intact.
Simply putting it, I want to get rid of Grub bootloader, without getting rid of Linux partition.
If I follow your tutorial will I be able to achieve it ???
What is the standard procedure to install Linux, on a system with MS Vista, without disturbing the bootloader?
thanks in advance.
cheers!!
talsemgeest
July 6th, 2009, 07:34 AM
Hi,
Nice tutorial there, I will work on it, but, I am not sure if the situation I find myself is same or not.
I have Dell Studio with preinstalled Vista Home SP1.
I made a 20 GB raw partion and installed Linux with Grub Bootloader.
On the initial boot screen (Grub), I see option of selecting Linux or Windows.
Next, using EasyBCD, I configured the Vista bootloader to show boot option of Microsoft Vista and Linux.
Currently, this is how the boot sequence is on my notebook.
->Initial boot screen : Grub (1-Linux, 2-Windows Vista)
->Once I select Windows, I get is another boot selection option 1-Microsoft Vista, 2-Linux.
What I prefer is to have only one boot option screen that is second one (Which i suppose is Windows Vista's bootloader), at the same time I want to keep Linux partition intact.
Simply putting it, I want to get rid of Grub bootloader, without getting rid of Linux partition.
If I follow your tutorial will I be able to achieve it ???
What is the standard procedure to install Linux, on a system with MS Vista, without disturbing the bootloader?
thanks in advance.
cheers!!
Ok, the easiest thing to do is to use easybcd to remove the option of linux, then to reinstall the grub bootloader, which should give you your one bootloader screen, and still allow you to access both ubuntu and windows.
Your other option is to reinstall the vista bootloader, and edit the grub so it only has one option.
It is up to you :)
Diamond.Dave
August 30th, 2009, 12:29 PM
Ok, so I hosed something up...
System: Dell D820, 2 GB RAM, 80GB HD, T5500 processor
I've been playing with both XP and Ubuntu, and finally settled on a dual boot. So, I read through all the threads and it seemed to say that it was best to start with WinXP and then boot up in to ubuntu and tell it to do a side by side install>
Put in the WinXP disk, had it wipe all the partitions (there were many) back to 1 big partition. Got XP set up. Then put in the Ubuntu disk, told it to side by side install - it did, then said it needed to reboot...
now I get GRUB Loading stage1.5.
GRUB loading, please wait...
Error 22
I tried the above thread to reload the Ubuntu grub - no joy, still get the Error 22. So I loaded the Ubuntu CD and ran fdisk -l:
ubuntu@ubuntu: ~$ sudo fdisk -l
Disk /dev/sda:80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x41ab2316
Device Boot Start End Blocks Id System
/dev/sda1 * 1 9729 78148161 7 HPFS/NTFS
I'm not an expert, but to me, I don't see where there's a Ubuntu partition here...am I missing something?
Diamond.Dave
August 30th, 2009, 12:40 PM
Ok, might have solved my own problem. I ran the above WinXP recovery, including fixboot and fixmbr, and it booted fine. Then, in Computer Management, I looked at Disk Management, and it ONLY shows the C: partition...guess I messed up the Ubuntu load...will let you know after I try again!
Thanks!
Diamond.Dave
August 30th, 2009, 03:41 PM
Yeah! So it worked - actually followed the dual-boot instructions and setup the partitions ahead of time...all is well now! Thanks for the thread.
talsemgeest
August 31st, 2009, 12:12 AM
No problem, always glad to help! :)
emeraldgirl08
September 26th, 2009, 09:19 PM
Hey member me??!!!
Good to know I bookmarked this as reference! Needed it this evening :)
talsemgeest
September 26th, 2009, 11:40 PM
Hey member me??!!!
Good to know I bookmarked this as reference! Needed it this evening :)
Haha, cool, happy to help again. I will be making a few screencasts to accompany this post, so that should be done in a few days.
bresdog
September 27th, 2009, 03:10 PM
Put xp on an old laptop of mines that already had ubuntu, and obviously the GRUB menu has gone. Followed these steps and i've gotten this error message-
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed
Error 12: Invalid device requested
Tried the suggestions here aswell-
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
Any thoughts? Im still learning this stuff, any help is greatly appreciated. Soon i'll hopefully be giving advice back! Thanks
talsemgeest
September 27th, 2009, 06:44 PM
Put xp on an old laptop of mines that already had ubuntu, and obviously the GRUB menu has gone. Followed these steps and i've gotten this error message-
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed
Error 12: Invalid device requested
Tried the suggestions here aswell-
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
Any thoughts? Im still learning this stuff, any help is greatly appreciated. Soon i'll hopefully be giving advice back! Thanks
Have you made sure you have followed the instructions perfectly? Please post what you get when you run the sudo grub
find /boot/grub/stage1
Also, while you are on the live cd, give us the output of sudo fdisk -l
markuspxpx
September 28th, 2009, 10:28 AM
How can I repair the Vista boot without dvd and from Ubuntu LIVECD ?
because my vista is updated do SP2 and the dvd is SP1 ....
so I can't use repair by the prompt option ...
I'm trying do by the ubuntu console this...
sudo apt-get install update - Ok done.
sudo apt-get install ms-sys - error: E: could not find the package ms-sys
someone can help me ?
bresdog
September 28th, 2009, 01:05 PM
Have you made sure you have followed the instructions perfectly? Please post what you get when you run the sudo grub
find /boot/grub/stage1
Also, while you are on the live cd, give us the output of sudo fdisk -l
Yep followed the steps exactly. Heres the output-
grub> find /boot/grub/stage1
(hd0,5)
ubuntu@ubuntu:~$ sudo fdisk -l
omitting empty partition (5)
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x80d2f3ee
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5187 41664546 7 HPFS/NTFS
/dev/sda2 5188 38913 270904095 5 Extended
/dev/sda3 37880 38913 8305573+ 82 Linux swap / Solaris
/dev/sda5 5188 37075 256140297 83 Linux
/dev/sda6 37076 37879 6458098+ 82 Linux swap / Solaris
Any ideas?
talsemgeest
September 28th, 2009, 06:28 PM
How can I repair the Vista boot without dvd and from Ubuntu LIVECD ?
because my vista is updated do SP2 and the dvd is SP1 ....
so I can't use repair by the prompt option ...
I'm trying do by the ubuntu console this...
sudo apt-get install update - Ok done.
sudo apt-get install ms-sys - error: E: could not find the package ms-sys
someone can help me ?
As far as I know there is no way to restore the vista bootloader from the Ubuntu Live CD. However, there is a free download of the vista recovery disk which should do the same thing as the vista installation dvd. Download it from here (http://neosmart.net/blog/2008/windows-vista-recovery-disc-download/) and follow my instructions for the reinstallation of the vista bootloader.
talsemgeest
September 28th, 2009, 06:31 PM
Yep followed the steps exactly. Heres the output-
grub> find /boot/grub/stage1
(hd0,5)
ubuntu@ubuntu:~$ sudo fdisk -l
omitting empty partition (5)
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x80d2f3ee
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5187 41664546 7 HPFS/NTFS
/dev/sda2 5188 38913 270904095 5 Extended
/dev/sda3 37880 38913 8305573+ 82 Linux swap / Solaris
/dev/sda5 5188 37075 256140297 83 Linux
/dev/sda6 37076 37879 6458098+ 82 Linux swap / Solaris
Any ideas?
So running sudo grub
root (hd0,5)
setup (hd0) gives you the above error?
bresdog
September 29th, 2009, 07:19 AM
It did yeah. After follwoing some steps in a couple of other threads I ended up getting Error 17: Cannot Mount Partition. Gave up there for a couple of hours as i had other stuff to do, when i came back and tried to sort that error it had magically become Error 15: File not Found (along those lines). Turns out my entire hard drive was wiped, and both partitions deleted. Not sure how that happened. Quite a pain in the ***:frown:
talsemgeest
September 29th, 2009, 08:05 AM
It did yeah. After follwoing some steps in a couple of other threads I ended up getting Error 17: Cannot Mount Partition. Gave up there for a couple of hours as i had other stuff to do, when i came back and tried to sort that error it had magically become Error 15: File not Found (along those lines). Turns out my entire hard drive was wiped, and both partitions deleted. Not sure how that happened. Quite a pain in the ***:frown:
Ouch, I'm sorry to hear that. Have you tried recovery tools like testdisk?
bresdog
September 29th, 2009, 08:37 AM
I'll try that when i get back home, in work at the minute. I need xp for some work stuff that was why i was installing it, tried to do a clean install of that on the whole hard drive and its bringing up Non System Disk error. Tried fixmbr and that didn't work. I'll probably just stick Ubuntu on it again. Thanks for the help anyway!
markuspxpx
September 29th, 2009, 09:40 AM
as far as i know there is no way to restore the vista bootloader from the ubuntu live cd. However, there is a free download of the vista recovery disk which should do the same thing as the vista installation dvd. Download it from here (http://neosmart.net/blog/2008/windows-vista-recovery-disc-download/) and follow my instructions for the reinstallation of the vista bootloader.
thank you alot !
talsemgeest
September 29th, 2009, 04:14 PM
I'll try that when i get back home, in work at the minute. I need xp for some work stuff that was why i was installing it, tried to do a clean install of that on the whole hard drive and its bringing up Non System Disk error. Tried fixmbr and that didn't work. I'll probably just stick Ubuntu on it again. Thanks for the help anyway!
Ok, hope it all works out for you :)
thank you alot !
Not a problem, always happy to help.
shadowhawk2008
November 8th, 2009, 12:12 PM
Tried to update grub to grub 2 in karmic koala. Chainloader worked fine so I update from grub legacy. So far when I start the computer I get error 15. I've followed the instructions to reinstall grub bootloader for ubuntu 9.10 but when I enter sudo grub-install root-directory=/media/sda5 /dev/sda I get a message saying "Unrecognised option -root-directory=media/sda5 and a load of different options like type h for help and v for version number etc. No installations take place though (BTW, my ubuntu is on /dev/sda5 aswell). I'm running a dual boot between Win Vista and Ubuntu 9.10.
Photos:
http://www.flickr.com/photos/35581816@N03/4086419946/ what appears after running sudo fdisk -l
http://www.flickr.com/photos/35581816@N03/4085659385/ Unrecognised option message when running sudo grub-install
http://www.flickr.com/photos/35581816@N03/4085657751/in/photostream/ grub error 15
talsemgeest
November 8th, 2009, 05:36 PM
Tried to update grub to grub 2 in karmic koala. Chainloader worked fine so I update from grub legacy. So far when I start the computer I get error 15. I've followed the instructions to reinstall grub bootloader for ubuntu 9.10 but when I enter sudo grub-install –root-directory=/media/sda5 /dev/sda I get a message saying "Unrecognised option -root-directory=media/sda5 and a load of different options like type h for help and v for version number etc. No installations take place though (BTW, my ubuntu is on /dev/sda5 aswell). I'm running a dual boot between Win Vista and Ubuntu 9.10.
Photos:
http://www.flickr.com/photos/35581816@N03/4086419946/ what appears after running sudo fdisk -l
http://www.flickr.com/photos/35581816@N03/4085659385/ Unrecognised option message when running sudo grub-install
http://www.flickr.com/photos/35581816@N03/4085657751/in/photostream/ grub error 15
Thank you for that, it seems I made a typo in my post. There should be an extra dash in the command, this: sudo grub-install --root-directory=/media/sda5 /dev/sda instead of this: sudo grub-install -root-directory=/media/sda5 /dev/sdaHope I havent caused you too much inconvenience. :)
shadowhawk2008
November 11th, 2009, 04:39 PM
Thank you. Will try it again when I get back to my ubuntu box.
:)
von Stalhein
November 13th, 2009, 08:11 PM
After following oyur clear and easy directions I got this output in the LiveCD terminal: -
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa3f79c20
Device Boot Start End Blocks Id System
/dev/sda1 * 2 14593 117210240 f W95 Ext'd (LBA)
/dev/sda5 2 14593 117210208+ 7 HPFS/NTFS
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x960c960c
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 14593 117218241 7 HPFS/NTFS
Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf66fc667
Device Boot Start End Blocks Id System
/dev/sdc1 1 18705 150247881 83 Linux
/dev/sdc2 18706 19457 6040440 5 Extended
/dev/sdc5 18706 19457 6040408+ 82 Linux swap / Solaris
ubuntu@ubuntu:~$ sudo mkdir /media/sdc1
ubuntu@ubuntu:~$ sudo mount /dev/sdc1 /media/sdc1
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sdc1 /dev/sdc1
grub-probe: error: Cannot open `/boot/grub/device.map'
[: 494: =: unexpected operator
Installing GRUB to /dev/sdc1 as (hd2,0)...
Installation finished. No error reported.
This is the contents of the device map /media/sdc1/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc
However, when I try reboot I get the "Error 15" I notice it's still trying to load GRUB stage1.5 - could that be the problem??
This is after a clean install using the alternate CD on a machine that used to boot XP & 9.04. I can still boot XP by changing the boot order in BIOS.
TIA
talsemgeest
November 13th, 2009, 10:42 PM
After following oyur clear and easy directions I got this output in the LiveCD terminal: -
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa3f79c20
Device Boot Start End Blocks Id System
/dev/sda1 * 2 14593 117210240 f W95 Ext'd (LBA)
/dev/sda5 2 14593 117210208+ 7 HPFS/NTFS
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x960c960c
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 14593 117218241 7 HPFS/NTFS
Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf66fc667
Device Boot Start End Blocks Id System
/dev/sdc1 1 18705 150247881 83 Linux
/dev/sdc2 18706 19457 6040440 5 Extended
/dev/sdc5 18706 19457 6040408+ 82 Linux swap / Solaris
ubuntu@ubuntu:~$ sudo mkdir /media/sdc1
ubuntu@ubuntu:~$ sudo mount /dev/sdc1 /media/sdc1
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sdc1 /dev/sdc1
grub-probe: error: Cannot open `/boot/grub/device.map'
[: 494: =: unexpected operator
Installing GRUB to /dev/sdc1 as (hd2,0)...
Installation finished. No error reported.
This is the contents of the device map /media/sdc1/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc
However, when I try reboot I get the "Error 15" I notice it's still trying to load GRUB stage1.5 - could that be the problem??
This is after a clean install using the alternate CD on a machine that used to boot XP & 9.04. I can still boot XP by changing the boot order in BIOS.
TIA
Which Live CD are you using? I am pretty sure it needs to be a 9.10 Live CD for it to work, as every previous release only has support for Grub 1.5.
shadowhawk2008
November 14th, 2009, 12:10 PM
Yep the change worked, it installed without a hitch and there's no more error 15 on boot! Thank you!
talsemgeest
November 14th, 2009, 05:51 PM
Yep the change worked, it installed without a hitch and there's no more error 15 on boot! Thank you!
Excellent, I'm glad it worked. :)
von Stalhein
November 14th, 2009, 07:55 PM
Which Live CD are you using? I am pretty sure it needs to be a 9.10 Live CD for it to work, as every previous release only has support for Grub 1.5.
I used the Alternate, and from the cli. I can't get it to a GUI from the 9.10 CD, it gives "Cannot display this video mode".
I might try another reinstall, it should work "out of the box" with a clean drive!!
I thought it might have been an MBR issue. I booted from an XP disk to do a fixboot etc, but couldn't get into the ecovery console.
When it rebooted, I had forgotten to take the CD from the drive, and it it went to the GRUB2 screen, I thought that the fix had worked. I selected 9.10 it started to load, but again went to the video message as above.
Ignoring that issue at the time, I rebooted sans XP CD, but the same Error 15 and the GRUB 1.5 dialogue reappeared. Back to square one :-)
4 hrs later: - I've reinstalled again, and run the code again - success!!! It goes to the GRUB menu, and will boot 9.10. Unfortunately I still have some video issues, no gui, so back to Google.
talsemgeest
November 15th, 2009, 12:40 AM
Well unfortunately Im not sure if the Alternate cd has the neccesary tools to do it. Sorry I cant be of more help.
von Stalhein
November 15th, 2009, 01:24 AM
I celebrated to soon.
I can boot into 9.10from the GRUB2 menu and get to a cli, but now I can't boot XP.
If I could get the live cd into GUI, I think life would be a lot easier. I'd love to know why a 9.04 will do so but a Karmic one won't.
Just fiddling a bit with grub.cfg, and if no luck there I'll have to do a fixboot or fixmbr and start again.
talsemgeest
November 15th, 2009, 02:34 AM
I celebrated to soon.
I can boot into 9.10from the GRUB2 menu and get to a cli, but now I can't boot XP.
If I could get the live cd into GUI, I think life would be a lot easier. I'd love to know why a 9.04 will do so but a Karmic one won't.
Just fiddling a bit with grub.cfg, and if no luck there I'll have to do a fixboot or fixmbr and start again.
The grub.cfg is not designed to be edited by hand. You are supposed to edit the file /etc/default/grub, and the files in /etc/grub.d/, before running update-grub to implement the changes.
von Stalhein
November 17th, 2009, 04:54 AM
It's all good, I managed to get the system installed (with a GUI and everything!!) and GRUB2.
However, for some reason, GRUB2 installs but even though XP is on /dev/sda it keeps designating /dev/sdb1, which is just an NTFS data drive.
I've done the update-grub cmd from a terminal in Karmic without any change, despite what sudo fdisk -l says.
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa3f79c20
Device Boot Start End Blocks Id System
/dev/sda1 * 2 14593 117210240 f W95 Ext'd (LBA)
/dev/sda5 2 14593 117210208+ 7 HPFS/NTFS
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x960c960c
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 14593 117218241 7 HPFS/NTFS
Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf66fc667
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 1309 10514511 83 Linux
/dev/sdc2 18706 19457 6040440 5 Extended
/dev/sdc3 1310 18705 139733370 83 Linux
/dev/sdc5 18706 19457 6040408+ 82 Linux swap / Solaris
Partition table entries are not in disk order
How do I change it to the XP boot which is /dev/sda ??
talsemgeest
November 17th, 2009, 05:07 AM
Take a look here (http://ubuntuforums.org/showthread.php?t=1195275), especially the section "Adding entries to Grub 2", that page should have everything you need to know.
dastrn
November 19th, 2009, 01:31 PM
I have 9.10 64 bit installed. I setup Windows 7 this morning, and ran into the whole "no way to get into Ubuntu" problem.
When I boot from the livecd, I did all this stuff. But when I run the sudo grub-install --root-dire... line, I am told:
grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea.
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged.
grub-setup: error: Cannot read grub/core.img correctly
Anyone know what to do?
talsemgeest
November 19th, 2009, 02:02 PM
I have 9.10 64 bit installed. I setup Windows 7 this morning, and ran into the whole "no way to get into Ubuntu" problem.
When I boot from the livecd, I did all this stuff. But when I run the sudo grub-install --root-dire... line, I am told:
grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea.
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged.
grub-setup: error: Cannot read grub/core.img correctly
Anyone know what to do?
From that error message it looks as though you have mounted the wrong disk. After running sudo mkdir /media/sdax
sudo mount /dev/sdax /media/sdax
take a look in /media/sdax (the directory you just created), then go to /boot/grub/ and look for the file "core.img". If you cannot find it, it means you are using the wrong drive.
von Stalhein
November 20th, 2009, 06:29 AM
Take a look here (http://ubuntuforums.org/showthread.php?t=1195275), especially the section "Adding entries to Grub 2", that page should have everything you need to know.
Hello talsemgeest,
I added XP in various combinations of dev & partition, without luck.
As per the tute I chmodded every 50_XX script and sudo update-grub, no dice.
I will prevail, I just need to find the key.
Or the blue pill. ;)
Uriolaf
November 24th, 2009, 05:11 PM
Hello,
I am quite new to Ubuntu and Linux. I downloaded Ubuntu 9.10 cd image, burned the cd and tried to install from it.
After I tried to reboot, this is what appeared on the screen:
GRUB loading.
error: biosdisk read error
grub rescue>_
And I wasn't able to boot into neither Windows nor Ubuntu. All I could do is "repair" master boot record with Windows cd, and then managed to boot into Windows. Then I found this topic, tried... and... still cannot boot into Ubuntu. :(
I tried to follow the instructions -- booted with Ubuntu cd, opened terminal, here is what I did:
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 61.5 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd43ad43a
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 7476 39568095 b W95 FAT32
Disk /dev/sdb: 8455 MB, 8455200768 bytes
255 heads, 63 sectors/track, 1027 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00057581
Device Boot Start End Blocks Id System
/dev/sdb1 1 977 7847721 83 Linux
/dev/sdb2 978 1027 401625 5 Extended
/dev/sdb5 978 1027 401593+ 82 Linux swap / Solaris
ubuntu@ubuntu:~$ sudo mkdir /media/sdb1
ubuntu@ubuntu:~$ sudo mount /dev/sdb1 /media/sdb1
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sdb1 /dev/sda
Installation finished. No error reported.
This is the contents of the device map /media/sdb1/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda
(hd1) /dev/sdb
ubuntu@ubuntu:~$
It didn't help. I still cannot boot Ubuntu. :(
What can be the problem?
Please, help!
Uriolaf
November 24th, 2009, 05:14 PM
Hello,
I am quite new to Ubuntu and Linux. I downloaded Ubuntu 9.10 cd image, burned the cd and tried to install from it.
After I tried to reboot, this is what appeared on the screen:
GRUB loading.
error: biosdisk read error
grub rescue>_
And I wasn't able to boot into neither Windows nor Ubuntu. All I could do is "repair" master boot record with Windows cd, and then managed to boot into Windows. Then I found this topic, tried... and... still cannot boot into Ubuntu. :(
I tried to follow the instructions -- booted with Ubuntu cd, opened terminal, here is what I did:
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 61.5 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd43ad43a
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 7476 39568095 b W95 FAT32
Disk /dev/sdb: 8455 MB, 8455200768 bytes
255 heads, 63 sectors/track, 1027 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00057581
Device Boot Start End Blocks Id System
/dev/sdb1 1 977 7847721 83 Linux
/dev/sdb2 978 1027 401625 5 Extended
/dev/sdb5 978 1027 401593+ 82 Linux swap / Solaris
ubuntu@ubuntu:~$ sudo mkdir /media/sdb1
ubuntu@ubuntu:~$ sudo mount /dev/sdb1 /media/sdb1
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sdb1 /dev/sda
Installation finished. No error reported.
This is the contents of the device map /media/sdb1/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda
(hd1) /dev/sdb
ubuntu@ubuntu:~$
It didn't help. I still cannot boot Ubuntu, again I'm getting the same error messages instead. :(
What can be the problem?
Please, help!
talsemgeest
November 24th, 2009, 06:16 PM
Hello,
I am quite new to Ubuntu and Linux. I downloaded Ubuntu 9.10 cd image, burned the cd and tried to install from it.
After I tried to reboot, this is what appeared on the screen:
And I wasn't able to boot into neither Windows nor Ubuntu. All I could do is "repair" master boot record with Windows cd, and then managed to boot into Windows. Then I found this topic, tried... and... still cannot boot into Ubuntu. :(
I tried to follow the instructions -- booted with Ubuntu cd, opened terminal, here is what I did:
It didn't help. I still cannot boot Ubuntu, again I'm getting the same error messages instead. :(
What can be the problem?
Please, help!
Hi, this is a known issue (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/396564), you may want to subscribe to the bug to be notified when this is fixed. However, most of the users with this problem are using some form of RAID setup (using 2 or more hard drives as a single hard drive). Are you doing anything like this?
As a workaround you may want to use Ubuntu 9.04, at least until the problem is fixed.
Also, it is best not to double post, thanks :)
Uriolaf
November 24th, 2009, 06:30 PM
Hi, this is a known issue (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/396564), you may want to subscribe to the bug to be notified when this is fixed. However, most of the users with this problem are using some form of RAID setup (using 2 or more hard drives as a single hard drive). Are you doing anything like this?
As a workaround you may want to use Ubuntu 9.04, at least until the problem is fixed.
Thank you. I don't use RAID setup. I just have two hard disks, one for Windows and now one for Ubuntu.
Also, it is best not to double post, thanks :)
Sorry, wasn't on purpose. I wanted to edit the post and somehow posted it again. :oops: I can't delete it.
talsemgeest
November 24th, 2009, 06:43 PM
Thank you. I don't use RAID setup. I just have two hard disks, one for Windows and now one for Ubuntu.
Sorry, wasn't on purpose. I wanted to edit the post and somehow posted it again. :oops: I can't delete it.
Also, which Ubuntu CD did you install from?
berserkpi
November 25th, 2009, 07:55 PM
Hi there. I tried to restore GRUB bootloader using your steps:
1) fdisk -l
I figured out whar my root is...
/dev/sda1 -> Win7
/dev/sda2 -> Extended
/dev/sda5 -> Linux install (root)
/dev/sda6 -> Linux (home)
/dev/sda7 -> Swap
2) mount /dev/sda5 /media/sda5
I dont have a boot partition, thus, I suppose my boot is /boot under root (device: /dev/sda5).
3) grub-install --root-directory=/media/sda5 /dev/sda
After this I got the device.map message, this file contains just the reference to my hd.
4) OK, now reboot. But then I just got the 'GRUB's Minimal BASH-like' :(. I mean, I can't get into the boot menu, I just get this grub's command line.
What to do now?. Did I do something wrong?. I hope u can help me on this.
talsemgeest
November 25th, 2009, 08:34 PM
Hi there. I tried to restore GRUB bootloader using your steps:
1) fdisk -lI figured out whar my root is...
/dev/sda1 -> Win7
/dev/sda2 -> Extended
/dev/sda5 -> Linux install (root)
/dev/sda6 -> Linux (home)
/dev/sda7 -> Swap
2) mount /dev/sda5 /media/sda5I dont have a boot partition, thus, I suppose my boot is /boot under root (device: /dev/sda5).
3) grub-install --root-directory=/media/sda5 /dev/sdaAfter this I got the device.map message, this file contains just the reference to my hd.
4) OK, now reboot. But then I just got the 'GRUB's Minimal BASH-like' :(. I mean, I can't get into the boot menu, I just get this grub's command line.
What to do now?. Did I do something wrong?. I hope u can help me on this.
Can you post the output of the commands you have run (into tags preferably). That will make it easier to tell what the problem is. Also, after running mount /dev/sda5 /media/sda5, take a look in /media/sda5/boot/ and see if the normal grub files are there.
berserkpi
November 25th, 2009, 10:14 PM
Can you post the output of the commands you have run (into tags preferably). That will make it easier to tell what the problem is. Also, after running mount /dev/sda5 /media/sda5, take a look in /media/sda5/boot/ and see if the normal grub files are there.
I couldn't post the outputs coz I was in another pc, sorry for that. I got the following outputs:
1) sudo fdisk -l
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5099 40957686 7 HPFS/NTFS
/dev/sda2 5100 14593 76260555 5 Extended
/dev/sda5 5100 7531 19535008+ 83 Linux
/dev/sda6 7532 14339 54685228+ 83 Linux
/dev/sda7 14340 14593 2040223+ 82 Linux swap / Solaris
So, my root is sda5 -(hd0,4) in grub's notation-.
2) sudo mount /dev/sda5 /media/sda5
no outout
3) Running ls /media/sda5/boot I get:
abi-2.6.28-16-generic config-2.6.31-15-generic memtest86+.bin vmcoreinfo-2.6.31-14-generic
abi-2.6.31-14-generic grub System.map-2.6.28-16-generic vmcoreinfo-2.6.31-15-generic
abi-2.6.31-15-generic initrd.img-2.6.28-16-generic System.map-2.6.31-14-generic vmlinuz-2.6.28-16-generic
config-2.6.28-16-generic initrd.img-2.6.31-14-generic System.map-2.6.31-15-generic vmlinuz-2.6.31-14-generic
config-2.6.31-14-generic initrd.img-2.6.31-15-generic vmcoreinfo-2.6.28-16-generic vmlinuz-2.6.31-15-generic
So... that is my boot, no doubt.
4) sudo grub-install --root-directory=/media/sda5 /dev/sda
output:
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script 'grub-install'.
Everything was ok at this point, but when I rebooted, GRUB just showed the shell (there was no menu)... u know:
[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub>
So, this was my problem, and I say was coz I already solved it. I'll explain this in my next reply -in a few minutes-.
berserkpi
November 25th, 2009, 10:48 PM
Ok as I promised, this is how I restored my grub.
1) I downloaded a Super grub disk from: http://www.supergrubdisk.org/index.php?pid=5
2) I burned it on a CD and rebooted my system using it. I just made sure My BIOS could reboot fron CD.
It gives two options:
Boot Ubuntu GNU/Linux
AUTO MAGIC BOOT
Both of them worked like a charm for me. Once I got into my beloved KDE desktop I fixed the problem...
3) I just followed the steps at the beginning of this post.
In my case:
sudo grub
grub> find /boot/grub/stage1
output: (hd0,4)
grub> root (hd0,4)
grub> setup (hd0)
grub> quit
4) After that, I just edited my menu.lst (so I could boot win7):
sudo gedit /boot/grub/menu.lst
### 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 7 Ultimate
rootnoverify (hd0,0)
savedefault
makeactive
chainloader +1
---------------------------------
Ok, question time: What I did in step 3 means that my GRUB is not version 2?. How can I check the GRUB's version?
Also, booting from live CD, grub seems not to be installed. In those cases, can I install it using apt-get ??. Do I need internet connection?... or perhaps... install it from the CD??
Thak u very much for ur help. :)
talsemgeest
November 25th, 2009, 10:53 PM
Ok as I promised, this is how I restored my grub.
1) I downloaded a Super grub disk from: http://www.supergrubdisk.org/index.php?pid=5
2) I burned it on a CD and rebooted my system using it. I just made sure My BIOS could reboot fron CD.
It gives two options:
Boot Ubuntu GNU/Linux
AUTO MAGIC BOOT
Both of them worked like a charm for me. Once I got into my beloved KDE desktop I fixed the problem...
3) I just followed the steps at the beginning of this post.
In my case:
sudo grub
grub> find /boot/grub/stage1
output: (hd0,4)
grub> root (hd0,4)
grub> setup (hd0)
grub> quit
4) After that, I just edited my menu.lst (so I could boot win7):
sudo gedit /boot/grub/menu.lst
### 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 7 Ultimate
rootnoverify (hd0,0)
savedefault
makeactive
chainloader +1
---------------------------------
Ok, question time: What I did in step 3 means that my GRUB is not version 2?. How can I check the GRUB's version?
Also, booting from live CD, grub seems not to be installed. In those cases, can I install it using apt-get ??. Do I need internet connection?... or perhaps... install it from the CD??
Thak u very much for ur help. :)
Well, if sudo grub actually works, it means you are using a version of ubuntu less than 9.10, that still uses grub 1.5. So, if you had followed the instructions for Ubuntu 9.04, using the Ubuntu 9.04 cd, that would have worked for you.
von Stalhein
November 26th, 2009, 03:55 AM
I've not made much progress. I disconnected my other HDD to leave the XP disk and the Karmic one, and re-installed GRUB.
Output of sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.31-15-generic
Found initrd image: /boot/initrd.img-2.6.31-15-generic
Found linux image: /boot/vmlinuz-2.6.31-14-generic
Found initrd image: /boot/initrd.img-2.6.31-14-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Home Edition on /dev/sda1
done
Output of blkid
/dev/sda1: UUID="01C3D871F965AC80" LABEL="DSK1_VOL1" TYPE="ntfs"
/dev/sdb5: UUID="27179ee5-e990-4dcb-9fc8-a5857a0f1b37" TYPE="swap"
/dev/sdb1: UUID="ece48d4f-95ce-4c32-8ae6-20c3f3563597" TYPE="ext4"
/dev/sdb2: UUID="b073ff20-47f8-440f-98fc-5bbc5fcbbd8d" TYPE="ext4"
My grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=15
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-15-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro quiet splash
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Ubuntu, Linux 2.6.31-15-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro single
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 01c3d871f965ac80
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
The Ubuntu disk is first in boot order in the BIOS
Output of fdisk -l /dev/sda
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x960c960c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 14593 117218241 7 HPFS/NTFS
Output of fdisk -l /dev/sdb
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf66fc667
Unless I'm much mistaken, the above is all in order - happy to be corrected.
Before posting this I swapped the boot order and XP boots up fine, so it's not an MBR or fixboot issue.
When selected in the GRUB menu, the XP HDD LED operates while a blinking bar is on the screen, then the screen fades and a hard reset is necessary - it's almost as if there is something in the boot command that fails to kick it over the hump. :confused:
Happy to redo or do any troubleshooting recommended, I can't believe this won't go - gotta be between the chair and keyboard issue!!! :p
talsemgeest
November 26th, 2009, 06:01 AM
I've not made much progress. I disconnected my other HDD to leave the XP disk and the Karmic one, and re-installed GRUB.
Output of sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.31-15-generic
Found initrd image: /boot/initrd.img-2.6.31-15-generic
Found linux image: /boot/vmlinuz-2.6.31-14-generic
Found initrd image: /boot/initrd.img-2.6.31-14-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Home Edition on /dev/sda1
done
Output of blkid
/dev/sda1: UUID="01C3D871F965AC80" LABEL="DSK1_VOL1" TYPE="ntfs"
/dev/sdb5: UUID="27179ee5-e990-4dcb-9fc8-a5857a0f1b37" TYPE="swap"
/dev/sdb1: UUID="ece48d4f-95ce-4c32-8ae6-20c3f3563597" TYPE="ext4"
/dev/sdb2: UUID="b073ff20-47f8-440f-98fc-5bbc5fcbbd8d" TYPE="ext4"
My grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=15
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-15-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro quiet splash
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Ubuntu, Linux 2.6.31-15-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro single
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set ece48d4f-95ce-4c32-8ae6-20c3f3563597
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ece48d4f-95ce-4c32-8ae6-20c3f3563597 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 01c3d871f965ac80
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
The Ubuntu disk is first in boot order in the BIOS
Output of fdisk -l /dev/sda
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x960c960c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 14593 117218241 7 HPFS/NTFS
Output of fdisk -l /dev/sdb
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf66fc667
Unless I'm much mistaken, the above is all in order - happy to be corrected.
Before posting this I swapped the boot order and XP boots up fine, so it's not an MBR or fixboot issue.
When selected in the GRUB menu, the XP HDD LED operates while a blinking bar is on the screen, then the screen fades and a hard reset is necessary - it's almost as if there is something in the boot command that fails to kick it over the hump. :confused:
Happy to redo or do any troubleshooting recommended, I can't believe this won't go - gotta be between the chair and keyboard issue!!! :p
Well, as it seems to be a problem with grub 2, and it still happens after a reinstall of grub2 (I'm pretty sure you have done reinstalls of Ubuntu as well?), it is classified as a bug. All I can suggest is that you file a bug report (as per this post (http://ubuntuforums.org/showthread.php?t=1011078)). Either it is not a bug and the devs there will figure out the exact problem, or it is a bug and it gets fixed, both for you and for everyone else having the same problem as you. :)
I am sorry I have no more ideas, by all means it should be working.
von Stalhein
November 26th, 2009, 06:50 AM
Thanks talsemgeest, I've listed it as a bug.
phillw
November 26th, 2009, 05:42 PM
drs has a good how-to over this way --> http://ubuntuforums.org/showthread.php?t=1195275
It covers such delights as re-installing Grub from a boot disk, etc.
His more in-depth one is over here --> https://help.ubuntu.com/community/Grub2
For anyone running Wubi it's all slightly different .....
http://ubuntuforums.org/showthread.php?t=1335464&page=3 Is the current proposed solution.
Phill.
talsemgeest
November 26th, 2009, 06:45 PM
drs has a good how-to over this way --> http://ubuntuforums.org/showthread.php?t=1195275
It covers such delights as re-installing Grub from a boot disk, etc.
His more in-depth one is over here --> https://help.ubuntu.com/community/Grub2
Haha, you got me! I actually used his grub2 tutorial when updating my tutorial for Ubuntu 9.10. I have thanked him very much on IRC for it though ;)
For anyone running Wubi it's all slightly different .....
Is the current proposed solution.
Phill.
Hmm, what does wubi have to do with grub2? I thought that it uses the windows bootloader to boot, everything else is self-contained?
kansasnoob
November 26th, 2009, 09:35 PM
I've not read every post so excuse me if I'm just repeating something. Given the number of grub2 failures and the number of those who lack a restore disc or the ability to burn one I decided to give ms-sys another look.
Well, forget ms-sys! Hello mbr! I've only been able to test this with Win XP but it's supposed to work with Vista and Win7 as well.
Boot your Ubuntu Live CD and run "sudo fdisk -l" just to determine which drive you want the mbr on. Then:
sudo apt-get install mbr
and:
sudo install-mbr /dev/sdX
(of course replace the X with your destination)
Then just reboot.
I actually tried that with XP and it worked fine.
I may be able to try that with Win7 in the next couple of days.
talsemgeest
November 27th, 2009, 01:36 AM
Thanks for the help, I will try to incorporate it into the guide tomorrow. :)
Uriolaf
November 27th, 2009, 05:24 AM
Also, which Ubuntu CD did you install from?
I burned it from iso image named "Ubuntu Desktop 9.10 (32 bit)", which I downloaded here: http://www.ubuntu.com/getubuntu/download
(http://www.ubuntu.com/getubuntu/download)
von Stalhein
November 27th, 2009, 06:41 AM
talsemgeest - can you recommend a link for installing the older grub and replacing Grub 2?
I know the legacy one worked, and in the interim I'd like to use that, if I can find out how to :D
I've googled and found heaps on upgrading, but not downgrading.
Whoops!! Ignore that. Using different search words, found http://ubuntuforums.org/showpost.php?p=8341799&postcount=4
von Stalhein
November 27th, 2009, 07:33 AM
The legacy version is back on and works a treat.
I did a little happy dance, but I am still perplexed.
berserkpi
November 27th, 2009, 06:41 PM
Well, if sudo grub actually works, it means you are using a version of ubuntu less than 9.10, that still uses grub 1.5. So, if you had followed the instructions for Ubuntu 9.04, using the Ubuntu 9.04 cd, that would have worked for you.
I'm not sure about that, look:
lsb_release -a
output:
Distributor ID: Ubuntu
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic
sudo grub
output:
[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub>
So, there is something extrange here ...:confused:
von Stalhein
November 27th, 2009, 09:56 PM
I have read in my recent copious research of installations that did not completely overwrite the legacy version, and the situation you describe above occurring. It was to do with MBR issue IIRC.
I'm sorry, I don't remember exactly where.
I would suggest giving Google a flogging for similar situations and hopefully the remedy.
talsemgeest
November 28th, 2009, 12:50 AM
I have read in my recent copious research of installations that did not completely overwrite the legacy version, and the situation you describe above occurring. It was to do with MBR issue IIRC.
I'm sorry, I don't remember exactly where.
I would suggest giving Google a flogging for similar situations and hopefully the remedy.
Thanks for that von Stalhein :)
All I can guess is that perhaps you upgraded from 9.04 and grub2 didn't install?
dohzer
November 29th, 2009, 12:44 AM
I'm having a similar problem to berserkpi. I followed the steps for Ubuntu 9.10 Grub repair, and when I reboot I simply get a Grub command line... it doesn't boot an OS or go anywhere.
4) OK, now reboot. But then I just got the 'GRUB's Minimal BASH-like' :(. I mean, I can't get into the boot menu, I just get this grub's command line.
What to do now?. Did I do something wrong?. I hope u can help me on this.
I've got a Dell Vostro 1520 with Windows XP, Windows Vista (don't use it) and Ubuntu 9.10 installed. For some reason, occasionally when I reboot from Windows (say if I want to go into Linux), the Grub boot loader seems to be corrupting and it keeps power cycling after trying to load Grub. Last time I fixed it by simply formatting my Linux partition and reinstalling Ubuntu, but I'd rather keep the installation if I can this time.
Here's my computer setup:
I have three operating systems that were installed in the following order:
Windows XP
Windows Vista
Ubuntu 9.10
Here is the partition setup:
/dev/sda = 320GB Drive
/dev/sda1 = Windows XP Install
/dev/sda2 = 241GB Extended
/dev/sda5 = Windows Vista Install
/dev/sda6 = Ubuntu 9.10 Install
/dev/sda7 = Swap Partiton
/dev/sda8 = 16GB FAT32 Partition (random data)
/dev/sda9 = 117GB NTFS Partition (random data) Device Boot Start End Blocks Id System
/dev/sda1 * 1 9561 76798701 7 HPFS/NTFS
/dev/sda2 9562 38912 235761907+ f W95 Ext'd (LBA)
/dev/sda5 9562 19122 76798701 7 HPFS/NTFS
/dev/sda6 19123 21672 20482843+ 83 Linux
/dev/sda7 21673 22716 8385898+ 82 Linux swap / Solaris
/dev/sda8 22717 24628 15358108+ b W95 FAT32
/dev/sda9 24629 38912 114736198+ 7 HPFS/NTFSThe first time I tried fixing Grub, I just ran through the steps in the OP, and everything seemed to go to plan, but I probably wasn't paying much attention to the terminal outputs. I tried it again a minutes ago, and I get the below error from the following command:
Command:
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sda6 /dev/sdaOutput:
grub-probe: error: Cannot open `/boot/grub/device.map'
[: 494: =: unexpected operator
Installing GRUB to /dev/sda as (hd0)...
Installation finished. No error reported.
This is the contents of the device map /media/sda6/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda
This is what is inside /boot/grub/device.map:
(hd0) /dev/sdaDoes that look correct? Should there be a complete list of all partitions?
Is there anything else I need to do/try?
dohzer
November 29th, 2009, 03:55 AM
After rebooting and re-loading Ubuntu from the install CD, I just retried the Grub2 recovery steps from the OP, and the results seem to be inconsistent:
This time I get:
ubuntu@ubuntu:~$ sudo mkdir /media/sda6
ubuntu@ubuntu:~$ sudo mount /dev/sda6 /media/sda6
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sda6 /dev/sda6
grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea.
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged.
grub-setup: error: Cannot read `/grub/core.img' correctly
I didn't get that warning the last time I used those commands. :confused:
talsemgeest
November 29th, 2009, 04:01 AM
I'm having a similar problem to berserkpi. I followed the steps for Ubuntu 9.10 Grub repair, and when I reboot I simply get a Grub command line... it doesn't boot an OS or go anywhere.
I've got a Dell Vostro 1520 with Windows XP, Windows Vista (don't use it) and Ubuntu 9.10 installed. For some reason, occasionally when I reboot from Windows (say if I want to go into Linux), the Grub boot loader seems to be corrupting and it keeps power cycling after trying to load Grub. Last time I fixed it by simply formatting my Linux partition and reinstalling Ubuntu, but I'd rather keep the installation if I can this time.
Here's my computer setup:
I have three operating systems that were installed in the following order:
Windows XP
Windows Vista
Ubuntu 9.10
Here is the partition setup:
/dev/sda = 320GB Drive
/dev/sda1 = Windows XP Install
/dev/sda2 = 241GB Extended
/dev/sda5 = Windows Vista Install
/dev/sda6 = Ubuntu 9.10 Install
/dev/sda7 = Swap Partiton
/dev/sda8 = 16GB FAT32 Partition (random data)
/dev/sda9 = 117GB NTFS Partition (random data) Device Boot Start End Blocks Id System
/dev/sda1 * 1 9561 76798701 7 HPFS/NTFS
/dev/sda2 9562 38912 235761907+ f W95 Ext'd (LBA)
/dev/sda5 9562 19122 76798701 7 HPFS/NTFS
/dev/sda6 19123 21672 20482843+ 83 Linux
/dev/sda7 21673 22716 8385898+ 82 Linux swap / Solaris
/dev/sda8 22717 24628 15358108+ b W95 FAT32
/dev/sda9 24629 38912 114736198+ 7 HPFS/NTFSThe first time I tried fixing Grub, I just ran through the steps in the OP, and everything seemed to go to plan, but I probably wasn't paying much attention to the terminal outputs. I tried it again a minutes ago, and I get the below error from the following command:
Command:
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sda6 /dev/sdaOutput:
grub-probe: error: Cannot open `/boot/grub/device.map'
[: 494: =: unexpected operator
Installing GRUB to /dev/sda as (hd0)...
Installation finished. No error reported.
This is the contents of the device map /media/sda6/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda
This is what is inside /boot/grub/device.map:
(hd0) /dev/sdaDoes that look correct? Should there be a complete list of all partitions?
Is there anything else I need to do/try?
"grub-probe: error: Cannot open `/boot/grub/device.map'"
Either you are using the wrong partition, or grub is not installed. After you have mounted the hard drive, take a look inside /media/sdax, and see if all the files are in the boot directory. Also, it may be worth a shot trying the instructions for 9.04 using a 9.04 live cd, as it may be using the older version of grub.
talsemgeest
November 29th, 2009, 04:02 AM
After rebooting and re-loading Ubuntu from the install CD, I just retried the Grub2 recovery steps from the OP, and the results seem to be inconsistent:
This time I get:
ubuntu@ubuntu:~$ sudo mkdir /media/sda6
ubuntu@ubuntu:~$ sudo mount /dev/sda6 /media/sda6
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sda6 /dev/sda6
grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea.
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged.
grub-setup: error: Cannot read `/grub/core.img' correctly
I didn't get that warning the last time I used those commands. :confused:
The problem there is that you are using sudo grub-install --root-directory=/media/sda6 /dev/sda6 instead of sudo grub-install --root-directory=/media/sda6 /dev/sda
dohzer
November 29th, 2009, 07:36 AM
The problem there is that you are using sudo grub-install --root-directory=/media/sda6 /dev/sda6 instead of sudo grub-install --root-directory=/media/sda6 /dev/sda
Oops... thanks for picking that up! It's been a long day. :p
"grub-probe: error: Cannot open `/boot/grub/device.map'"
Either you are using the wrong partition, or grub is not installed. After you have mounted the hard drive, take a look inside /media/sdax, and see if all the files are in the boot directory. Also, it may be worth a shot trying the instructions for 9.04 using a 9.04 live cd, as it may be using the older version of grub.
I would have tried this, but after I removed the '6' from the command, it finally worked. I'm still not sure what was happening on the previous attempt (I'm sure I was using the correct syntax and partition before), but for now it is fixed.
Hopefully the boot loader doesn't corrupt again, but I'm betting it will. :(
At least now I know how to fix it if it does!
Thanks for the help.
talsemgeest
November 29th, 2009, 06:29 PM
Oops... thanks for picking that up! It's been a long day. :p
I would have tried this, but after I removed the '6' from the command, it finally worked. I'm still not sure what was happening on the previous attempt (I'm sure I was using the correct syntax and partition before), but for now it is fixed.
Hopefully the boot loader doesn't corrupt again, but I'm betting it will. :(
At least now I know how to fix it if it does!
Thanks for the help.
Ok, I hope it stays working for you! :)
meep_meep
December 6th, 2009, 08:30 AM
solved
talsemgeest
December 6th, 2009, 05:36 PM
solved
I'm glad you got it working :)
fgmart
December 6th, 2009, 07:22 PM
talsemgeest, you saved my beans! Your message to dohzer was exactly the mistake I was making.
Thanks so much.
talsemgeest
December 6th, 2009, 09:51 PM
Haha excellent, I am always glad to help :)
Ferrari69
December 8th, 2009, 03:09 PM
Hello,
I had 2 partitions with 2 XP. I selected the 1st partition, i formatted it, and i installed Ubuntu 9.10 on it.
Now i cant boot into XP cz is showing me the XP loader of the XP that i deleted..
i tried fixmbr,fixboot but nothing.
In the beggining XP couldnt boot, but at least i could browse the folders from Linux.
Now in the Disk Utility its written Unrecognised, Unkown or unused.
Screenshots:
http://img690.imageshack.us/i/screen1di.jpg/
http://img38.imageshack.us/i/screen2rj.jpg/
here it is:
~# fdisk -l
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb7e61057
Device Boot Start End Blocks Id System
/dev/sda1 * 1 22508 180795478+ 83 Linux
/dev/sda2 22509 30400 63392490 f W95 Ext'd (LBA)
/dev/sda5 * 22752 30400 61440592+ 7 HPFS/NTFS
/dev/sda6 22509 22751 1951834+ 82 Linux swap / Solaris
~#
~# ntfsfix /dev/sda5
Mounting volume... $MFT has invalid magic.
ntfs_mft_load(): Failed.
Failed to load $MFT: Input/output error.
Failed to startup volume: Input/output error.
FAILED
Attempting to correct errors... $MFT has invalid magic.
ntfs_mft_load(): Failed.
Failed to load $MFT: Input/output error.
FAILED
Failed to startup volume: Input/output error.
Volume is corrupt. You should run chkdsk.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
update view, after playing with some partition boot CDS:
root@ubuntu-tower:~# fdisk -l
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb7e61057
Device Boot Start End Blocks Id System
/dev/sda1 * 1 22508 180795478+ 83 Linux
/dev/sda3 22752 30400 61440592+ 7 HPFS/NTFS
preparing now screenshot of GParted and Disk Utility:
http://i46.tinypic.com/4hvdyc.jpg
wat should i do? any ideas?
Thanks.
kaspin
December 8th, 2009, 03:26 PM
Hi Talsemegeest,
I've just bought a 16GB SDHC card for my ASUS EEE (701 with 4GB SSD), with the intention of moving WinXP from the SSD and fitting it alongside Ubuntu 9,10. on the SDHC.
I first installed XP, on half the card (SDB1 formatted NFTS) and then Ubuntu on the other half (SDB2 Ext4). I somehow messed up Grub2, and could only boot (XP) from the SSD (SDA1).
Fortunately, I found this post and was able to restore the grub bootloader by following your excellent instructions (saved me hours of frustration). So now, if I boot form the SDHC card, Grub gives me the option of booting either Ubuntu from SDB2 (the SDHC card) or XP from SDA1 (the SSD).
However, I would like to be able to boot XP from the SDHC card (SDB1), and perhaps put back the original Xandros OS on the SSD, and was wondering whether I could modify Grub2 to achieve this. I'm not sure if this is the right place to ask this question, but as you are obviously well versed in this area................... Many thanks in advance.
talsemgeest
December 8th, 2009, 07:07 PM
Hi Talsemegeest,
I've just bought a 16GB SDHC card for my ASUS EEE (701 with 4GB SSD), with the intention of moving WinXP from the SSD and fitting it alongside Ubuntu 9,10. on the SDHC.
I first installed XP, on half the card (SDB1 formatted NFTS) and then Ubuntu on the other half (SDB2 Ext4). I somehow messed up Grub2, and could only boot (XP) from the SSD (SDA1).
Fortunately, I found this post and was able to restore the grub bootloader by following your excellent instructions (saved me hours of frustration). So now, if I boot form the SDHC card, Grub gives me the option of booting either Ubuntu from SDB2 (the SDHC card) or XP from SDA1 (the SSD).
However, I would like to be able to boot XP from the SDHC card (SDB1), and perhaps put back the original Xandros OS on the SSD, and was wondering whether I could modify Grub2 to achieve this. I'm not sure if this is the right place to ask this question, but as you are obviously well versed in this area................... Many thanks in advance.
You can install the bootloader onto whichever device you want, simply run sudo grub-install --root-directory=/media/sda5 /dev/sdx replacing the x with the device letter of the SDHC.
talsemgeest
December 8th, 2009, 07:08 PM
Hello,
I had 2 partitions with 2 XP. I selected the 1st partition, i formatted it, and i installed Ubuntu 9.10 on it.
Now i cant boot into XP cz is showing me the XP loader of the XP that i deleted..
i tried fixmbr,fixboot but nothing.
In the beggining XP couldnt boot, but at least i could browse the folders from Linux.
Now in the Disk Utility its written Unrecognised, Unkown or unused.
Screenshots:
http://img690.imageshack.us/i/screen1di.jpg/
http://img38.imageshack.us/i/screen2rj.jpg/
here it is:
~# fdisk -l
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb7e61057
Device Boot Start End Blocks Id System
/dev/sda1 * 1 22508 180795478+ 83 Linux
/dev/sda2 22509 30400 63392490 f W95 Ext'd (LBA)
/dev/sda5 * 22752 30400 61440592+ 7 HPFS/NTFS
/dev/sda6 22509 22751 1951834+ 82 Linux swap / Solaris
~#
~# ntfsfix /dev/sda5
Mounting volume... $MFT has invalid magic.
ntfs_mft_load(): Failed.
Failed to load $MFT: Input/output error.
Failed to startup volume: Input/output error.
FAILED
Attempting to correct errors... $MFT has invalid magic.
ntfs_mft_load(): Failed.
Failed to load $MFT: Input/output error.
FAILED
Failed to startup volume: Input/output error.
Volume is corrupt. You should run chkdsk.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
update view, after playing with some partition boot CDS:
root@ubuntu-tower:~# fdisk -l
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb7e61057
Device Boot Start End Blocks Id System
/dev/sda1 * 1 22508 180795478+ 83 Linux
/dev/sda3 22752 30400 61440592+ 7 HPFS/NTFS
preparing now screenshot of GParted and Disk Utility:
http://i46.tinypic.com/4hvdyc.jpg
wat should i do? any ideas?
Thanks.
Simply run through the instructions for installing the Ubuntu bootloader for the version of Ubuntu you installed, then you should be able to boot into XP and ubuntu.
Ferrari69
December 8th, 2009, 07:09 PM
Simply run through the instructions for installing the Ubuntu bootloader for the version of Ubuntu you installed, then you should be able to boot into XP and ubuntu.
the disk with xp its ntfs, but its not readable, so it cant boot
talsemgeest
December 8th, 2009, 07:18 PM
the disk with xp its ntfs, but its not readable, so it cant boot
Ok, so you want to delete the XP partition and switch to Ubuntu?
Ferrari69
December 8th, 2009, 07:38 PM
Ok, so you want to delete the XP partition and switch to Ubuntu?
no, i want to boot in both systems
talsemgeest
December 8th, 2009, 08:55 PM
no, i want to boot in both systems
Ok, so if the XP partition is corrupted, you simply reinstall XP onto the corrupted partition, formating during the installation process, before booting into the ubuntu cd and fixing the bootloader as per the original post.
Ferrari69
December 8th, 2009, 08:59 PM
Ok, so if the XP partition is corrupted, you simply reinstall XP onto the corrupted partition, formating during the installation process, before booting into the ubuntu cd and fixing the bootloader as per the original post.
yes i know that, but i wanted to fix the problem. cz i have a new XP system on that partition.
talsemgeest
December 8th, 2009, 09:01 PM
yes i know that, but i wanted to fix the problem. cz i have a new XP system on that partition.
cz? Also, I am not entirely sure I see the problem.
Ferrari69
December 8th, 2009, 09:10 PM
cz? Also, I am not entirely sure I see the problem.
cz=cause=because :)
talsemgeest
December 8th, 2009, 10:15 PM
cz=cause=because :)
Ok, it is best to use proper English in the forums to avoid any misunderstandings. Also, can you please restate exactly what the problem is?
vsk_ram21
December 9th, 2009, 10:04 AM
please help me in enabling Fedora booting option in Ubuntu 9.10 Grub...
my Partition details:
root@satz-laptop:/media/49AF-1EB3/pro# fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xea10ea10
Device Boot Start End Blocks Id System
/dev/sda1 1 1494 12000523+ 83 Linux
/dev/sda2 5224 19457 114334605 c W95 FAT32 (LBA)
/dev/sda3 * 3266 3291 204800 83 Linux
/dev/sda4 3292 5223 15518790 5 Extended
/dev/sda5 3292 5223 15518720 8e Linux LVM
Partition table entries are not in disk order
/dev/sda1 -Ubuntu partion
talsemgeest
December 9th, 2009, 10:08 AM
please help me in enabling Fedora booting option in Ubuntu 9.10 Grub...
my Partition details:
root@satz-laptop:/media/49AF-1EB3/pro# fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xea10ea10
Device Boot Start End Blocks Id System
/dev/sda1 1 1494 12000523+ 83 Linux
/dev/sda2 5224 19457 114334605 c W95 FAT32 (LBA)
/dev/sda3 * 3266 3291 204800 83 Linux
/dev/sda4 3292 5223 15518790 5 Extended
/dev/sda5 3292 5223 15518720 8e Linux LVM
Partition table entries are not in disk order
/dev/sda1 -Ubuntu partion
Running sudo update-grub should automatically detect Fedora and add it to the Ubuntu grub menu.
kaspin
December 10th, 2009, 07:29 AM
Hello again Telsemgeest,
Many thanks for your speedy and helpful reply.
The ubuntuforums.org site was down for a while so this posting is a little late.
I tried what you suggested "sudo grub-install --root-directory=/media/sda5 /dev/sdx" but without success.
To recap:
- /dev/sda is my SSD with one partition (sda1) containing WinXP.
- /dev/sdb is my SDHC card with sdb1 being NFTS (WinXP) and
sb2 being Ext4 (Linux), containing Ubuntu on sdb5 and the Linux swap file on sdb6.
According to G-Parted, sda1 and sdb5 are both boot.
I couldn't understand what sda5 referred to in your formula. Should it have been sdb5 (i.e. the Ubuntu program which is boot)? Anyway, I tried sda5, sdb5, sdb1, sda1, followed each time by sudo update-grub. Incidentally,"sdx" was always sdb.
In the end I somehow screwed up my SDHC card so that if I try to boot from it now,
I get "Grub loading error: File not found grub rescue>"
and there I'm stuck...If you have any other ideas they'd be more than welcome. If it comes to it, I'll reformat the SDHC card, reinstall WinXP and Ubuntu on it, and try again to get grub to recognise sdb1 as well as sdb5.....
Thanks again, Kaspin
talsemgeest
December 10th, 2009, 06:37 PM
Hello again Telsemgeest,
Many thanks for your speedy and helpful reply.
The ubuntuforums.org site was down for a while so this posting is a little late.
I tried what you suggested "sudo grub-install --root-directory=/media/sda5 /dev/sdx" but without success.
To recap:
- /dev/sda is my SSD with one partition (sda1) containing WinXP.
- /dev/sdb is my SDHC card with sdb1 being NFTS (WinXP) and
sb2 being Ext4 (Linux), containing Ubuntu on sdb5 and the Linux swap file on sdb6.
According to G-Parted, sda1 and sdb5 are both boot.
I couldn't understand what sda5 referred to in your formula. Should it have been sdb5 (i.e. the Ubuntu program which is boot)? Anyway, I tried sda5, sdb5, sdb1, sda1, followed each time by sudo update-grub. Incidentally,"sdx" was always sdb.
In the end I somehow screwed up my SDHC card so that if I try to boot from it now,
I get "Grub loading error: File not found grub rescue>"
and there I'm stuck...If you have any other ideas they'd be more than welcome. If it comes to it, I'll reformat the SDHC card, reinstall WinXP and Ubuntu on it, and try again to get grub to recognise sdb1 as well as sdb5.....
Thanks again, Kaspin
Ok, so install the Ubuntu Bootloader onto sdb, you need to boot from the live cd, sudo mkdir /media/sdb5
sudo mount /dev/sdb5 /media/sdb5
sudo grub-install --root-directory=/media/sdb5 /dev/sdb
And hopefully that will install the grub mkbr onto sdb, assuming /media/sdb5/grub/ contains all the grub files, and sdb is the drive you want the mbr on.
shaon3343
December 20th, 2009, 01:54 AM
How to restore the Ubuntu grub bootloader (9.10 and beyond)
Since Ubuntu 9.10 uses Grub 2, the above method will not work. However, it can still be done and this is how:
First you need to find out what your drives are called. You can do this by going to a terminal and typing: sudo fdisk -l You will get something like this:
http://talsemgeest.doesntexist.com/blog/wp-content/uploads/2009/09/SVR8XIL.JPG
From that you need to find the device name of your Ubuntu drive, something like /dev/sda5″.
So, still in the terminal, type:
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5And then, to reinstall the grub: sudo grub-install --root-directory=/media/sda5 /dev/sdaPush enter and youre done! Of course you need to replace /dev/sda5″ and /dev/sda with what you found in the fdisk output.
If i do so can GRUB2 automatically detect my windows xp. ( I use ubuntu 9.10 and windows xp ( dual boot)) . In GRUB legacy I'd to manually entry the other OS entry. In GRUB2 how can it happen? is it automatically detected during GRUB2 installation?
talsemgeest
December 20th, 2009, 02:54 AM
If i do so can GRUB2 automatically detect my windows xp. ( I use ubuntu 9.10 and windows xp ( dual boot)) . In GRUB legacy I'd to manually entry the other OS entry. In GRUB2 how can it happen? is it automatically detected during GRUB2 installation?
Yes it is. If it is not already in the boot menu, running sudo update-grub should pick it up and add it to your list.
dohzer
December 23rd, 2009, 06:51 AM
Ok, I hope it stays working for you! :)
OK... so it's corrupted again.
I think it is corrupting after Windows has been in use for a long time without rebooting.
I haven't used Ubuntu on my laptop in a week or two, and have had Windows continually running during that time, hibernating between use. Half an hour ago I rebooted so I could boot into Ubuntu, and Grub wasn't loading again.
Last time I reinstalled Grub, I tried restarting and rebooting the PC from/too Windows XP and Ubuntu several times without issues.
Can anyone recommend what I should do next? Should I give LILO a try? I don't want to have to waste time booting Ubuntu from CD to repair the bootloader each time it corrupts.
von Stalhein
December 23rd, 2009, 07:26 AM
As to what happens next, if you are resigned to ceasing GRUB 2, why not revert to the original GRUB (http://ubuntuforums.org/showthread.php?t=1298932)?
For reasons unbeknownst to man, beast or the Flying Spaghetti Monster, I too was unable to use GRUB 2.
I got over it, and I hope to get back to it at some stage :)
talsemgeest
December 23rd, 2009, 07:43 AM
OK... so it's corrupted again.
I think it is corrupting after Windows has been in use for a long time without rebooting.
I haven't used Ubuntu on my laptop in a week or two, and have had Windows continually running during that time, hibernating between use. Half an hour ago I rebooted so I could boot into Ubuntu, and Grub wasn't loading again.
Last time I reinstalled Grub, I tried restarting and rebooting the PC from/too Windows XP and Ubuntu several times without issues.
Can anyone recommend what I should do next? Should I give LILO a try? I don't want to have to waste time booting Ubuntu from CD to repair the bootloader each time it corrupts.
All I can suggest is that you start from scratch, installing XP first onto a clean hard drive, then Ubuntu. Other than that I cannot see where the problem is coming from, so I can't fix it.
talsemgeest
December 23rd, 2009, 07:44 AM
As to what happens next, if you are resigned to ceasing GRUB 2, why not revert to the original GRUB (http://ubuntuforums.org/showthread.php?t=1298932)?
For reasons unbeknownst to man, beast or the Flying Spaghetti Monster, I too was unable to use GRUB 2.
I got over it, and I hope to get back to it at some stage :)
This is also a very good suggestion, and should probably be tried before mine ;)
Joshua_805
December 24th, 2009, 11:46 PM
Hello I'm new to Ubuntu and i'm having the same problem. I already tried to follow the steps from the guide. Tried to type the codes but it comes up with unknown command. Whn i tried to boot the windows xp cd, it did load but it said that there were no files on the disk to reinstall window.
Does anyone have any other suggestions i would really appreciated.
talsemgeest
December 25th, 2009, 01:50 AM
Hello I'm new to Ubuntu and i'm having the same problem. I already tried to follow the steps from the guide. Tried to type the codes but it comes up with unknown command. Whn i tried to boot the windows xp cd, it did load but it said that there were no files on the disk to reinstall window.
Does anyone have any other suggestions i would really appreciated.
Hi, I need a bit more info on your configuration. Which version of ubuntu do you have installed, which other operating systems, which order they were installed in, etc.
Joshua_805
December 25th, 2009, 03:34 PM
Well i installed the 9.10 vesion and i had Windows Xp intalled on it first.
talsemgeest
December 25th, 2009, 06:23 PM
Well i installed the 9.10 vesion and i had Windows Xp intalled on it first.
Ok, please boot into the Ubuntu 9.10 Live CD and type sudo fdisk -l
Post all of the output on here (copy and paste is best), and I will tell you the exact commands to run.
talsemgeest
December 26th, 2009, 04:05 AM
Hello,
Nice tutorial you mentioned here.
this is really a very useful information you mentioned here.
I really want to Vista Boot loader for last few days. But, Now i am using windows 7 so, did you any suggestion for windows 7?
Cheers !!!
Merry Christmas !!!
Fixing the Windows 7 bootloader is exactly the same as the one for Vista, just using the windows 7 dvd instead of vista ;) Other than that, I am glad you like the tutorial, and a merry Christmas to you too :)
Joshua_805
December 26th, 2009, 06:24 PM
[QUOTE=talsemgeest;8558683]Ok, please boot into the Ubuntu 9.10 Live CD and type sudo fdisk -l
Post all of the output on here (copy and paste is best), and I will tell you the exact commands to run.[/QUOTE
And after i do that then what the next step?
talsemgeest
December 26th, 2009, 06:37 PM
[QUOTE=talsemgeest;8558683]Ok, please boot into the Ubuntu 9.10 Live CD and type sudo fdisk -l
Post all of the output on here (copy and paste is best), and I will tell you the exact commands to run.[/QUOTE
And after i do that then what the next step?
After you had done that I would have taken the info in the fdisk output, and used it to change the commands in the first post to work with your computer. If you read the instructions carefully, I wouldnt have to, but I think this way is easier. :)
Joshua_805
December 26th, 2009, 06:50 PM
i already typed the command in but it always says unknown command
talsemgeest
December 26th, 2009, 06:59 PM
i already typed the command in but it always says unknown command
For this to work you are going to have to do exactly what I say. I cannot help a person who does not want to be helped. So first of all, please make sure you have the Ubuntu 9.10 Live CD, such as the one that can be found on this page (http://www.ubuntu.com/getubuntu/download). Boot from it, open a terminal and type sudo fdisk -l Open firefox, log into the forums and paste the output from the previous command into this thread.
zukario
December 27th, 2009, 05:14 AM
I saved this thread in my desktop as i find this tutorial is useful.thank you for creating this useful tutorial.
talsemgeest
December 27th, 2009, 07:19 AM
I saved this thread in my desktop as i find this tutorial is useful.thank you for creating this useful tutorial.
I am very happy to hear that :)
phillw
December 30th, 2009, 02:26 PM
Oh yeah, I've never gotten around to thanking you either. I have sent lot's of people to this thread over the last couple of months !! -- It's a great How To. Well done
:popcorn:
Phill.
mrlabor1
December 31st, 2009, 05:44 PM
Hello, I am very new to the cammand line and anything other than synaptic package manager. I am however having similar issues as the person above. The issue I am having is when I type
sudo grub-install --recheck /dev/sda5 (my ubuntu 8.04 partion)
I get the response
Probing devices to guess BIOS drives. This may take a long rime.
Could not find device for /boot: Not found or not a block device.
any ideas?
big noob
talsemgeest
December 31st, 2009, 11:06 PM
Hello, I am very new to the cammand line and anything other than synaptic package manager. I am however having similar issues as the person above. The issue I am having is when I type
I get the response
any ideas?
big noob
The command you posted is not in my guide. Please follow the instructions for Ubuntu 9.04 and before, and hopefully you will have your computer up and running again. :)
von Stalhein
January 1st, 2010, 12:55 AM
Hello, I am very new to the cammand line and anything other than synaptic package manager. I am however having similar issues as the person above. The issue I am having is when I type
I get the response
any ideas?
big noob
The command you posted is not in my guide. Please follow the instructions for Ubuntu 9.04 and before, and hopefully you will have your computer up and running again. :)
What talsemgeest said - also, I think you might benefit from reading this thread (http://ubuntuforums.org/showpost.php?p=7505203&postcount=1).
Stick with it, it's worth the effort.
ladi
January 4th, 2010, 03:52 PM
Hi!
after following your tutorial i keep getting an error message that says pls specify the file system type.
here is the terminal display
root@ubuntu:~# sudo fdisk -l
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x61680184
Device Boot Start End Blocks Id System
/dev/sda1 1 1176 9437184 27 Unknown
/dev/sda2 * 1176 18186 136636415+ 7 HPFS/NTFS
/dev/sda3 18187 26246 64741950 5 Extended
root@ubuntu:~# mkdir /media/sda3
root@ubuntu:~# mount /dev/sda3 /media/sda3
mount: you must specify the filesystem type
pls help,
cheers!
ubuntu 9.10 / win 7
drs305
January 4th, 2010, 03:59 PM
root@ubuntu:~# mkdir /media/sda3
root@ubuntu:~# mount /dev/sda3 /media/sda3
mount: you must specify the filesystem type
pls help,
cheers!
ubuntu 9.10 / win 7
You don't mount an "extended" partition, which is what sda3 is. Think of it as a container for logical partitions. You have sda1 (unknown) which may be a recovery partition, then sda2, which is NTFS and most likely windows.
sda3 is an extended partition. Next you need to make logical partitions within the extended partition. The first logical partition will be sda5.
However, if you already have more partitions (sda5, sda6, etc) then don't do anything further with this disk. If you have a bad partition table you don't want to write anything more to the disk until you have the partition table fixed.
Tell us what your situation is and we can help you. It might be helpful to start your own thread as this looks more than a partitioning problem rather than a boot problem (unless you had other partitions that were working until you tried to add Linux). At least give us a bit more information about what you are trying to accomplish.
3thejoker4
January 5th, 2010, 01:58 PM
I know this will seem quite idiotic:
I deleted the partition on which Ubuntu was installed (DELETED not formated, it's just empty space that can't be used until I create a new partition or extend an existing one) and went to the bathroom. When I went back into my room the computer was restarted by my brother and instead of the windows boot menu there was the Grub 2 with the message "no such partition" and the grub rescue started (I know other people had this error too). The "sudo" command is unknown to the grub so basically I can't do anything. Does anyone have a solution for this? Oh and I almost forgot the Ubuntu version is 9.10
talsemgeest
January 5th, 2010, 04:16 PM
I know this will seem quite idiotic:
I deleted the partition on which Ubuntu was installed (DELETED not formated, it's just empty space that can't be used until I create a new partition or extend an existing one) and went to the bathroom. When I went back into my room the computer was restarted by my brother and instead of the windows boot menu there was the Grub 2 with the message "no such partition" and the grub rescue started (I know other people had this error too). The "sudo" command is unknown to the grub so basically I can't do anything. Does anyone have a solution for this? Oh and I almost forgot the Ubuntu version is 9.10
You will need to boot from the live cd, recover the partition using something like testdisk (https://help.ubuntu.com/community/DataRecovery), then restore the bootloader like in the first post. I will be away for a few days so, if you have any problems you will probably get an answer faster if you create your own thread. :)
Garypewitt
January 7th, 2010, 02:31 AM
OK, I followed the steps on the first three pages. I booted on the CD, did an alt-ctl-F1 to get to terminal mode. I did the sudo fdisk -l it showed my drives:
Windows is on /dev/sda1 a 500 Gig drive that should have been C: but shows up as G: in windows now. system is HPFS/NTFS
Ubuntu 9.10 is on the 1Tbt drive /dev/sdb1 Sys Linux
/dev/sdb2 Sys Extended
/dev/sdb5 Sys Linux Swap/Solarus
I got no error signals at all, it seemed to be working fine. I rebooted with the disk removed and it came up in Windoz again.
When running on the CD can changes be made and saved? Or are they just temporary?
I thought the grub loader had to be on the first drive which would be sda1, right?
Still stumped. Help! Thanks Gary :(
talsemgeest
January 8th, 2010, 11:54 PM
OK, I followed the steps on the first three pages. I booted on the CD, did an alt-ctl-F1 to get to terminal mode. I did the sudo fdisk -l it showed my drives:
Windows is on /dev/sda1 a 500 Gig drive that should have been C: but shows up as G: in windows now. system is HPFS/NTFS
Ubuntu 9.10 is on the 1Tbt drive /dev/sdb1 Sys Linux
/dev/sdb2 Sys Extended
/dev/sdb5 Sys Linux Swap/Solarus
I got no error signals at all, it seemed to be working fine. I rebooted with the disk removed and it came up in Windoz again.
When running on the CD can changes be made and saved? Or are they just temporary?
I thought the grub loader had to be on the first drive which would be sda1, right?
Still stumped. Help! Thanks Gary :(
Hi Gary :)
Ok, simply running sudo fdisk -l will only show you which drives are which. You can go through the instructions for installing the ubuntu 9.10 bootloader onto whichever drive gets booted (usually sda1), and if windows does not boot after that you can run sudo update-grub from you ubuntu system.
101011010010
January 11th, 2010, 10:11 AM
Hello there, I just wanted to say thank you for the excellent tut, just saved me another reinstall. Thanks.:)
talsemgeest
January 11th, 2010, 11:23 AM
Hello there, I just wanted to say thank you for the excellent tut, just saved me another reinstall. Thanks.:)
Great to hear, I am glad it all worked for you :)
kaspin
January 16th, 2010, 02:29 PM
Hello again Talsemgeest,
Firstly, best wishes for a very happy new year.....
Secondly, despite your help a month or so ago which was much appreciated, I never managed to get Ubuntu and WinXP to boot from my 16GB SDHC card. I guess it's an issue with Windows, which only likes being booted from a fixed disk, so I've given up trying, at least for the time being.
My problem now is sluggish boot times. On my larger laptop (60GB HDD 1GB RAM), boot up time for WinXP or Ubuntu 9.10 is about
1 minute - perfectly OK. WinXP is on 47GB NTFS and Ubuntu 9.10 on 13GB containing ext3 (12GB) and 897MB swap file.
But on my ASUS EEE (4GB SSD, 2GB RAM, 16GB SDHC card) it takes 4 minutes 30 seconds to boot Ubuntu 9.10 (or WinXP), of which half is spent stuck on "Grub Loading" !
Grub2 is used on both machines, the main difference being that, on the ASUS EEE, WinXP is on the SSD, and Ubuntu is on the
SDHC card, whereas on the larger laptop, both are on the same physical HDD.
Other small differences are that the Linux partition on the larger machine is EXT3, whereas it's EXT4 on the EEE. Also, on the larger machine the boot possibilities are Ubuntu 2.6.31 - 16 generic, 15,or 14, mem test (twice) then WinXP, whilst on the EEE I have Ubuntu 2.6.31 - 17 generic, 17 recovery, 14 generic, 14 recovery, mem test (twice)then WinXP.
Incidentally, I have used WinXP on the EEE's 4GB SSD, with EasyPeasy (9.04) on an 8GB SDHC card without any boot time issues. But then it wouldn't have been using Grub2 presumably.
Any ideas you may have to speed things up would be most welcome.
Kaspin
talsemgeest
January 16th, 2010, 08:25 PM
Hello again Talsemgeest,
Firstly, best wishes for a very happy new year.....
Secondly, despite your help a month or so ago which was much appreciated, I never managed to get Ubuntu and WinXP to boot from my 16GB SDHC card. I guess it's an issue with Windows, which only likes being booted from a fixed disk, so I've given up trying, at least for the time being.
My problem now is sluggish boot times. On my larger laptop (60GB HDD 1GB RAM), boot up time for WinXP or Ubuntu 9.10 is about
1 minute - perfectly OK. WinXP is on 47GB NTFS and Ubuntu 9.10 on 13GB containing ext3 (12GB) and 897MB swap file.
But on my ASUS EEE (4GB SSD, 2GB RAM, 16GB SDHC card) it takes 4 minutes 30 seconds to boot Ubuntu 9.10 (or WinXP), of which half is spent stuck on "Grub Loading" !
Grub2 is used on both machines, the main difference being that, on the ASUS EEE, WinXP is on the SSD, and Ubuntu is on the
SDHC card, whereas on the larger laptop, both are on the same physical HDD.
Other small differences are that the Linux partition on the larger machine is EXT3, whereas it's EXT4 on the EEE. Also, on the larger machine the boot possibilities are Ubuntu 2.6.31 - 16 generic, 15,or 14, mem test (twice) then WinXP, whilst on the EEE I have Ubuntu 2.6.31 - 17 generic, 17 recovery, 14 generic, 14 recovery, mem test (twice)then WinXP.
Incidentally, I have used WinXP on the EEE's 4GB SSD, with EasyPeasy (9.04) on an 8GB SDHC card without any boot time issues. But then it wouldn't have been using Grub2 presumably.
Any ideas you may have to speed things up would be most welcome.
Kaspin
Hmm, I had a similar problem with grub taking a while to load when it was installed to a drive other than the one that ubuntu was installed to. Do you have that setup?
harivaradhan
January 17th, 2010, 11:19 PM
could you please help to bring the boot up sequence option windows xp/ubuntu. I have done as you told below, it gives error and say bad idea after the third command (grub root dicrectory). could you please please help me as i am new to ubuntu , thanks
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5
talsemgeest
January 17th, 2010, 11:48 PM
could you please help to bring the boot up sequence option windows xp/ubuntu. I have done as you told below, it gives error and say bad idea after the third command (grub root dicrectory). could you please please help me as i am new to ubuntu , thanks
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5
Hi harivaradhan, please post the exact error message, inclusidng the command you used. The output of <sudo fdisk -l> would be useful too.
kaspin
January 20th, 2010, 10:43 AM
Hello again talsemgeest,
As far as I am aware Grub2 was on the SDHC card with Ubuntu (/dev/sdb5 - boot). WinXP was on the SSD (/dev/sda1 - boot). I wondered whether there was an issue with the 16GB SDHC (class 6) so I installed Ubuntu 9.10 on an 8GB SDHC, but the boot time was still about the same. I then installed Ubuntu 8.04 on the 8GB SDHC to see if boot time was quicker with the old Grub - and it was, at 1 minute 46 seconds.
I also tried reinstalling Ubuntu 9.10 on the 16GB SDHC card in persistent mode using the USB-Installer-for-Ubuntu.exe found on the pendrivelinux.com article for installing Ubuntu 9.10. Having done this, the boot time for Ubuntu 9.10 on the 16GB SDHC card went down to 2 minutes 20 seconds - over 2 minutes quicker than if installed "normally" from the CD. Windows MBR is on the SSD, Grub2 on the SDHC - so I have to select which to use on start up.
As you will have gathered I'm not very computer literate, so unless there's something specific that I can search for on my system which might point to where the problem is, I'll carry on with the persistent boot mode, and hope that changes might be made to Grub2 in due course which would speed up the boot time.
One final question - is it easy to replace Grub2 in Ubuntu 9.10 by the old Grub? If it is, I might try that as an interim solution....
Many thanks again,
kaspin
jfda
January 21st, 2010, 01:51 AM
What a great tutorial!
Thanks a lot! It was really helpful.
talsemgeest
January 21st, 2010, 02:31 AM
Hello again talsemgeest,
As far as I am aware Grub2 was on the SDHC card with Ubuntu (/dev/sdb5 - boot). WinXP was on the SSD (/dev/sda1 - boot). I wondered whether there was an issue with the 16GB SDHC (class 6) so I installed Ubuntu 9.10 on an 8GB SDHC, but the boot time was still about the same. I then installed Ubuntu 8.04 on the 8GB SDHC to see if boot time was quicker with the old Grub - and it was, at 1 minute 46 seconds.
I also tried reinstalling Ubuntu 9.10 on the 16GB SDHC card in persistent mode using the USB-Installer-for-Ubuntu.exe found on the pendrivelinux.com article for installing Ubuntu 9.10. Having done this, the boot time for Ubuntu 9.10 on the 16GB SDHC card went down to 2 minutes 20 seconds - over 2 minutes quicker than if installed "normally" from the CD. Windows MBR is on the SSD, Grub2 on the SDHC - so I have to select which to use on start up.
As you will have gathered I'm not very computer literate, so unless there's something specific that I can search for on my system which might point to where the problem is, I'll carry on with the persistent boot mode, and hope that changes might be made to Grub2 in due course which would speed up the boot time.
One final question - is it easy to replace Grub2 in Ubuntu 9.10 by the old Grub? If it is, I might try that as an interim solution....
Many thanks again,
kaspin
Since the delay seems to be in the grub rather than in the normal boot process, I can't think of any settings that would speed it up. As for replacing grub 2 with 1, I am sure it is possible, but I can't find any guides that walk you through it. All I can suggest is that you start a new thread with your problem, hopefully someone has another idea.
Sorry I couldnt be of more help.
talsemgeest
January 21st, 2010, 02:31 AM
What a great tutorial!
Thanks a lot! It was really helpful.
Excellent, I am very happy it has helped you out. :)
kaspin
January 21st, 2010, 07:38 AM
Thanks again, talsemgeest. I've found another forum apparently devoted to a bug causing slow boot times in Grub2. So I'll get out of your hair, and start bugging them! Will report back if I find a solution that works (I saw somewhere that a fix was due to be issued on 18th January......)
All the best, kaspin
talsemgeest
January 21st, 2010, 08:21 AM
Thanks again, talsemgeest. I've found another forum apparently devoted to a bug causing slow boot times in Grub2. So I'll get out of your hair, and start bugging them! Will report back if I find a solution that works (I saw somewhere that a fix was due to be issued on 18th January......)
All the best, kaspin
Haha ok, I hope it works out for you :)
kaspin
January 23rd, 2010, 04:58 PM
Hi again talsemgeest,
Good news - I've reduced the boot time from 4 minutes 30 seconds to about 1 minute 45 seconds. You'll remember that WinXP is on my SSD (sda) and Ubuntu 9.10 on part of an SDHC card (sdb). I put Grub on the SDHC card ("sudo grub-install /dev/sdb") followed by "sudo update-grub" then rebooted. On reboot I changed the boot order in the BIOS to put the SDHC card before the SSD. That did it!
I expected to save more time if I put the boot on the SSD and altered the boot order accordingly, but it went up to nearly 4 minutes!
Anyway, I can live with the 1 minute 45 seconds with the SDHC card - but still hope to reduce it to around a minute one day. Next job is to put WinXP on the SDHC card and get Grub to boot it from there...........
Best wishes, kaspin
talsemgeest
January 23rd, 2010, 09:26 PM
Hi again talsemgeest,
Good news - I've reduced the boot time from 4 minutes 30 seconds to about 1 minute 45 seconds. You'll remember that WinXP is on my SSD (sda) and Ubuntu 9.10 on part of an SDHC card (sdb). I put Grub on the SDHC card ("sudo grub-install /dev/sdb") followed by "sudo update-grub" then rebooted. On reboot I changed the boot order in the BIOS to put the SDHC card before the SSD. That did it!
I expected to save more time if I put the boot on the SSD and altered the boot order accordingly, but it went up to nearly 4 minutes!
Anyway, I can live with the 1 minute 45 seconds with the SDHC card - but still hope to reduce it to around a minute one day. Next job is to put WinXP on the SDHC card and get Grub to boot it from there...........
Best wishes, kaspin
Excellent, glad to hear it and I wish you the best of luck! :)
emma00
January 24th, 2010, 12:18 PM
I have a query that to get back my grub menu back after reinstalling windows first i have to put Ubuntu live CD in it then do these steps you have mentioned????
drs305
January 24th, 2010, 02:28 PM
I have a query that to get back my grub menu back after reinstalling windows first i have to put Ubuntu live CD in it then do these steps you have mentioned????
Yes. In the opening paragraphs of the first post talsemgeest states that you will use the LiveCD and provides a link to a HOWTO if you need help with the CD.
talsemgeest
January 24th, 2010, 04:24 PM
Yes. In the opening paragraphs of the first post talsemgeest states that you will use the LiveCD and provides a link to a HOWTO if you need help with the CD.
Thanks drs305 :)
thenapster8
January 27th, 2010, 11:09 PM
I found myself in a big jiffy. I had planned to just install Ubuntu on my external, and ended up installing the GRUB loader on my parents PC. It was... BAD. So i used my iPod and found this page, emailed it to myself and got on my old computer, hoping to create the recovery disk. Yeah... OLD computer, didn't have a DVD burner. I thought i was doomed. THEN, i thought, "What do i have that's Windows related... Windows 7 RC!" I printed the "How to restore the Windows Vista or 7 boot loader," directions, and sure enough, here i am typing in my good old Windows Vista. Thank you so much for this tutorial. And this is also for anyone who doesn't feel like burning yet another disk, just try and find something you have laying around first.
:popcorn:
talsemgeest
January 27th, 2010, 11:44 PM
I found myself in a big jiffy. I had planned to just install Ubuntu on my external, and ended up installing the GRUB loader on my parents PC. It was... BAD. So i used my iPod and found this page, emailed it to myself and got on my old computer, hoping to create the recovery disk. Yeah... OLD computer, didn't have a DVD burner. I thought i was doomed. THEN, i thought, "What do i have that's Windows related... Windows 7 RC!" I printed the "How to restore the Windows Vista or 7 boot loader," directions, and sure enough, here i am typing in my good old Windows Vista. Thank you so much for this tutorial. And this is also for anyone who doesn't feel like burning yet another disk, just try and find something you have laying around first.
:popcorn:
Excellent, I am happy to know that the instructions for windows have not gone to waste ;)
darco
February 3rd, 2010, 01:29 PM
I used this guide today after I re-installed my Win 7 OS. I am currently running Mint8 x64 with grub2. After running the commands in the livecd, grub came up fine. When I chose Win7, I received this: error: no such device c684a2884a27b1 Press any key
Here is my fdisk output:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe868f6fc
Device Boot Start End Blocks Id System
/dev/sda1 * 1 34482 276976633+ 7 HPFS/NTFS
/dev/sda2 35919 60801 199872697+ 83 Linux
/dev/sda3 34483 34515 265072+ 82 Linux swap / Solaris
/dev/sda4 34516 35918 11269597+ 83 Linux
Partition table entries are not in disk order
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00017ea3
Device Boot Start End Blocks Id System
/dev/sdb1 1 21481 172546101 7 HPFS/NTFS
/dev/sdb2 * 21482 33108 93393877+ 83 Linux
/dev/sdb3 33230 34535 10483712+ f W95 Ext'd (LBA)
/dev/sdb4 34536 60801 210981645 7 HPFS/NTFS
/dev/sdb5 33230 34535 10483712 7 HPFS/NTFS
Disk /dev/sdg: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8f9c798a
Device Boot Start End Blocks Id System
/dev/sdg1 1 29127 233956001 7 HPFS/NTFS
sdb contains another linux partition for testing purposes...
thxs
*edit* I edited the grub.conf ..uncommented GRUB_DISABLE_LINUX_UUID=true
talsemgeest
February 3rd, 2010, 05:00 PM
*edit* I edited the grub.conf ..uncommented GRUB_DISABLE_LINUX_UUID=true
So it is fixed?
darco
February 3rd, 2010, 06:18 PM
Yes...sorry
talsemgeest
February 3rd, 2010, 07:26 PM
Yes...sorry
Excellent, I am happy to hear it :)
arpan251089
February 5th, 2010, 01:09 PM
Hi I installed Xp and Ubuntu. I had grub loader to select one of these at boot time. Now I installed Windows 7 without removing windows xp or ubuntu.
My grub is now wipped off.
Will this method still work for me or if i install grub it will wipe my window 7's bootloader.
I want grub loader to either point to this three os or to ubuntu and bootloader of windows 7 from which i can load either xp or 7. pls tell me if anyone knows abt this
arpan251089
February 5th, 2010, 01:26 PM
Also tell me if i remove xp then how can i make my grub, point to ubuntu and windows 7.
I mean remove my window 7 bootloader which have a link to xp
talsemgeest
February 5th, 2010, 05:50 PM
Yes, simply run through the instructions for reinstalling the ubuntu bootloader, start up into ubuntu and run sudo update-grub. If you choose to remove XP, just delete the XP partition, boot into Ubuntu and run sudo update-grub again. The menu will now only show Ubuntu and 7.
Hope this helps :)
emma00
February 14th, 2010, 12:16 PM
I tried to load grub 2 in Ubuntu 9.10 after reinstalling xp.I've followed the instructions to reinstall grub bootloader for ubuntu 9.10 but when I enter sudo grub-install --root-directory=/media/sda8 /dev/sda
I get a message saying:
grub-setup:warn your embedding area is unusually small core.img won't fit in it.
grub-setup:warn:embedding is not possible
grub can only be installed using blocklists however blocklists are unreliable.
grub-setup:error:cannot read '/grub/core.img'.correctly
I was running a dual boot between Win XP and Ubuntu 9.10 before
any help or suggestions????
talsemgeest
February 14th, 2010, 01:52 PM
I tried to load grub 2 in Ubuntu 9.10 after reinstalling xp.I've followed the instructions to reinstall grub bootloader for ubuntu 9.10 but when I enter sudo grub-install --root-directory=/media/sda8 /dev/sda
I get a message saying:
grub-setup:warn your embedding area is unusually small core.img won't fit in it.
grub-setup:warn:embedding is not possible
grub can only be installed using blocklists however blocklists are unreliable.
grub-setup:error:cannot read '/grub/core.img'.correctly
I was running a dual boot between Win XP and Ubuntu 9.10 before
any help or suggestions????
Hmm, I have never seen this error before. It seems that most people are getting this message when they try to install grub onto a flash drive. Please post the output of sudo fdisk -l to make sure that /dev/sda is the right one to be installing to.
emma00
February 14th, 2010, 01:57 PM
Hmm, I have never seen this error before. It seems that most people are getting this message when they try to install grub onto a flash drive. Please post the output of sudo fdisk -l to make sure that /dev/sda is the right one to be installing to.
How can i post the output here after exiting from terminal am sure its dev/sda8 i have checked it twice newaz
you should know it :o
talsemgeest
February 14th, 2010, 02:05 PM
How can i post the output here after exiting from terminal am sure its dev/sda8 i have checked it twice newaz
you should know it :o
On the live cd, open up a terminal and run sudo fdisk -l, select the output, open firefox and navigate to the ubuntu forums, and middle click into the reply box for this thread. But if you are correct in saying that it is the right drive, I can't think of a lot you can do, since the space is simply missing. It may end up that you need to reinstall both windows and ubuntu to recreate the MBR at the start of the hard drive.
emma00
February 14th, 2010, 02:08 PM
No dontttttttttttttttttt say that
i only reinstalled xp on seeing your toutorial that i can get back my grub#-o
emma00
February 14th, 2010, 02:11 PM
On the live cd, open up a terminal and run sudo fdisk -l, select the output, open firefox and navigate to the ubuntu forums, and middle click into the reply box for this thread. But if you are correct in saying that it is the right drive, I can't think of a lot you can do, since the space is simply missing. It may end up that you need to reinstall both windows and ubuntu to recreate the MBR at the start of the hard drive.
am cuming back in 10 mins so wait plz.........
emma00
February 14th, 2010, 02:18 PM
This is it:
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 320.1 GB, 320072933376 bytes
247 heads, 30 sectors/track, 84364 cylinders
Units = cylinders of 7410 * 512 = 3793920 bytes
Disk identifier: 0x2a0a219d
Device Boot Start End Blocks Id System
/dev/sda1 * 1 8292 30721845 7 HPFS/NTFS
/dev/sda2 8293 14068 21400080 7 HPFS/NTFS
/dev/sda3 14069 84363 260442975 f W95 Ext'd (LBA)
/dev/sda4 84364 84364 3705 82 Linux swap / Solaris
/dev/sda5 14069 30651 61440000 7 HPFS/NTFS
/dev/sda6 30652 38942 30718140 7 HPFS/NTFS
/dev/sda7 38943 38998 207465 7 HPFS/NTFS
/dev/sda8 38999 47234 30514365 83 Linux
/dev/sda9 47235 84363 137562930 7 HPFS/NTFS
talsemgeest
February 14th, 2010, 11:56 PM
This is it:
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 320.1 GB, 320072933376 bytes
247 heads, 30 sectors/track, 84364 cylinders
Units = cylinders of 7410 * 512 = 3793920 bytes
Disk identifier: 0x2a0a219d
Device Boot Start End Blocks Id System
/dev/sda1 * 1 8292 30721845 7 HPFS/NTFS
/dev/sda2 8293 14068 21400080 7 HPFS/NTFS
/dev/sda3 14069 84363 260442975 f W95 Ext'd (LBA)
/dev/sda4 84364 84364 3705 82 Linux swap / Solaris
/dev/sda5 14069 30651 61440000 7 HPFS/NTFS
/dev/sda6 30652 38942 30718140 7 HPFS/NTFS
/dev/sda7 38943 38998 207465 7 HPFS/NTFS
/dev/sda8 38999 47234 30514365 83 Linux
/dev/sda9 47235 84363 137562930 7 HPFS/NTFS
Hmm, all looks fine to me. Only other thing I can suggest is that you create your own thread, and hopefully someone will be able to help you out there.
Sorry I couldn't be of more help.
themis
February 24th, 2010, 06:07 PM
Hello,
I am trying to restore my ubuntu loader(grub).
you ask for a sudo fdisk -l
and I get
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x27f427f3
Device Boot Start End Blocks Id System
/dev/sda1 * 1 12748 102398278+ 7 HPFS/NTFS
/dev/sda2 12749 121601 874361722+ f W95 Ext'd (LBA)
/dev/sda5 12749 25496 102398278+ 7 HPFS/NTFS
/dev/sda6 25497 50992 204796588+ 83 Linux
/dev/sda7 50993 76488 204796588+ 83 Linux
/dev/sda8 120606 121601 8000338+ 82 Linux swap / Solaris
/dev/sda9 107858 120605 102398278+ 83 Linux
/dev/sda10 76489 107857 251971461 83 Linux
Partition table entries are not in disk order
How can I tell which is my ubuntu drive???
Thanks you very much!
talsemgeest
February 24th, 2010, 11:24 PM
Hello,
I am trying to restore my ubuntu loader(grub).
you ask for a sudo fdisk -l
and I get
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x27f427f3
Device Boot Start End Blocks Id System
/dev/sda1 * 1 12748 102398278+ 7 HPFS/NTFS
/dev/sda2 12749 121601 874361722+ f W95 Ext'd (LBA)
/dev/sda5 12749 25496 102398278+ 7 HPFS/NTFS
/dev/sda6 25497 50992 204796588+ 83 Linux
/dev/sda7 50993 76488 204796588+ 83 Linux
/dev/sda8 120606 121601 8000338+ 82 Linux swap / Solaris
/dev/sda9 107858 120605 102398278+ 83 Linux
/dev/sda10 76489 107857 251971461 83 Linux
Partition table entries are not in disk order
How can I tell which is my ubuntu drive???
Thanks you very much!
If you are in your ubuntu system, you can try running mount | column -t, and look for the drive that is mounted as "/". Unfortunately I can't say definitively from your fdisk output.
Or, from the live cd, you can try opening/mounting the different drives and looking for the usual Ubuntu folders (/etc /var etc).
SecretCode
February 25th, 2010, 12:46 AM
As well as mount, df will tell you.
themis
February 25th, 2010, 01:30 AM
SecretCode & talsemgeest Thank you!
talsemgeest
February 25th, 2010, 01:54 AM
Cheers SecretCode, and I hope it works for you themis :)
themis
February 25th, 2010, 02:11 AM
Of course you need to replace “/dev/sda5″ and “/dev/sda” with what you found in the fdisk output.
An other quostion too!
I know that sda5 of yours is mine sda9.
But how can I tell which is sda for me?
Stupid question? Sorryyy!
---->>> I followed the tutorial
sudo mkdir /media/sda9
sudo mount /dev/sda9 /media/sda9
And then, to reinstall the grub:
Code:
sudo grub-install --root-directory=/media/sda9 /dev/sda
And I get:
Grub loading.
error: file not found
grub rescue>
(and I have the pc on that state,
I write from a laptop next to it,
so can easily apply any suggestions(???) )
It seems pretty scary though!
tikmikrik
February 25th, 2010, 05:11 AM
After installing ubuntu 9.10 on my acer laptop I decided to revert to xp, after installing xp I am takien to the grub rescue terminal, my system cd has no rescue mode it goes straight onto recovery, how doo i restore xp bootloader in this case?
talsemgeest
February 25th, 2010, 05:36 AM
After installing ubuntu 9.10 on my acer laptop I decided to revert to xp, after installing xp I am takien to the grub rescue terminal, my system cd has no rescue mode it goes straight onto recovery, how doo i restore xp bootloader in this case?
You may want to give this (http://www.arsgeek.com/2008/01/15/how-to-fix-your-windows-mbr-with-an-ubuntu-livecd/) tutorial a try, which should allow you to install the xp bootloader from the ubuntu live cd.
talsemgeest
February 25th, 2010, 05:38 AM
An other quostion too!
I know that sda5 of yours is mine sda9.
But how can I tell which is sda for me?
Stupid question? Sorryyy!
---->>> I followed the tutorial
sudo mkdir /media/sda9
sudo mount /dev/sda9 /media/sda9
And then, to reinstall the grub:
Code:
sudo grub-install --root-directory=/media/sda9 /dev/sda
And I get:
Grub loading.
error: file not found
grub rescue>
(and I have the pc on that state,
I write from a laptop next to it,
so can easily apply any suggestions(???) )
It seems pretty scary though!
It looks to me like you have chosen the wrong partition. After you run sudo mkdir /media/sda9
sudo mount /dev/sda9 /media/sda9 take a look in the folder /media/sda9/boot and hopefully all the grub files will be there. If not, choose another partition :)
von Stalhein
February 25th, 2010, 05:38 AM
Edit: Beaten by Talsemgeest :-) (As it should be).
Originally Posted by tikmikrik
After installing ubuntu 9.10 on my acer laptop I decided to revert to xp, after installing xp I am takien to the grub rescue terminal, my system cd has no rescue mode it goes straight onto recovery, how doo i restore xp bootloader in this case?
You will need to do a fixmbr
GRUB has overwritten the MBR (Master Boot Record).
Have a read of this (http://helpdeskgeek.com/how-to/fix-mbr-xp-vista/)
I've had to do it a few times :D
If that's not clear enough there are plenty of guides about - Google and take your pick.
themis
February 25th, 2010, 05:45 AM
It looks to me like you have chosen the wrong partition. After you run sudo mkdir /media/sda9
sudo mount /dev/sda9 /media/sda9 take a look in the folder /media/sda9/boot and hopefully all the grub files will be there. If not, choose another partition :)
the grub files are here.
After these commands, what follows?
sudo grub-install --root-directory=/media/sda9 /dev/sda
lead me to a grub_rescue mode....
should I run
sudo grub-install --root-directory=/media/sda5 /dev/sda9 ??????
talsemgeest
February 25th, 2010, 01:42 PM
the grub files are here.
After these commands, what follows?
sudo grub-install --root-directory=/media/sda9 /dev/sda
lead me to a grub_rescue mode....
should I run
sudo grub-install --root-directory=/media/sda5 /dev/sda9 ??????
Ok, as long as you are sure that sda9 is your ubuntu partition (what is on the other linux partitions?), then running sudo grub-install --root-directory=/media/sda5 /dev/sda should work.
themis
February 25th, 2010, 01:53 PM
Ok, as long as you are sure that sda9 is your ubuntu partition (what is on the other linux partitions?), then running sudo grub-install --root-directory=/media/sda5 /dev/sda should work.
are you sure that is is sda5?????? I will not use on the command nowhere sda9??
Excuse my doubts please!
yes i am sure about the sda9 partition
maya@kiparissi:~$ mount | column -t
/dev/sda9 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/maya/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=maya)
talsemgeest
February 25th, 2010, 02:18 PM
are you sure that is is sda5?????? I will not use on the command nowhere sda9??
Excuse my doubts please!
yes i am sure about the sda9 partition
maya@kiparissi:~$ mount | column -t
/dev/sda9 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/maya/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=maya)
No, you do have to replace sda5 with sda9. Also, sda is the drive that you want to install grub to, so assuming you only have one drive, sda is correct.
themis
February 25th, 2010, 02:37 PM
No, you do have to replace sda5 with sda9. Also, sda is the drive that you want to install grub to, so assuming you only have one drive, sda is correct.
Nop, doesnt work.
I get back to sh:grub>
i exec these commands to load ubuntu again
linux /vmlinuz root=/dev/sda9 ro
initrd /initrd.img
boot
what else can we check now?
talsemgeest
February 26th, 2010, 08:26 PM
Nop, doesnt work.
I get back to sh:grub>
i exec these commands to load ubuntu again
linux /vmlinuz root=/dev/sda9 ro
initrd /initrd.img
boot
what else can we check now?
Well, assuming everything you have told me is correct, I am out of ideas. I can see no reason why its not working. All I can suggest is that you create your own thread and hope that someone is able to help.
Saudffs
February 26th, 2010, 10:25 PM
First of all I have to thank you for this great and simple tutorial, I'm glad that I found it since I'm planing to install Windows 7 over Vista while keeping my beloved Ubuntu 9.10, which takes me to my inquiry: after a clean Windows 7 installation I should boot with a LiveCD and run:
sudo mkdir /media/sdb2
sudo mount /dev/sdb2 /media/sdb2
then run:
sudo grub-install --root-directory=/media/sdb2 /dev/sdb
this is what I get from sudo fdisk -l:
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2907e04d
Device Boot Start End Blocks Id System
/dev/sda1 1 192 1536000 27 Unknown
/dev/sda2 * 192 19648 156284928 7 HPFS/NTFS
/dev/sda3 19648 38914 154748928 7 HPFS/NTFS
Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5d379805
Device Boot Start End Blocks Id System
/dev/sdb1 1 20147 161830746 f W95 Ext'd (LBA)
/dev/sdb2 20148 38913 150737895 83 Linux
/dev/sdb5 1 19490 156547790 7 HPFS/NTFS
/dev/sdb6 19491 20147 5277321 82 Linux swap / Solaris
is running :
sudo mkdir /media/sdb2
sudo mount /dev/sdb2 /media/sdb2
then:
sudo grub-install --root-directory=/media/sdb2 /dev/sdb
correct in my case?
thank you for your time and excuse my noobness but hopefully I'll become a pro like you when I grow up :lol:
cheers mate.
talsemgeest
February 27th, 2010, 01:26 AM
First of all I have to thank you for this great and simple tutorial, I'm glad that I found it since I'm planing to install Windows 7 over Vista while keeping my beloved Ubuntu 9.10, which takes me to my inquiry: after a clean Windows 7 installation I should boot with a LiveCD and run:
sudo mkdir /media/sdb2
sudo mount /dev/sdb2 /media/sdb2
then run:
sudo grub-install --root-directory=/media/sdb2 /dev/sdb
this is what I get from sudo fdisk -l:
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2907e04d
Device Boot Start End Blocks Id System
/dev/sda1 1 192 1536000 27 Unknown
/dev/sda2 * 192 19648 156284928 7 HPFS/NTFS
/dev/sda3 19648 38914 154748928 7 HPFS/NTFS
Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5d379805
Device Boot Start End Blocks Id System
/dev/sdb1 1 20147 161830746 f W95 Ext'd (LBA)
/dev/sdb2 20148 38913 150737895 83 Linux
/dev/sdb5 1 19490 156547790 7 HPFS/NTFS
/dev/sdb6 19491 20147 5277321 82 Linux swap / Solaris
is running :
sudo mkdir /media/sdb2
sudo mount /dev/sdb2 /media/sdb2
then:
sudo grub-install --root-directory=/media/sdb2 /dev/sdb
correct in my case?
thank you for your time and excuse my noobness but hopefully I'll become a pro like you when I grow up :lol:
cheers mate.
That should certainly work. However, if it still doesnt boot, try running sudo grub-install --root-directory=/media/sdb2 /dev/sda instead.
Saudffs
February 27th, 2010, 01:21 PM
Thank you again talsemgeest, I'll let you know if it works as soon as I do it.
talsemgeest
February 27th, 2010, 04:49 PM
Thank you again talsemgeest, I'll let you know if it works as soon as I do it.
Excellent, the best of luck to you :)
dariush_03
March 8th, 2010, 06:28 PM
Hi everybody,
I first had installed Ubuntu 9.10 then Windows 7. After the Win 7 installation, I was not able to enter my Ubuntu partition.
Then I followed the instructions for restoring the Bootloader of Ubuntu 9.10 in this thread and I finally got my Ubuntu partition back. The next problem was that I could enter to Windows 7 anymore.
Solution: make an update of Grub Bootloader !
Now I can enter both os.
Best regards
SyOliven
March 9th, 2010, 03:41 AM
How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 9.10)
This How-to is for windows dual booters who reinstall an operating system only to find that it has taken away access to their other operating system.
Whether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide will walk you through it.
All three parts of this tutorial require that you boot from a cd. If you don't know how to do this, check here. (http://www.hiren.info/pages/bios-boot-cdrom)
If you have made a mistake and want to revert the changes, simply follow the instructions for reinstalling the previous bootloader. For example, if you have installed vista over ubuntu, try to get the ubuntu bootloader back, but want to get the vista bootloader back, simply follow my instructions for installing the vista bootloader.
How to restore the Ubuntu grub bootloader (9.10 and beyond)
Since Ubuntu 9.10 uses Grub 2, the above method will not work. However, it can still be done and this is how:
First you need to find out what your drives are called. You can do this by going to a terminal and typing: sudo fdisk -l You will get something like this:
http://talsemgeest.doesntexist.com/blog/wp-content/uploads/2009/09/SVR8XIL.JPG
From that you need to find the device name of your Ubuntu drive, something like “/dev/sda5″.
So, still in the terminal, type:
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5And then, to reinstall the grub: sudo grub-install --root-directory=/media/sda5 /dev/sdaPush enter and you’re done! Of course you need to replace “/dev/sda5″ and “/dev/sda” with what you found in the fdisk output.
How to restore the Ubuntu grub bootloader (9.04 and older)
First of all, all credit for this part of the tutorial goes to catlet (http://ubuntuforums.org/showpost.php?p=1308395&postcount=1). I am simply rewriting his tutorial to have all three bootloaders in this tutorial.
So, lets begin. To restore the grub, you must boot off the ubuntu live cd. Any ubuntu live cd will do.
Once there, open a terminal (Applications>Accessories>Terminal) and type this:
sudo grubNext, you need to find which hard drive ubuntu and the grub is installed to. You do this by running this command:
find /boot/grub/stage1Take note of what it returns (something like (hd0,1).)
Now you need to tell Grub where it is installed. Using the output of the last command, change this one and run it:
root (hd<a>,<b>)Replacing <a> and <b> with what you got back before. For example, if "find /boot/grub/stage1" gave me "(hd0,1)", you would run "root (hd0,1)"
Ok, so thats the configuration over and done with. Now we just need to run one command to install the Grub to your hard drive:
setup (hd0)Now to quit and check if it has worked:
quitsudo rebootMake sure you have taken the live cd out of your disc tray. All going well, you should start back up and see the grub once again.
How to restore the Windows XP bootloader
For this you will need your Windows XP installation CD. Boot into it now.
You will get to a part where it asks if you want to repair or recover. To do so, press "r".
If prompted, enter your Windows XP administrator password. This will leave you at at a command line, so type in the following two commands:
fixbootfixmbrThen type exit then remove your XP cd. If everything has gone well, you should come to your XP bootloader.
How to restore the Windows Vista or 7 bootloader
To restore the Windows Vista/7 bootloader, you must first boot off your Windows Vista/7 installation DVD.
If you have one of the many OEM computers that didnt come with a Vista/7 installation disk, you can get the same effect with a Vista recovery disk, which you can download from here (http://neosmart.net/blog/2008/windows-vista-recovery-disc-download).
When you get to the Regional settings, select your Location/Keyboard setting then click next. On the next page you must click on "Repair your computer."
On the next page, if it finds your Windows Vista/7 installation, make sure it is UNSELECTED before clicking next.
Then click on "Command prompt". From there, type in the folowing:
bootrec.exe /fixbootbootrec.exe /fixmbrNow close the two windows and click "Restart."
Take out your Vista/7 DVD and hopefully, you will be left with your Windows Vista/7 Bootloader.
Dont really understand how to use this forum yet, but I guess I'll learn. The information I received looks great and I will try it shortly. Thank you to Forum members who were insrumental in getting me the answers to my questionh. I really appreciate it.
If someone can offer me assistance in knowing howto contact Forum members just to say thank you please let me know.
SyOliven@aol.com
Tucson,Arizona USA
talsemgeest
March 9th, 2010, 04:10 AM
Dont really understand how to use this forum yet, but I guess I'll learn. The information I received looks great and I will try it shortly. Thank you to Forum members who were insrumental in getting me the answers to my questionh. I really appreciate it.
If someone can offer me assistance in knowing howto contact Forum members just to say thank you please let me know.
SyOliven@aol.com
Tucson,Arizona USA
Hi SyOliven, I hope the guide works well for you. Good luck :)
nelsonj
March 14th, 2010, 12:19 AM
Hi everybody,
I first had installed Ubuntu 9.10 then Windows 7. After the Win 7 installation, I was not able to enter my Ubuntu partition.
Then I followed the instructions for restoring the Bootloader of Ubuntu 9.10 in this thread and I finally got my Ubuntu partition back. The next problem was that I could enter to Windows 7 anymore.
Solution: make an update of Grub Bootloader !
Now I can enter both os.
Best regards
I am in the same boat. I upgraded from Vista to Win 7. After the upgrade I can no longer access Ubuntu 9.10. Aparently Win 7 replaced/overwrote my bootloader. If I follow the instructions for restoring the Bootloader for Ubuntu I assume that I will loose Win 7 access. Can you explaine the workaround to get both working? Any help is appreciated.
smittal
March 14th, 2010, 12:26 AM
I had ubuntu 7.10, I upgraded it to ubuntu-9.10 recently. Now I need to install windows. I have heard the grub version has changed for ubuntu-9.10 so my question is : "Can i use ubuntu-7.10 live cd to restore grub for ubuntu-9.10 after installing windows?"
Thanks in advance :)
How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 9.10)
This How-to is for windows dual booters who reinstall an operating system only to find that it has taken away access to their other operating system.
Whether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide will walk you through it.
All three parts of this tutorial require that you boot from a cd. If you don't know how to do this, check here. (http://www.hiren.info/pages/bios-boot-cdrom)
If you have made a mistake and want to revert the changes, simply follow the instructions for reinstalling the previous bootloader. For example, if you have installed vista over ubuntu, try to get the ubuntu bootloader back, but want to get the vista bootloader back, simply follow my instructions for installing the vista bootloader.
How to restore the Ubuntu grub bootloader (9.10 and beyond)
Since Ubuntu 9.10 uses Grub 2, the above method will not work. However, it can still be done and this is how:
First you need to find out what your drives are called. You can do this by going to a terminal and typing: sudo fdisk -l You will get something like this:
http://talsemgeest.doesntexist.com/blog/wp-content/uploads/2009/09/SVR8XIL.JPG
From that you need to find the device name of your Ubuntu drive, something like /dev/sda5″.
So, still in the terminal, type:
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5And then, to reinstall the grub: sudo grub-install --root-directory=/media/sda5 /dev/sdaPush enter and youre done! Of course you need to replace /dev/sda5″ and /dev/sda with what you found in the fdisk output.
How to restore the Ubuntu grub bootloader (9.04 and older)
First of all, all credit for this part of the tutorial goes to catlet (http://ubuntuforums.org/showpost.php?p=1308395&postcount=1). I am simply rewriting his tutorial to have all three bootloaders in this tutorial.
So, lets begin. To restore the grub, you must boot off the ubuntu live cd. Any ubuntu live cd will do.
Once there, open a terminal (Applications>Accessories>Terminal) and type this:
sudo grubNext, you need to find which hard drive ubuntu and the grub is installed to. You do this by running this command:
find /boot/grub/stage1Take note of what it returns (something like (hd0,1).)
Now you need to tell Grub where it is installed. Using the output of the last command, change this one and run it:
root (hd<a>,<b>)Replacing <a> and <b> with what you got back before. For example, if "find /boot/grub/stage1" gave me "(hd0,1)", you would run "root (hd0,1)"
Ok, so thats the configuration over and done with. Now we just need to run one command to install the Grub to your hard drive:
setup (hd0)Now to quit and check if it has worked:
quitsudo rebootMake sure you have taken the live cd out of your disc tray. All going well, you should start back up and see the grub once again.
How to restore the Windows XP bootloader
For this you will need your Windows XP installation CD. Boot into it now.
You will get to a part where it asks if you want to repair or recover. To do so, press "r".
If prompted, enter your Windows XP administrator password. This will leave you at at a command line, so type in the following two commands:
fixbootfixmbrThen type exit then remove your XP cd. If everything has gone well, you should come to your XP bootloader.
How to restore the Windows Vista or 7 bootloader
To restore the Windows Vista/7 bootloader, you must first boot off your Windows Vista/7 installation DVD.
If you have one of the many OEM computers that didnt come with a Vista/7 installation disk, you can get the same effect with a Vista recovery disk, which you can download from here (http://neosmart.net/blog/2008/windows-vista-recovery-disc-download).
When you get to the Regional settings, select your Location/Keyboard setting then click next. On the next page you must click on "Repair your computer."
On the next page, if it finds your Windows Vista/7 installation, make sure it is UNSELECTED before clicking next.
Then click on "Command prompt". From there, type in the folowing:
bootrec.exe /fixbootbootrec.exe /fixmbrNow close the two windows and click "Restart."
Take out your Vista/7 DVD and hopefully, you will be left with your Windows Vista/7 Bootloader.
talsemgeest
March 14th, 2010, 03:39 AM
I am in the same boat. I upgraded from Vista to Win 7. After the upgrade I can no longer access Ubuntu 9.10. Aparently Win 7 replaced/overwrote my bootloader. If I follow the instructions for restoring the Bootloader for Ubuntu I assume that I will loose Win 7 access. Can you explaine the workaround to get both working? Any help is appreciated.
Yes, once you have restored the ubuntu bootloader, boot into ubuntu and run sudo update-grub and you should have both on your boot menu.
talsemgeest
March 14th, 2010, 03:45 AM
I had ubuntu 7.10, I upgraded it to ubuntu-9.10 recently. Now I need to install windows. I have heard the grub version has changed for ubuntu-9.10 so my question is : "Can i use ubuntu-7.10 live cd to restore grub for ubuntu-9.10 after installing windows?"
Thanks in advance :)
Im afraid to restore the 9.10 bootloader you need the 9.10 live cd. However, considering you have upgraded, you may still have the 7.10 bootloader installed, in which case you can restore it using the instructions for 9.04 and before.
nelsonj
March 14th, 2010, 12:59 PM
Yes, once you have restored the ubuntu bootloader, boot into ubuntu and run sudo update-grub and you should have both on your boot menu.
Worked like a charm. Thanks
talsemgeest
March 14th, 2010, 01:33 PM
Worked like a charm. Thanks
Glad to hear it :)
kaax
March 15th, 2010, 06:02 PM
hi everyone, i have one problem, i have dual os, xp and ubuntu, last night i reinstall windows and wanted to restore grub loader and i did as writeen in first post of talsemgeest (http://ubuntuforums.org/member.php?u=397508)
, grub loader restored but there is another problem, i cant log in widows :( eror e408f0c20pfo9460,,, can anyone help me?
pls
sry about my inglish if there is any misteke :P i know english not well and i am surprised how i managed to write my problem there :D
thank
talsemgeest
March 15th, 2010, 11:26 PM
hi everyone, i have one problem, i have dual os, xp and ubuntu, last night i reinstall windows and wanted to restore grub loader and i did as writeen in first post of talsemgeest (http://ubuntuforums.org/member.php?u=397508)
, grub loader restored but there is another problem, i cant log in widows :( eror e408f0c20pfo9460,,, can anyone help me?
pls
sry about my inglish if there is any misteke :P i know english not well and i am surprised how i managed to write my problem there :D
thank
Im sorry, but that really seems like a windows problem, and a google search of the error code doesnt come up with anything.
kaax
March 16th, 2010, 04:56 AM
http://ubuntuguide.net/how-to-restore-grub-2-after-reinstalling-windows-xpvistawin7
there is the same problem, but i cant undestand, if someone do help me please
my grub is restored but when i type grub in terminal it says that grub is not installed, what does it mean?
talsemgeest
March 16th, 2010, 05:07 AM
Have you tried reinstalling the xp bootloader to make sure that it is not a windows fault?
kaax
March 16th, 2010, 05:17 AM
its need administrative password, i have no any pass
talsemgeest
March 16th, 2010, 01:41 PM
its need administrative password, i have no any pass
Ok then, it seems like a windows problem so I will not be able to be of any more help.
kaax
March 16th, 2010, 02:48 PM
its not windows problem, its a grub problem, grub cant load windows :|
today i reinstall windows with another cd but the same problem :|
ok i ll try another way to restore grub, do u know other method?
not "sudo grub"
another
edited: i cant even update grub loader
type: sudo update-grub2 but command not found :|
damn this f** grub
talsemgeest
March 16th, 2010, 11:16 PM
its not windows problem, its a grub problem, grub cant load windows :|
today i reinstall windows with another cd but the same problem :|
ok i ll try another way to restore grub, do u know other method?
not "sudo grub"
another
edited: i cant even update grub loader
type: sudo update-grub2 but command not found :|
damn this f** grub
Sorry, you mentioned in your first post something about the weird windows error message. Anyways, the command is sudo update-grub, not update-grub2. Also, it seems like you might be trying to follow the instructions for 9.04 and below, when you have ubuntu 9.10.
tsaunders
March 24th, 2010, 07:48 AM
I am getting an error when trying to restore Grub, it says that your are installing it to a partition and not to and MBR.
I am running 10.04 aplha 1 and am using the 9.10 Live cd as I couldn't find a live cd for 10.04
drs305
March 24th, 2010, 09:00 AM
I am getting an error when trying to restore Grub, it says that your are installing it to a partition and not to and MBR.
I am running 10.04 aplha 1 and am using the 9.10 Live cd as I couldn't find a live cd for 10.04
From the LiveCD, remember that you mount your Ubuntu partition (sda1, sda5, sdb1, etc) but normally you will install to the drive (sda, sdb). The reason has to do with how and where Grub2 will store the information. Installing to a specific partition requires the use of blocklists, which may cause Grub2 to fail if certain grub files are moved from their original location. Note you can install G2 to a partition, but it isn't recommended unless you must.
Here is a link to the community doc on reinstalling Grub2 from the LiveCD:
https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
tsaunders
March 24th, 2010, 10:14 AM
I can't get anything to work in that link. I just keep getting errors.
I think I am going to have to install 10.04 overtop of my current install and hopefully that will fix it - :\
As long as I can run the fixmbr for windows in case something goes wrong.
talsemgeest
March 24th, 2010, 01:39 PM
From the LiveCD, remember that you mount your Ubuntu partition (sda1, sda5, sdb1, etc) but normally you will install to the drive (sda, sdb). The reason has to do with how and where Grub2 will store the information. Installing to a specific partition requires the use of blocklists, which may cause Grub2 to fail if certain grub files are moved from their original location. Note you can install G2 to a partition, but it isn't recommended unless you must.
Here is a link to the community doc on reinstalling Grub2 from the LiveCD:
https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
Thanks drs305 :)
cashyy
April 1st, 2010, 10:46 PM
Hey Thanks for the help, I just have one problem.
I tried to reinstall grub, which is on sda5, but now when I go to computer I have a folder called sda5, and then I have a filesystem which sda5 is also in, Could this be the reason why ubuntu is booting up with grub rescue, because they are 2 sda5?
http://img221.imageshack.us/img221/3740/screenshotcomputerfileb.png
http://img221.imageshack.us/img221/8222/screenshotmediafilebrow.png
talsemgeest
April 2nd, 2010, 12:18 AM
There can technically only be one sda5, the one in /dev/. As long as you are not showing more than one up in "sudo fdisk -l", you should be fine.
nickhopkins07
April 2nd, 2010, 05:25 AM
Firstly, thank you for this thread, it's helped me sort out part of my problem, and I'm really hoping you nice people will be able to help me out with the second part!
So I'm gunna post my original problem here, for clarities sake:
Win 7/Jaunty -Nothing Boots after jaunty installation
Hi Guys,
I'm sure this has been answered already, I've had a search, but given I don't really know what I've done, I'm not sure what to search for!
I've got a laptop with Win 7 on it, and I wanted to install Jaunty as a dual boot to further my understanding of Ubuntu, and I think I've screwed up big time :sad: I've read up prior, but I've still managed to mess up somehow.
So I had two partitions one with my Win 7 one and an empty one, so I downloaded jaunty and used netbootin to create a bootable USB stick and booted into Jaunty, ran the install, followed the install process, chose the empty partition for Jaunty, and then on the last page (before clicking the install button) I clicked advance, and chose the same partition for the Ubuntu's version of MBR to be installed to, so as not to get in the way of MBR, or so I thought.
Install went through ok, but now when I start up the computer I dont get a dual boot screen, Win 7 starts right up, although it doesn't finish, the Win 7 splash screen appears, then blue screens (disapears to quick to read) and thats that! I've tried using the Win 7 repair disk and the bootrec.exe functions, but to no avail, also cant get into Win 7 in safe mode.
So the only way I can get anything out of the laptop at the moment is to use the bootable USB stick I created.
Can someone please outline what they think I may have done, and if it's fixable? I'll start from scratch and re-install if need be, but I'd rather not to be honest, as I see it I've have both the OS's I want installed, i just need a way to select them/load them.
Many thanks in advance.
Nick
So I posted the above and was pointed in the direction of this thread. I followed the instructions for recovering grub, and when I start up my laptop I am faced with a dual boot screen, from here I can happily start up the installed edition of 9.04, wonderful.
I'm still having the same problem with Win7 though, If I chose to load windows from the dual boot screen, it starts the process, then blue screens and the laptop restarts, I've tried repairing it with the Win 7 rescue cd, but to no avail. What is interesting/confusing is in the dual boot screen, windows is listed Vista rather win 7, which seems odd to me!
When I boot into Jaunty and look at the drives, I have one partition with Win 7 on it, which when i browse to it seems fine, all the folders etc you'd expect to be there are. I have another partition called 'SYSTEM' which I beleive to house the original MBR on, and a third partition 'Filesystem' with all the Jauty stuff on.
Anyone any ideas how I can sort this out please? It would be much appreciated.
Thank you
talsemgeest
April 2nd, 2010, 05:50 AM
Firstly, thank you for this thread, it's helped me sort out part of my problem, and I'm really hoping you nice people will be able to help me out with the second part!
So I'm gunna post my original problem here, for clarities sake:
So I posted the above and was pointed in the direction of this thread. I followed the instructions for recovering grub, and when I start up my laptop I am faced with a dual boot screen, from here I can happily start up the installed edition of 9.04, wonderful.
I'm still having the same problem with Win7 though, If I chose to load windows from the dual boot screen, it starts the process, then blue screens and the laptop restarts, I've tried repairing it with the Win 7 rescue cd, but to no avail. What is interesting/confusing is in the dual boot screen, windows is listed Vista rather win 7, which seems odd to me!
When I boot into Jaunty and look at the drives, I have one partition with Win 7 on it, which when i browse to it seems fine, all the folders etc you'd expect to be there are. I have another partition called 'SYSTEM' which I beleive to house the original MBR on, and a third partition 'Filesystem' with all the Jauty stuff on.
Anyone any ideas how I can sort this out please? It would be much appreciated.
Thank you
Ok, seems to be the usual "Windows throwing a fit", so I would suggest backing up any files you want to keep from the windows partition, reinstalling windows, then recovering the grub as-per this thread.
nickhopkins07
April 2nd, 2010, 06:10 AM
Hmm, was worried you'd say that! My laptop wasn't supplied with the windows media disk, just the licence, and no recovery partition, although I think that may have been an oversight on my part. Really don't want to have to pay out on a Win 7 disk, paying twice for the privalige of using Windows is a bit of a kick in the teeth! although it sounds like I mnight not have much choice :(.
Thanks gain for your help.
talsemgeest
April 2nd, 2010, 06:06 PM
Hmm, was worried you'd say that! My laptop wasn't supplied with the windows media disk, just the licence, and no recovery partition, although I think that may have been an oversight on my part. Really don't want to have to pay out on a Win 7 disk, paying twice for the privalige of using Windows is a bit of a kick in the teeth! although it sounds like I mnight not have much choice :(.
Thanks gain for your help.
I hate to mention it, but as you do own a windows 7 license, there are certain parts of the internet that you will be able to download an untouched dvd image of the installation disk.
balkrish999
April 3rd, 2010, 08:54 AM
omg Thank You sho much ( how to resote windows vista and 7 boot loader)
i did it thanks so much:): i got worried when i clicked on reapir you pc and it did but on restart grub error but i them typed in compan promte fix boot etc
Thank soooooooo much :) Thank :)
talsemgeest
April 3rd, 2010, 04:03 PM
omg Thank You sho much ( how to resote windows vista and 7 boot loader)
i did it thanks so much:): i got worried when i clicked on reapir you pc and it did but on restart grub error but i them typed in compan promte fix boot etc
Thank soooooooo much :) Thank :)
Excellent, I am glad it worked for you (or at least I think thats what you said ;))
dushy4
April 6th, 2010, 06:45 AM
How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 9.10)
This How-to is for windows dual booters who reinstall an operating system only to find that it has taken away access to their other operating system.
Whether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide will walk you through it.
All three parts of this tutorial require that you boot from a cd. If you don't know how to do this, check here. (http://www.hiren.info/pages/bios-boot-cdrom)
If you have made a mistake and want to revert the changes, simply follow the instructions for reinstalling the previous bootloader. For example, if you have installed vista over ubuntu, try to get the ubuntu bootloader back, but want to get the vista bootloader back, simply follow my instructions for installing the vista bootloader.
How to restore the Ubuntu grub bootloader (9.10 and beyond)
First you need to find out what your drives are called. You can do this by going to a terminal and typing: sudo fdisk -l You will get something like this:
http://talsemgeest.doesntexist.com/blog/wp-content/uploads/2009/09/SVR8XIL.JPG
From that you need to find the device name of your Ubuntu drive, something like /dev/sda5″.
So, still in the terminal, type:
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5And then, to reinstall the grub: sudo grub-install --root-directory=/media/sda5 /dev/sdaPush enter and youre done! Of course you need to replace /dev/sda5″ and /dev/sda with what you found in the fdisk output.
How to restore the Ubuntu grub bootloader (9.04 and older)
First of all, all credit for this part of the tutorial goes to catlet (http://ubuntuforums.org/showpost.php?p=1308395&postcount=1). I am simply rewriting his tutorial to have all three bootloaders in this tutorial.
So, lets begin. To restore the grub, you must boot off the ubuntu live cd. Any ubuntu live cd will do.
Once there, open a terminal (Applications>Accessories>Terminal) and type this:
sudo grubNext, you need to find which hard drive ubuntu and the grub is installed to. You do this by running this command:
find /boot/grub/stage1Take note of what it returns (something like (hd0,1).)
Now you need to tell Grub where it is installed. Using the output of the last command, change this one and run it:
root (hd<a>,<b>)Replacing <a> and <b> with what you got back before. For example, if "find /boot/grub/stage1" gave me "(hd0,1)", you would run "root (hd0,1)"
Ok, so thats the configuration over and done with. Now we just need to run one command to install the Grub to your hard drive:
setup (hd0)Now to quit and check if it has worked:
quitsudo rebootMake sure you have taken the live cd out of your disc tray. All going well, you should start back up and see the grub once again.
How to restore the Windows XP bootloader
For this you will need your Windows XP installation CD. Boot into it now.
You will get to a part where it asks if you want to repair or recover. To do so, press "r".
If prompted, enter your Windows XP administrator password. This will leave you at at a command line, so type in the following two commands:
fixbootfixmbrThen type exit then remove your XP cd. If everything has gone well, you should come to your XP bootloader.
How to restore the Windows Vista or 7 bootloader
To restore the Windows Vista/7 bootloader, you must first boot off your Windows Vista/7 installation DVD.
If you have one of the many OEM computers that didnt come with a Vista/7 installation disk, you can get the same effect with a Vista recovery disk, which you can download for Vista (http://neosmart.net/blog/2008/windows-vista-recovery-disc-download) or Win 7 (http://neosmart.net/blog/2009/windows-7-system-repair-discs/).
When you get to the Regional settings, select your Location/Keyboard setting then click next. On the next page you must click on "Repair your computer."
On the next page, if it finds your Windows Vista/7 installation, make sure it is UNSELECTED before clicking next.
Then click on "Command prompt". From there, type in the folowing:
bootrec.exe /fixbootbootrec.exe /fixmbrNow close the two windows and click "Restart."
Take out your Vista/7 DVD and hopefully, you will be left with your Windows Vista/7 Bootloader.
thanks dear,you saved my life,,it worked perfectly without any problem):P
talsemgeest
April 6th, 2010, 08:59 AM
thanks dear,you saved my life,,it worked perfectly without any problem):P
Excellent, happy to hear :)
airplus
April 14th, 2010, 10:04 AM
Hi, please could someone help me with this?
I have 3 systems installed (XP, Vista & Ubuntu)
The grub in Ubuntu got corrupted, so after long hoursof looking at forums I managed to reinstall it.
However, it boots straight into Ubuntu (holding Shift does not work) and cant access neither of Windows (XP nor Vista).
I used to boot with the EasyBCD (configured in Vista) and all was great.
Now I am afraid to further damage things, as I need the computer for work and at least Ubuntu is working. ](*,)
This is the output of fdisk:
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe8000000
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 10199 61440000 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 10199 14130 31576153 83 Linux
/dev/sda4 14131 14593 3719047+ 5 Extended
/dev/sda5 14131 14593 3719016 82 Linux swap / Solaris
Also this is the result of a script I got from http://ubuntuforums.org/showpost.php?p=9015919&postcount=2 (attached)
Thanks in advance!!!
Edit: I have done the sudo grub-update twice to no avail. I keeps going straight into Ubuntu.
Edit: SOLVED!!!! I did:
sudo grub-install /dev/sda3 (sda3 is my Ubuntu partition)
then in the Vista command line:
bootrec.exe /fixboot
bootrec.exe /fixmbr and restart. Fixed!!
Phew!!! this was close :)
All this happened because I wanted to uninstall Python 2.6 from Ubuntu Software Centre, after all (I thought) I already had Python 3.1 installed. BAD IDEA. Ubuntu crashed badly in the middle of the process and would crash on starting.
So I had to reinstall from LiveCD and untar the backup file, which did corrupt Grub. Lessons learnt:
Keep a fresh backup.
Be careful with Linux, if not broken, don't fix it.:)
Hman242
April 17th, 2010, 04:55 PM
When I put in
bootrec.exe /fixboot repair Win7, it says
This volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted.What do I do? Before having the option of choosing Command Prompt, it didn't pick up my OS. I didn't load any driver and just clicked next. If I did need to do that, then where would I find the one(s?) I need to load?
talsemgeest
April 17th, 2010, 05:49 PM
That does not sound good. It sounds as though you may have deleted your windows partition. Make sure you can access your windows files from ubuntu, to check if they are still there.
Hman242
April 17th, 2010, 10:46 PM
It's still there.
talsemgeest
April 18th, 2010, 12:43 AM
Ok, what other drives/partitions are there on your system?
Hman242
April 18th, 2010, 06:03 PM
There are four partitions. Windows, Ubuntu, and two recovery partitions that were there by default. I remember back when I shrink the Windows partition and made the Ubuntu partition, it said something about the number of partitions I had would make the partitions secondary partitions or something like that. Then it said something along the lines of having one OS. I ignored it, but that might have had something to do with my problem.
talsemgeest
April 19th, 2010, 12:25 AM
Ok, if you still want ubuntu I would suggest you run the instructions for ubuntu. If not, I suggest you delete all the partitions other than the windows one. After that you should be able to load windows.
abdusamed
April 23rd, 2010, 04:01 AM
Thanks.. it WORKED... i really didn't want to format my pc.. cuz of u, i saved a week of hardwork.. thanks.. Btw, for windows 7, you should have said to select the other option, not deselect it
talsemgeest
April 23rd, 2010, 04:46 AM
Thanks.. it WORKED... i really didn't want to format my pc.. cuz of u, i saved a week of hardwork.. thanks.. Btw, for windows 7, you should have said to select the other option, not deselect it
Excellent, I am glad it worked. But no, I did mean to deselect it, because then the recovery cd will try to fix the bootloader, and in my experience it never does. So it needs to be deselected to be able to go to the command line and enter the commands.
blittle
April 24th, 2010, 12:20 PM
Hello!
Background: Recently reinstalled Windows XP 64 to test out for my regular job site on my personal computer where I originally had Vista installed, but rarely used it. Forgot that Windows wipes our mbr, but figured I'd use easyBCD to fix. No dice since EasyBCD wants to work with Vista and this is XP. Anyway, would rather use a Linux solution. So to get to my Linux partition, I booted using supergrubdisk 1.30 (for grub2) since I use Ubuntu 9.10.
Had great success booting i and so I found this thread.
So far, I have gotten this far:
after rnning fdisk -l,
ubuntu@ubuntu:~$ sudo mkdir /media/sda1
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /media/sda1
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sda1 /dev/sda
The istallation came back with no errors, but upon boot I get:
Grub Loading.
error: File not found
Grub Rescue
then a prompt.
Did I land grub on the wrong directory? I know my linux partition is on sda1
Any incite would be greatly appreciated.
talsemgeest
April 24th, 2010, 06:12 PM
Hello!
Background: Recently reinstalled Windows XP 64 to test out for my regular job site on my personal computer where I originally had Vista installed, but rarely used it. Forgot that Windows wipes our mbr, but figured I'd use easyBCD to fix. No dice since EasyBCD wants to work with Vista and this is XP. Anyway, would rather use a Linux solution. So to get to my Linux partition, I booted using supergrubdisk 1.30 (for grub2) since I use Ubuntu 9.10.
Had great success booting i and so I found this thread.
So far, I have gotten this far:
after rnning fdisk -l,
ubuntu@ubuntu:~$ sudo mkdir /media/sda1
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /media/sda1
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sda1 /dev/sda
The istallation came back with no errors, but upon boot I get:
Grub Loading.
error: File not found
Grub Rescue
then a prompt.
Did I land grub on the wrong directory? I know my linux partition is on sda1
Any incite would be greatly appreciated.
Do you have any other hard drives in that machine? The fdisk -l output would be particularly useful to post.
drmikegreen
May 1st, 2010, 04:41 PM
Following the instructions here has resulted in my digging a deeper hole for myself. Now I get the following when I try to reboot:
"error file not found.
grub rescue>"
I even get this message when I try to reboot from the Window 7 Rescue Disk -- not only from the hard drive.
Help!!!
drmikegreen
May 1st, 2010, 05:17 PM
Well, I was able to get myself out of the deeper hole by using an Ubuntu live CD to repeat the first bits of the instructions -- the ones for re-installing Grub.
I still cannot get to Windows 7, even using the Windows 7 Recovery Disk.
drmikegreen
May 1st, 2010, 08:28 PM
Finally I have (I hope) climbed out of the hole.
First, it required downloading the Windows 7 Rescue Disk again and burning a new CD. (Apparently there was something wrong with my first attempt.)
Then I went through the steps described for the Windowns recovery in the instructions here -- with a couple of exceptions (perhaps Windows puts up different screens for different versions?). At the end of that process I could again boot into Windows 7.
But then I could not boot into Ubuntu Linux.
So I again used the Ubuntu live CD to repeat the first bits of the instructions -- the ones for re-installing Grub.
And, finally, I am able to boot into either Ubuntu Linux (Lucid Lynx) or Windows 7.
Whew!
BTW, my guess is that my troubles were precipitated by the screen in the update process which asks one where to put Grub. I suspect I answered that incorrectly out of ignorance. I hope that someone will either provide better instuctions with that screen or - preferable remove it altogether and make the upgrade process figure out automatically where to put it.
Cheers!
Mike Green
emma00
May 4th, 2010, 02:57 PM
How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 9.10)
This How-to is for windows dual booters who reinstall an operating system only to find that it has taken away access to their other operating system.
Whether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide will walk you through it.
All three parts of this tutorial require that you boot from a cd. If you don't know how to do this, check here. (http://www.hiren.info/pages/bios-boot-cdrom)
If you have made a mistake and want to revert the changes, simply follow the instructions for reinstalling the previous bootloader. For example, if you have installed vista over ubuntu, try to get the ubuntu bootloader back, but want to get the vista bootloader back, simply follow my instructions for installing the vista bootloader.
How to restore the Ubuntu grub bootloader (9.10 and beyond)
First you need to find out what your drives are called. You can do this by going to a terminal and typing: sudo fdisk -l You will get something like this:
http://img517.imageshack.us/img517/713/svr8xil.jpg
From that you need to find the device name of your Ubuntu drive, something like /dev/sda5″.
So, still in the terminal, type:
sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5And then, to reinstall the grub: sudo grub-install --root-directory=/media/sda5 /dev/sdaPush enter and youre done! Of course you need to replace /dev/sda5″ and /dev/sda with what you found in the fdisk output.
How to restore the Ubuntu grub bootloader (9.04 and older)
First of all, all credit for this part of the tutorial goes to catlet (http://ubuntuforums.org/showpost.php?p=1308395&postcount=1). I am simply rewriting his tutorial to have all three bootloaders in this tutorial.
So, lets begin. To restore the grub, you must boot off the ubuntu live cd. Any ubuntu live cd will do.
Once there, open a terminal (Applications>Accessories>Terminal) and type this:
sudo grubNext, you need to find which hard drive ubuntu and the grub is installed to. You do this by running this command:
find /boot/grub/stage1Take note of what it returns (something like (hd0,1).)
Now you need to tell Grub where it is installed. Using the output of the last command, change this one and run it:
root (hd<a>,<b>)Replacing <a> and <b> with what you got back before. For example, if "find /boot/grub/stage1" gave me "(hd0,1)", you would run "root (hd0,1)"
Ok, so thats the configuration over and done with. Now we just need to run one command to install the Grub to your hard drive:
setup (hd0)Now to quit and check if it has worked:
quitsudo rebootMake sure you have taken the live cd out of your disc tray. All going well, you should start back up and see the grub once again.
How to restore the Windows XP bootloader
For this you will need your Windows XP installation CD. Boot into it now.
You will get to a part where it asks if you want to repair or recover. To do so, press "r".
If prompted, enter your Windows XP administrator password. This will leave you at at a command line, so type in the following two commands:
fixbootfixmbrThen type exit then remove your XP cd. If everything has gone well, you should come to your XP bootloader.
How to restore the Windows Vista or 7 bootloader
To restore the Windows Vista/7 bootloader, you must first boot off your Windows Vista/7 installation DVD.
If you have one of the many OEM computers that didnt come with a Vista/7 installation disk, you can get the same effect with a Vista recovery disk, which you can download for Vista (http://neosmart.net/blog/2008/windows-vista-recovery-disc-download) or Win 7 (http://neosmart.net/blog/2009/windows-7-system-repair-discs/).
When you get to the Regional settings, select your Location/Keyboard setting then click next. On the next page you must click on "Repair your computer."
On the next page, if it finds your Windows Vista/7 installation, make sure it is UNSELECTED before clicking next.
Then click on "Command prompt". From there, type in the folowing:
bootrec.exe /fixbootbootrec.exe /fixmbrNow close the two windows and click "Restart."
Take out your Vista/7 DVD and hopefully, you will be left with your Windows Vista/7 Bootloader.
Are these instructions are same for ubuntu 10.04 :popcorn:
edekba
May 6th, 2010, 05:35 AM
So i'm trying to recover my WinXp bootloader, after i installed 10.04 and I can not get the recovery console up ...
any ideas?
progone
May 7th, 2010, 06:07 PM
thanks for the solution
How to restore the Ubuntu grub bootloader (9.10 and beyond)
it worked!!! Yay!!! :KS
progone
May 7th, 2010, 07:21 PM
bootrec.exe /fixbootbootrec.exe /fixmbrNow close the two windows and click "Restart."
Take out your Vista/7 DVD and hopefully, you will be left with your Windows Vista/7 Bootloader.
grrr.
I wish I read this part. Now I lost my Grub2 again but this time only Vista starts up and Live Disk.
I tried to redo the steps that helped me overcome the Grub rescue> issue as I did before. No results.
nightspore1
May 7th, 2010, 07:38 PM
Hi, Talsemgeest ! Kudo's to you. I upgraded to the new Ubuntu and managed to lose access to my Vista. Being a starter in Ubuntu that didn't go well vwith me. But your instructions solved my problem perfectly, I've gotten my complete dual boot back, GRUB works like crazy!!
Once more THANKS!!!!
wjz
May 13th, 2010, 11:45 PM
talsegeest is the absolute business thanks for the bootloader info
Yaheed
May 16th, 2010, 11:26 PM
Is it possible to use Grub to boot my Windows Vista installation on another hard drive?
e.g. sda is Ubuntu, sdb is Windows Vista.
sda has the grub bootloader on it, sdb has Windows' bootloader on it. I'd prefer to keep the two bootloaders separated but if there is no other way ...
drs305
May 17th, 2010, 06:50 AM
Is it possible to use Grub to boot my Windows Vista installation on another hard drive?
e.g. sda is Ubuntu, sdb is Windows Vista.
sda has the grub bootloader on it, sdb has Windows' bootloader on it. I'd prefer to keep the two bootloaders separated but if there is no other way ...
Yes, absolutely.
When you install Grub2 it should find Windows. If not, after installing run "sudo update-grub" and in most cases Windows will be automatically added to the Grub2 menu.
CrazyIvan24
May 17th, 2010, 08:43 PM
OK - so I am TOTALLY confused here. I put a version of Ubuntu Netbook Remix on my EEEPC 900HA. It looked nice, but the keyboard and touchpad ceased to work. I looked around for another version of Ubuntu for my EEEPC and found EasyPeasy (eeebuntu). So, I look on line and find that I need to delete the partition in Windows to get rid of Ubuntu. Did that....but then....I end up with "grub rescue" each time I boot. I've been looking at all the threads, and I am totally confused. Folks mention using the restore CD that came with my computer. Tried that. Even though I've ensured the BIOS will go to that drive first, I get nothing. I also found the thread that noted I should download/create a USB with Super Grub Disk on it. Did that. Again, changed the BIOS to load from the USB first....nothing, nada, zip. Then I see threads that tell me to open a terminal window and type in various lines of code. OK, I'd do that, but how the heck to I get to a terminal prompt from grub rescue? Every line I've seen to list my drives works only to list the drives. Then when I try to go deeper, all I get is 'unknown command' or 'unrecognized file type'.
Could someone please tell me, in simple terms, how the heck I can force my 'puter to either boot from the USB, USB Optical drive, or get to a windows command prompt where I can force the 'puter to load from my NTFS drive?
I'm really new to this linux-based stuff here, so please dumb it down for this one 8-)
Thanks!
dontfearthepenguin
May 18th, 2010, 02:24 PM
Wow wish I would have seen this a couple weeks ago when I reloaded Windows 7 because I formatted my Linux HD and booted to plain black screen with a cursor up top.
This would have probably saved me about an hour of time wasted reinstalling both Windows AND ubuntu 10.04
S1n1ster
May 21st, 2010, 03:52 AM
Someone please help me. I have a acer aspire as1410 with windows vista. I installed ubuntu but it did not work, after trying to make it work and giving up i decided to return to windows. when grub popped up i selected windows and used acer e-recovery management to reset the computer to factory settings with windows. now whenever i boot it says "grub loading. error no such partiton, grub rescue>" i am begging anyone i have spent months saving up for this computer and now i may have ruined it. please help me get vista working again.
Mike Cortez
Trent T
June 14th, 2010, 09:55 PM
Thanks, talsemgeest, for this excellent and comprehensive guide to restoring grub!
I have a Toshiba Tecra A7 laptop with an 80 GB HDD. It ran for about 6 years dual-booting Win XP and Xandros Linux. Since Xandros is effectively no longer supported (another story), I was unable to fix it when it recently stopped working.
I wiped the Linux partitions, left Win XP where it was, and installed Ubuntu 9.10 in the empty space (23 MB). It worked very well on restart, and I was able to choose and start either operating system from the GRUB2 menu.
However in Win XP, I noticed that my Norton Security Suite had been damaged, and was no longer working! I reinstalled Norton, restarted the computer, and found that GRUB2 no longer worked!
I reinstalled Ubuntu 9.10 from the ground up, and once again, Norton had been disabled. When I re-enabled Norton, GRUB2 stopped working.
I followed your steps to re-install GRUB2. An error message said that /dev/sdb1 could not be accessed.
Upon restart, GRUB2 now says,
Loading GRUB - file not found
grub rescue>
I can load and run either WIN XP or Ubuntu 9.10 if I boot from the Grub2 rescue disk.
I assume that Norton Security Suite is interfering with GRUB somehow--
Do you know of a way to make Norton and GRUB2 keep away from each other?
If not, do you know of any other WIN XP security product that will not interfere with GRUB2?
Thanks for any assistance you can provide!
--Trent T
Here's my GRUB2 reinstallation attempt:
trent@trent-laptop:~$ sudo fdisk -l
[sudo] password for trent:
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9e4c9e4c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6174 49592623+ 7 HPFS/NTFS
/dev/sda2 9214 9729 4144770 1c Hidden W95 FAT32 (LBA)
/dev/sda3 6175 9213 24410767+ 5 Extended
/dev/sda5 6175 9081 23350446 83 Linux
/dev/sda6 9082 9213 1060258+ 82 Linux swap / Solaris
Partition table entries are not in disk order
trent@trent-laptop:~$ sudo mkdir /media/sda5
trent@trent-laptop:~$ sudo mount /dev/sda5 /media/sda5
trent@trent-laptop:~$ sudo grub-install --root-directory=/media/sda5 /dev/sda
error: cannot open `/dev/sdb' while attempting to get disk size
error: cannot open `/dev/sdb' while attempting to get disk size
error: cannot open `/dev/sdb' while attempting to get disk size
error: cannot open `/dev/sdb' while attempting to get disk size
error: cannot open `/dev/sdb' while attempting to get disk size
error: cannot open `/dev/sdb' while attempting to get disk size
Installation finished. No error reported.
This is the contents of the device map /media/sda5/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda
(hd1) /dev/sdb
trent@trent-laptop:~$
================================================== =
Here's my system information:
Toshiba Tecra A7 with Intel 32-bit CPU, 504 MB RAM.
/dev/sda1 Win XP SP3 48430 MB NTFS
/dev/sda2 Hidden partition 04040 MB FAT32
/dev/sda5 Ubuntu 9.10 22803 MB ext4
/dev/sda3 extended 24410 MB
Memory*: 504 MB RAM, 76 GB HDD
Display*:
Mobile Intel 945 Express Chipset Family
Adapter:
1394 Net Adapter
Intel Pro/1000 PL Network Connection
Intel Pro/Wireless 3945ABG Network Connection
Trent T
June 14th, 2010, 10:29 PM
Hi Mike--
I have a similar situation going on--
While mine is not resolved either, I found that I can boot Windows from a Super Grub Rescue Disk. You can download the .iso from this website or one of its mirrors, here:
http://www.supergrubdisk.org/index.php?pid=1
Burn the .iso to a CD, and you are ready for the next step.
Next, put the CD in your drive, and select your "Start computer from CD" option when you boot up.
Super Grub 2 has an option called "detect any OS"--
Select it, and your Windows OS will appear on the list.
Arrow down to select Windows, and it should boot up your computer.
Next, make a full system backup of your Windows system, possibly to an external hard drive--Hopefully, you made a complete backup before your attempt to put in Linux. If not, back it all up as soon as possible!
You may have to restore Windows from backup, so its good to have a complete backup on another drive somewhere.
Next Step-- your decision. You could continue to attempt to fix Windows, or if you just want to take a break from Operating System Madness (OSM), you could just reformat the hard drive, and restore your Windows from backup. If it was me, and if I had the space, I would make two NTFS partitions. Install Windows in one, and leave the other one for backing up your crash-prone Windows system. If you decide later to try Linux again, you could install it in your second partition...
Good luck!
--Trent T
Someone please help me. I have a acer aspire as1410 with windows vista. I installed ubuntu but it did not work, after trying to make it work and giving up i decided to return to windows. when grub popped up i selected windows and used acer e-recovery management to reset the computer to factory settings with windows. now whenever i boot it says "grub loading. error no such partiton, grub rescue>" i am begging anyone i have spent months saving up for this computer and now i may have ruined it. please help me get vista working again.
Mike Cortez
talsemgeest
June 17th, 2010, 03:24 PM
Someone please help me. I have a acer aspire as1410 with windows vista. I installed ubuntu but it did not work, after trying to make it work and giving up i decided to return to windows. when grub popped up i selected windows and used acer e-recovery management to reset the computer to factory settings with windows. now whenever i boot it says "grub loading. error no such partiton, grub rescue>" i am begging anyone i have spent months saving up for this computer and now i may have ruined it. please help me get vista working again.
Mike Cortez
Sorry for the delay, I have been extremely busy lately. Make sure you run through the instructions for windows vista, and if you don't have a vista install dvd there is a link to a recovery cd.
As long as the acer recovery successfully installed windows, and it is just the bootloader that is problematic, you should be fine.
talsemgeest
June 17th, 2010, 03:29 PM
I followed your steps to re-install GRUB2. An error message said that /dev/sdb1 could not be accessed.
Upon restart, GRUB2 now says,
Loading GRUB - file not found
grub rescue>
Ok, make sure that after you have mounted /dev/sda5 you can access the partition, so manually browse to /media/sda5 and see if you can access all the usual files. If not, norton may have corrupted the partition.
Also, I would suggest removing norton and installing one of the great free alternative antivirus programs. but of course that is up to your discretion.
LocutusSK
June 17th, 2010, 03:55 PM
Hi,
First, I would like to thank talsemgeest for excellent guide.
Now, here's my problem. I have two HDDs. On one I have Windows 7, on the second one I installed Ubuntu 10.04. After installing Ubuntu, I couldn't boot to Windows. So I ran bootrec.exe /fixboot and bootrec.exe /fixmbr in the console. Now I can boot into Windows, but I can't boot into Ubuntu.
I followed your instructions for restoring Ubuntu grub bootloader (9.10 an beyond) and here's what I get when I run sudo fdisk -l
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c320c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 13055 104755200 7 HPFS/NTFS
/dev/sda3 26109 121602 767044608 7 HPFS/NTFS
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 243202 1953514583+ ee GPT
This is what I get when I run sudo parted -l
ubuntu@ubuntu:~$ sudo parted -l
Model: ATA SAMSUNG HD103UJ (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 106MB 105MB primary ntfs boot
2 106MB 107GB 107GB primary ntfs
3 215GB 1000GB 785GB primary ntfs
Model: ATA WDC WD20EARS-00J (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 1976GB 1976GB ext4
3 1976GB 2000GB 24.6GB linux-swap(v1)
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0
has been opened read-only.
Error: /dev/sr0: unrecognised disk label
So I thought that the ubuntu partition will be /dev/sdb2, but this is what I get when I run the remaining commands:
ubuntu@ubuntu:~$ sudo mkdir /media/sdb2
ubuntu@ubuntu:~$ sudo mount /dev/sdb2 /media/sdb2
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/media/sdb2 dev/sdb/usr/sbin/grub-probe: error: cannot stat `dev/sdb'.
Invalid device `dev/sdb'.
Try `/usr/sbin/grub-setup --help' for more information. Any ideas how to solve this ?
Many thanks.
COKEDUDE
June 18th, 2010, 02:38 AM
This guide was very helpful. Thx for this.
imjscn
June 18th, 2010, 03:18 AM
sudo apt-get install mbr
and:
sudo install-mbr /dev/sdX
(of course replace the X with your destination)
Then just reboot.
I actually tried that with XP and it worked fine.
I partitioned my entire harddisk except a Hidden partition, and clean install winxp on laptop, then, I couldn't boot OS and I couldn't boot from CD or floppy. Luckily, an old Xunbuntu 8.04 CD can boot, and I installed Xubuntu. Now can boot Xubuntu OS, still can't boot CD or floppy. There's no boot choice or any menu when start. I guess mbr is damaged. Here's my boot info:
Boot Info Script 0.55 dated February 15th, 2010
============================= Boot Info Summary: ==============================
=> Grub 0.97 is installed in the MBR of /dev/sda and looks on the same drive
in partition #3 for /grub/stage2 and /grub/menu.lst.
sda1: __________________________________________________ _______________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 8.04
Boot files/dirs: /etc/fstab
sda2: __________________________________________________ _______________________
File system: vfat
Boot sector type: Windows XP: Fat32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM /COMMAND.COM
sda3: __________________________________________________ _______________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files/dirs: /grub/menu.lst
sda4: __________________________________________________ _______________________
File system: Extended Partition
Boot sector type: -
Boot sector info:
sda5: __________________________________________________ _______________________
File system: swap
Boot sector type: -
Boot sector info:
sda6: __________________________________________________ _______________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files/dirs:
sda7: __________________________________________________ _______________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files/dirs:
sda8: __________________________________________________ _______________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files/dirs:
=========================== Drive/Partition Info: =============================
Drive: sda ___________________ __________________________________________________ ___
Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders, total 117210240 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xcccdcccd
Partition Boot Start End Size Id System
/dev/sda1 63 29,302,559 29,302,497 83 Linux
/dev/sda2 107,064,720 117,195,119 10,130,400 12 Compaq diagnostics
/dev/sda3 * 29,302,560 33,206,354 3,903,795 83 Linux
/dev/sda4 33,206,355 107,057,159 73,850,805 5 Extended
/dev/sda5 33,206,418 35,166,284 1,959,867 82 Linux swap / Solaris
/dev/sda6 35,166,348 74,236,364 39,070,017 83 Linux
/dev/sda7 74,236,428 76,196,294 1,959,867 83 Linux
/dev/sda8 76,196,358 107,057,159 30,860,802 83 Linux
blkid -c /dev/null: __________________________________________________ __________
Device UUID TYPE LABEL
/dev/sda1 257a7d04-2874-4282-9bb7-77b06fe4b471 ext3
/dev/sda2 D005-3738 vfat IBM_SERVICE
/dev/sda3 ae9a8425-b9ec-41ac-8399-0fb9e41649c7 ext3
/dev/sda5 3618fbc0-1750-46dd-938c-7437a39a469d swap
/dev/sda6 66b82697-508a-454e-b28a-2cfcb4d8db10 ext3
/dev/sda7 cc6f9869-9ee1-4909-a377-a2142f3b1b6e ext3
/dev/sda8 f8c6f3d3-5f31-4cb3-990a-c4e332706e8f ext3
============================ "mount | grep ^/dev output: ===========================
Device Mount_Point Type Options
/dev/sda1 / ext3 (rw,relatime,errors=remount-ro)
/dev/sda3 /boot ext3 (rw,relatime)
/dev/sda6 /home ext3 (rw,relatime)
/dev/sda7 /tmp ext3 (rw,relatime)
/dev/sda8 /usr ext3 (rw,relatime)
=============================== sda1/etc/fstab: ===============================
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=257a7d04-2874-4282-9bb7-77b06fe4b471 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda3
UUID=ae9a8425-b9ec-41ac-8399-0fb9e41649c7 /boot ext3 relatime 0 2
# /dev/sda6
UUID=66b82697-508a-454e-b28a-2cfcb4d8db10 /home ext3 relatime 0 2
# /dev/sda7
UUID=cc6f9869-9ee1-4909-a377-a2142f3b1b6e /tmp ext3 relatime 0 2
# /dev/sda8
UUID=f8c6f3d3-5f31-4cb3-990a-c4e332706e8f /usr ext3 relatime 0 2
# /dev/sda5
UUID=3618fbc0-1750-46dd-938c-7437a39a469d none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
=================== sda1: Location of files loaded by Grub: ===================
.0GB: initrd.img
.0GB: vmlinuz
================================ sda2/boot.ini: ================================
[boot loader]
timeout=0
default=C:\
[operating systems]
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
C:\ = "PC-DOS"
============================= sda3/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 use 'savedefault' 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=257a7d04-2874-4282-9bb7-77b06fe4b471 ro
## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,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
## 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
## Xen hypervisor options to use with the default Xen boot option
# xenhopt=
## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
## 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
## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false
## ## End Default Options ##
title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd0,2)
kernel /vmlinuz-2.6.24-16-generic root=UUID=257a7d04-2874-4282-9bb7-77b06fe4b471 ro quiet splash
initrd /initrd.img-2.6.24-16-generic
quiet
title Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)
root (hd0,2)
kernel /vmlinuz-2.6.24-16-generic root=UUID=257a7d04-2874-4282-9bb7-77b06fe4b471 ro single
initrd /initrd.img-2.6.24-16-generic
title Ubuntu 8.04, memtest86+
root (hd0,2)
kernel /memtest86+.bin
quiet
### 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/sda2
title Windows NT/2000/XP
root (hd0,1)
savedefault
makeactive
chainloader +1
=================== sda3: Location of files loaded by Grub: ===================
15.7GB: grub/menu.lst
15.7GB: grub/stage2
15.0GB: initrd.img-2.6.24-16-generic
15.0GB: initrd.img-2.6.24-16-generic.bak
15.0GB: vmlinuz-2.6.24-16-generic
Following this thread instruction, I did the 2 step:
sudo apt-get install mbr
Result: mbr is already the newest version.
mbr set to manually installed.
sudo install-mbr /dev/sda1
Result: install-mbr:/dev/sda1: No boot signature found. Use --force to override.
I'm a linux dummy, please instruct me what to do now.
imjscn
June 18th, 2010, 10:30 AM
By the way, why can boot from Xubuntu LiveCD but not other CDs ? (my winxp is a copyright one)
oldfred
June 18th, 2010, 12:51 PM
imjscn This thread is a how to and posts should relate to corrections, comments and improvements, not individual problems. Please start your own thread.
You have a variety of issues. Windows boots the partition with the boot flag but you do not have it on the windows partition. It looks like you moved from sda3 to sda2 as your boot.ini refers to sda3 not sda2 to boot.
imjscn
June 18th, 2010, 12:56 PM
sorry for posting inproperly. I will start my own thread then. Thanks!
mistaken
June 18th, 2010, 01:41 PM
Hello,
I upgraded to ubuntu to 10.04 and now unable to load any OS.
I get that error, that no such device and GRUB RESCUE>
thats all. I canīt use a live cd, as have NO CD DRIVE, NO boot from flash, NO floppy.
Any suggestions how manually configure bootloader? Now works only ls and insmod commands as grub rescue is a little bit restricted... even help command not working :)
please answer grub rescue command line experts :)
P.S. before I had win xp+xubuntu and lots of partitions. Probably, too grubs, as I had to choose what I want to load twice :) and now - no possibility to choose at all.... help. :)
talsemgeest
June 18th, 2010, 10:13 PM
Hi,
Now, here's my problem. I have two HDDs. On one I have Windows 7, on the second one I installed Ubuntu 10.04. After installing Ubuntu, I couldn't boot to Windows. So I ran bootrec.exe /fixboot and bootrec.exe /fixmbr in the console. Now I can boot into Windows, but I can't boot into Ubuntu.
Hmm, your fdisk output looks a little odd to me. It seems to be 2TB, and using an odd system. Can you tell me a bit more about the drive?
talsemgeest
June 18th, 2010, 10:15 PM
Hello,
I upgraded to ubuntu to 10.04 and now unable to load any OS.
I get that error, that no such device and GRUB RESCUE>
thats all. I canīt use a live cd, as have NO CD DRIVE, NO boot from flash, NO floppy.
Any suggestions how manually configure bootloader? Now works only ls and insmod commands as grub rescue is a little bit restricted... even help command not working :)
please answer grub rescue command line experts :)
P.S. before I had win xp+xubuntu and lots of partitions. Probably, too grubs, as I had to choose what I want to load twice :) and now - no possibility to choose at all.... help. :)
I am unsure of any way to fix your problem without booting. Can you perhaps boot over a network?
LocutusSK
June 19th, 2010, 03:58 AM
Hmm, your fdisk output looks a little odd to me. It seems to be 2TB, and using an odd system. Can you tell me a bit more about the drive?
Hi,
It's a 2TB WD Caviar Green WD20EARS. I've let the Ubuntu installation to format it automatically. I didn't format it myself.
Just a guess, could the problem be that this HDD is using the new 4kB sector blocks instead of the usual 512B blocks ??
Thanks.
mistaken
June 19th, 2010, 05:09 AM
I am unsure of any way to fix your problem without booting. Can you perhaps boot over a network?
well, I see there is a choise to boot with removable media, maybe Iĺl try to buy usb stick... maybe it will work,, and have no idea how to boot through network. Is this in bios? or in boot meniu?
mistaken
June 20th, 2010, 02:44 PM
I am unsure of any way to fix your problem without booting. Can you perhaps boot over a network?
thanks for an idea, managed through network. Lucky me, that still have my 15 years PC and a router with a few wires :))
sad, that I first tried with USB :) waisted money :)
Mahogan
June 29th, 2010, 10:58 PM
Will this tutorial instruction work with a triple boot with OSX? It seems that the OSX is slightly different? I've posted a question about my setup here: http://ubuntuforums.org/showthread.php?t=1506128
ikeurb
June 30th, 2010, 11:30 AM
talsemgeest, this is exactly what I needed. Thanks!
Chandler208
July 2nd, 2010, 03:38 AM
I just reinstalled windows 7 on my machine and than i when back and installed ubuntu. I was able to get in to both just fine. Installed all the updates for ubuntu. then i restarted and loaded windows and installed all the updates there than restarted and now i get a blank screen with a flashing dash.
please help. im taking the A+ certification class and i need windows on my laptop but i love ubuntu.
dalesd
July 5th, 2010, 12:27 PM
I've read through (most of) this thread, but I haven't found anything that fits my situation.
I got a new laptop from work, running Windows XP 64-bit. I installed Ubuntu 10.04 onto a SD card from the liveCD. Now when I start up, I get an error: no such device ######### (where ## is the UUID of the SD card.)
Anyway, here's mu fdisk -l
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 320.1 GB, 320072933376 bytes
240 heads, 63 sectors/track, 41345 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5f76d897
Device Boot Start End Blocks Id System
/dev/sda1 * 1 41344 312560608+ 7 HPFS/NTFS
Disk /dev/mmcblk0: 8166 MB, 8166309888 bytes
4 heads, 16 sectors/track, 249216 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000de66b
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 33 236928 7580672 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/mmcblk0p2 236960 249184 391169 5 Extended
Partition 2 does not end on cylinder boundary.
/dev/mmcblk0p5 236961 249184 391168 82 Linux swap / Solaris
So before I mess anything else up, how do I fix this? I guess GRUB got installed on sda, but my intent was to not use grub at all, just pick from the bios which device to boot off of (hard drive or the SD card). Right now I'll take any solution that gets my work computer to boot back into XP.
I think I should do this:
ubuntu@ubuntu:~$ sudo mkdir /media/sdcard
ubuntu@ubuntu:~$ sudo mount /dev/mmcblk0p1 /media/sdcard
sudo grub-install --root-directory=/media/sdcard /dev/sda
Yes? No?
dalesd
July 5th, 2010, 06:49 PM
FYI, I used lilo to restore the mbr to get my Windows boot back. It turns out that this laptop can't boot from the SD card anyway.
methoxyroxy
July 17th, 2010, 10:31 AM
Dear talsemgeest,
I did the makedir /media/ubuntu thing and now my dual boot is not booting at all anymore, i get grub rescue> and from there I'm clueless.
Now when I put the original windows xp and turn the computer on it'll boot my ubuntu 10.04 but I still can't access windows, which was what started all the trouble in the first place.
Here's what Boot Info Script gave me, I really hope you can help me,
Thanks and Greetings from Amsterdam,
Roxy
Boot Info Script 0.55 dated February 15th, 2010
============================= Boot Info Summary: ==============================[/SIZE]
=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #1 for /boot/grub.
=> Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in
partition #1 for /media/sdb1/boot/grub.
=> Windows is installed in the MBR of /dev/sdc
sda1: __________________________________________________ _______________________
File system: ntfs
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sda1 and
looks at sector 271959 of the same hard drive for
core.img, but core.img can not be found at this
location. No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM
sda2: __________________________________________________ _______________________
File system: Extended Partition
Boot sector type: -
Boot sector info:
sda5: __________________________________________________ _______________________
File system: ntfs
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sda5 and
looks at sector 271959 of the same hard drive for
core.img, but core.img can not be found at this
location. According to the info in the boot sector,
sda5 starts at sector 63.
Operating System:
Boot files/dirs:
sdb1: __________________________________________________ _______________________
File system: ext4
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sdb1 and
looks at sector 271959 of the same hard drive for
core.img, but core.img can not be found at this
location.
Operating System: Ubuntu 10.04 LTS
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
sdb2: __________________________________________________ _______________________
File system: Extended Partition
Boot sector type: -
Boot sector info:
sdb5: __________________________________________________ _______________________
File system: swap
Boot sector type: -
Boot sector info:
sdc1: __________________________________________________ _______________________
File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:
=========================== Drive/Partition Info: =============================
Drive: sda ___________________ __________________________________________________ ___
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Partition Boot Start End Size Id System
/dev/sda1 * 63 61,432,559 61,432,497 7 HPFS/NTFS
/dev/sda2 61,432,560 234,420,479 172,987,920 f W95 Ext d (LBA)
/dev/sda5 61,432,623 234,420,479 172,987,857 7 HPFS/NTFS
Drive: sdb ___________________ __________________________________________________ ___
Disk /dev/sdb: 80.1 GB, 80054059008 bytes
255 heads, 63 sectors/track, 9732 cylinders, total 156355584 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Partition Boot Start End Size Id System
/dev/sdb1 63 150,336,269 150,336,207 83 Linux
/dev/sdb2 150,336,270 156,344,579 6,008,310 5 Extended
/dev/sdb5 150,336,333 156,344,579 6,008,247 82 Linux swap / Solaris
Drive: sdc ___________________ __________________________________________________ ___
Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Partition Boot Start End Size Id System
/dev/sdc1 63 312,576,704 312,576,642 7 HPFS/NTFS
blkid -c /dev/null: __________________________________________________ __________
Device UUID TYPE LABEL
/dev/sda1 22EC27A3EC276FE9 ntfs The Falcon-1
/dev/sda2: PTTYPE="dos"
/dev/sda5 E69490B494908927 ntfs The Falcon-3
/dev/sda: PTTYPE="dos"
/dev/sdb1 749b01da-8f28-429a-af94-2695e259f52f ext4
/dev/sdb2: PTTYPE="dos"
/dev/sdb5 a168466b-66ce-4b07-bf5c-fc88b150c14e swap
/dev/sdb: PTTYPE="dos"
/dev/sdc1 FA90895E9089226D ntfs TOUGHDRIVE
/dev/sdc: PTTYPE="dos"
============================ "mount | grep ^/dev output: ===========================
Device Mount_Point Type Options
/dev/sdb1 / ext4 (rw,errors=remount-ro)
/dev/sda1 /media/The Falcon-1 fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)
/dev/sda5 /media/The Falcon-3 fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)
/dev/sdc1 /media/TOUGHDRIVE fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)
/dev/sr0 /media/cdrom0 iso9660 (ro,nosuid,nodev,utf8,user=roxana)
================================ sda1/boot.ini: ================================
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect
=========================== sdb1/boot/grub/grub.cfg: ===========================
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="10"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=20
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
linux /boot/vmlinuz-2.6.32-23-generic root=UUID=749b01da-8f28-429a-af94-2695e259f52f ro quiet splash
initrd /boot/initrd.img-2.6.32-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
echo 'Loading Linux 2.6.32-23-generic ...'
linux /boot/vmlinuz-2.6.32-23-generic root=UUID=749b01da-8f28-429a-af94-2695e259f52f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=749b01da-8f28-429a-af94-2695e259f52f ro quiet splash
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
echo 'Loading Linux 2.6.32-22-generic ...'
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=749b01da-8f28-429a-af94-2695e259f52f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=749b01da-8f28-429a-af94-2695e259f52f ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=749b01da-8f28-429a-af94-2695e259f52f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.31-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
linux /boot/vmlinuz-2.6.31-21-generic root=UUID=749b01da-8f28-429a-af94-2695e259f52f ro quiet splash
initrd /boot/initrd.img-2.6.31-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.31-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
echo 'Loading Linux 2.6.31-21-generic ...'
linux /boot/vmlinuz-2.6.31-21-generic root=UUID=749b01da-8f28-429a-af94-2695e259f52f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.31-21-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 749b01da-8f28-429a-af94-2695e259f52f
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 22ec27a3ec276fe9
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 22ec27a3ec276fe9
drivemap -s (hd0) ${root}
chainloader +1
### END /etc/grub.d/40_custom ###
### END /etc/grub.d/40_custom ###
=============================== sdb1/etc/fstab: ===============================
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sdb1 during installation
UUID=749b01da-8f28-429a-af94-2695e259f52f / ext4 errors=remount-ro 0 1
# swap was on /dev/sdb5 during installation
UUID=a168466b-66ce-4b07-bf5c-fc88b150c14e none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
=================== sdb1: Location of files loaded by Grub: ===================
.1GB: boot/grub/core.img [SIZE=1]
4.2GB: boot/grub/grub.cfg
11.2GB: boot/initrd.img-2.6.31-21-generic
23.7GB: boot/initrd.img-2.6.32-21-generic
.9GB: boot/initrd.img-2.6.32-22-generic
.9GB: boot/initrd.img-2.6.32-23-generic
5.1GB: boot/vmlinuz-2.6.31-21-generic
1.1GB: boot/vmlinuz-2.6.32-21-generic
.9GB: boot/vmlinuz-2.6.32-22-generic
.8GB: boot/vmlinuz-2.6.32-23-generic
.9GB: initrd.img
.9GB: initrd.img.old
.8GB: vmlinuz
.9GB: vmlinuz.old
drs305
July 17th, 2010, 11:29 AM
methoxyroxy,
Welcome to the Ubuntu forums.
It looks like you have some work to do to restore things. Grub 2 is installed in several partitions where it probably shouldn't be, and is looking at the wrong location for its files. In addition, as configured your Windows won't work either.
To get Ubuntu working again, reinstall Grub2 using the LiveCD. Boot to the Desktop, then open a terminal (Applications, Accessories, Terminal).
Run the following command:
sudo mount /dev/sdb1 /mnt
sudo grub-install --root-directory=/mnt /dev/sdb
Note in the second command the location is the device (sdb) and NOT the partition (sdb1).
Once installed, reboot and you should have a working Ubuntu installation. Although Windows will probably be listed in the menu, I don't think it will run. You will have to refer to talsemgeest's original post on how to restore Windows.
By the way, I have taken the liberty to reformat your previous post by adding "code" tags to condense the output of the RESULTS.txt. You generate the tags by pressing the # icon in the post's menu and then paste the contents between the generated tags.
methoxyroxy
July 17th, 2010, 01:23 PM
Thanks so much Drs. for the welcome and the help.
It's really ensuring to know that I'm not alone in this..
I'm burning the CD as I type.. and hopefully fix stuff with the help of your support.
However, since it is when things went wrong for me - I don't know I probably did something wrong though I'm usually very secure in copying commands and such - I'm a bit scared to repeat the stuff talsemgeest posted.. or do you think things were messed up before I entered those commands?
Anyway, is there any possibility that I can go back to Karmic Koala? It's really frustrating to have all these bugs on this computer (I'm at a friends now), at home I'm still running 9.10 and all is doing well.
Well, my cd is finished now, I'll try what you said. Thanks again so much,
Greetz from Holland,
Roxy
also, thanks for reformatting my post.. I didn't know which command to use but was too frustrated to take the time to find out...
Ps*
What do these codes do?
drs305
July 17th, 2010, 01:53 PM
I would recommend you stick to Lucid, as it's a long term support (LTS) version. If you don't like updating, this one will be around for quite a while once you get it set up.
I don't know which "codes" you are referring to. The 'code' blocks in a post just ensure a paste operation doesn't take up too much screen space.
If you are referring to the two commands to reinstall grub, the first one mounts your Ubuntu partition. You must do that so the system can write the files to it. If it was unmounted, sdb1 could not be written to.
The second command writes some code to the MBR, and then installs the grub files on sdb1. The "root-directory" switch tells the installer where to write the files. Since sdb1 is mounted on /mnt, assigning the 'root-directory' to '/mnt' is indirectly telling the system to install them on the sdb1 partition, with sdb1's / folder being the starting point.
methoxyroxy
July 17th, 2010, 02:15 PM
Sorry for being unclear.. I indeed meant the terminal commands you gave..
Thanks so much, it worked perfectly! And glad to have learned more.
I'll try to fix the windows boot now... thumbs crossed :D
*and it worked! Thanks for the help!
cinikal
July 21st, 2010, 05:09 PM
Hi , Alot of posts here hope im not repeating. I have windows xp installed. i loaded ubuntu, then windows xp wouldnt boot. So i followed your steps to "fixboot" and "fixmbr" ...Windows works perfectly again. So how do i get it to open up grub again and give me the option to choose windows or ubuntu? Now i have a windows computer again...](*,) with ubuntu hidden in there somewhere. actually if i put the live cd in it starts to boot then hangs on a black screen with a cursor on the top left.
jbalgrim
July 23rd, 2010, 01:45 PM
hey guys,
Im running Vista and Ubuntu and updated Ubuntu today, and also updated grub. After the update, i could not boot from grub so i removed grub using the Vista cd recovery (did not have any live cd for Ubuntu) and restored Microsoft's boot loader ( using Bootrec.exe/FIXMbr), so my question is: if i use microsoft's boot loader to boot Ubuntu would there be any impending problems? or would i need to install grub again?, though both operating systems are currently booting with microsoft's boot loader.
thanks
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.