LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Lost dual boot (https://www.linuxquestions.org/questions/linux-newbie-8/lost-dual-boot-919580/)

jznew2linux 12-19-2011 07:14 PM

Lost dual boot
 
Greetings to all,
I finally was able to dedicate my old Dell XPS400 to a Linux/Win xp machine. The XP had issues- as usual- and I decided to turn Linux as I learned. I was able to re-partition the HDD just fine w Ubuntu 11. Everything was working http://static.linuxquestions.org/que...s_lq/icon7.gif Then Xp got so messed up from a previous virus that I re-XN Win XP. When I finished everything in XP, I noticed that I lost my dual boot capability. I checked with G-Parted to verify that all partitions were there and they are, exactly as I set them up. I don't know what I need to do to fix the issue. I was tempted to put in the Ubuntu disc to see if it would see the problem but not sure what I would learn.
My question is what should I do to get ubuntu to show at boot so I can choose which OS to select.

ps- I love the ability in Ubuntu to see & use docs on my xp partition- that is GREAT. I may just dump XP all together soon!

Larry Webb 12-19-2011 07:33 PM

Here is a great tutuorial from ubuntu for restoring your grub by using your ubuntu live cd, They explain two different ways. Either way works fine. Pay attention to Section 12.

grub2

jznew2linux 12-19-2011 07:35 PM

Wow
That was very fast. Thanks Larry, I'll check it out.

okos 12-19-2011 08:16 PM

As Larry Stated, read the link.
Here are the specifics which worked for me:
Quote:

Copy LiveCD Files

This is a quick and simple method of restoring a broken system's GRUB 2 files. The terminal is used for entering commands and the user must know the device name/partition of the installed system (sda1, sdb5, etc). The problem partition is located and mounted from the LiveCD. The files are then copied from the LiveCD libraries to the proper locations and MBR. It requires the least steps and fewer command line entries than the following methods. If for example Windows is on sda1 and Ubuntu is on sda5, and Windows has overwritten the MBR, then the target for grub installation will be /dev/sda5, and the MBR in the boot sector of sda will be re written for grub.

This operation will write to the MBR and restore the modules and core.img to /boot/grub. It will not replace or restore grub.cfg or fix corrupted files.

1. Boot the LiveCD Desktop.
2.

Open a terminal by selecting Applications, Accessories, Terminal from the menu bar.
3.

Determine the partition with the Ubuntu installation. The fdisk option "-l" is a lowercase "L".
1.

sudo fdisk -l

If the user isn't sure of the partition, look for one of the appropriate size or formatting.

Running sudo blkid may provide more information to help locate the proper partition, especially if the partitions are labeled. The device/drive is designated by sdX, with X being the device designation. sda is the first device, sdb is the second, etc. For most users the MBR will be installed to sda, the first drive on their system. The partition is designated by the Y. The first partition is 1, the second is 2. Note the devices and partitions are counted differently.
4. Mount the partition containing the Ubuntu installation.

sudo mount /dev/sdXY /mnt

Example: sudo mount /dev/sda1 Note: If the user has a separate /boot partition, this must be mounted to /mnt/boot Note: If the user has a separate /home partition, this must be mounted to /mnt/home. Encrypted home partitions should work.
5.

Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device.

sudo grub-install --root-directory=/mnt /dev/sdX

Example: sudo grub-install --root-directory=/mnt /dev/sda

In Grub 1.99, introduced with Ubuntu 11.04, Natty Narwhal, a new switch is available which more clearly defines where the grub folder is placed. The command above will still work with Grub 1.99, but the following command is preferred by the developers. The target directory in the command is the command into which the grub folder will be installed. By default, and without the switch, the location is /boot/grub. In these instructions, since the Ubuntu partition is mounted on /mnt, the target would be /mnt/boot/grub.

*

sudo grub-install --boot-directory=/mnt/boot /dev/sdX

Example: sudo grub-install --boot-directory=/mnt/boot/ /dev/sda
* Reboot
*

Refresh the GRUB 2 menu with sudo update-grub
*

If the user wishes to explore why the system failed, refer to Post-Restoration Commands section below.

jznew2linux 12-20-2011 10:45 AM

I'm about to attempt the repair this morning. Thanks to Larry & Okos. I did find this last night which looks simple.
http://blog.sriunplugged.com/2009/04...lling-windows/
I'll let you know how it does. I'm not terminal savvy yet and if I can't copy & paste, then I'm reluctant.

jznew2linux 01-01-2012 12:35 PM

Thanks for everyone's help.
I had to re-xn Ubuntu. Now the Utility has lost all the apps. When looking at add software & xn-ed software, apps are there but not in utility launcher. When I click on it, nothing shows up. I saw something on another site that I'm not the only one it's happened to. Any ideas?

Xandrosdemon 01-01-2012 01:53 PM

I understand being terminal shy, but you wont get better if you try. The main thing is that since the boot option is already an issue this could have/ is a great opportunity to practice with the terminal, as it really couldn't get that much worse.


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