Link to home
Start Free TrialLog in
Avatar of polaatx
polaatxFlag for United States of America

asked on

How to get dual-boot ability back after installing ubuntu 11.04 and losing windows xp selection.

Hello, on an Acer 3680 laptop  that contained winxp pro sp3, deleted acer's hidden partition, and installed ubuntu 11.04 on 3 new partitions (one for swap, one for root, one for home). Now machine just boots ubuntu and no option to choose windows. I think the new partitions ubuntu created for me went from sda3 to 5, but don't remember exactly. Everything on single internal disk. Did installation from USB flash.

I have read many things about how to get back windows but seems there are many varying circumstances and different methods, including using windows CD or reinstalling Grub.

Could someone please help me figure out best method. The windows partition had a lot expensive software I don't want to lose, although ubuntu will be the OS i will use most of the time.

I am Ubunut newbie. thanks in advance.
Avatar of wyliecoyoteuk
wyliecoyoteuk
Flag of United Kingdom of Great Britain and Northern Ireland image

Try https://answers.launchpad.net/ubuntu/+source/grub/+question/45845
See The second answer and the rest. Good Luck.
Ubuntu should have added Windows by default. To repeat the process of searching and adding the existing operating systems, type

sudo update-grub

Open in new window


then reboot. If your boot menu is long enough to fill the complete screen, scroll down to look for Windows.

If this, again, did not work, there is reason to fear something went wrong when you deleted the Acer partition.
Please type

fdisk -l

Open in new window


(the option is a lowercase 'L') and post the output here.
Avatar of polaatx

ASKER

Hi torimar:

the sudo update-grud didn't do the job.

doing fsik -l  didn't create any output:

 
parinaz@parinaz-3680:~$ fdisk -l
parinaz@parinaz-3680:~$

Open in new window

Avatar of polaatx

ASKER

wyliecoyoteuk: boot-repair looks very impressive. But I am staying in a location of the planet with the worst internet service imaginable. I've been trying to download the 360mb file over and over, leaving the machine on at night, but keep getting broken files.
Hi you could try installing parted using the package manager in Ubuntu, just to see if the partitions are still there, and to find out what their names are.
Avatar of polaatx

ASKER

wyliecoyoteuk: Parted is installed. but how do I open it? It's not under applications dropdown.
In Ubuntu and derivatives, if a command informally "dies" on you without error message, always try it again with a "sudo" prefix:

sudo fdisk -l

Open in new window


(I'm sorry I didn't think of this, but I'm used to working with linux versions that have a proper root account, and then you tend to lose track on which commands may be reserved for administrators only.)

As to GParted: it used to be under the "System" menu with the label "Partition manager" or "Partition editor", but I'm not sure how Gnome 3 or Unity would deal with this nowadays. Both are desktop managers that I refrain from using.
If you are using unity , click the power icon in the top right hand corner, select "system settings" from the menu, and then "disk utility". then you should be able to see which disk is NTFS format
Avatar of polaatx

ASKER

hello,

I am trying this tutorial to install ms-sys. http://www.arsgeek.com/2008/01/15/how-to-fix-your-windows-mbr-with-an-ubuntu-livecd/

I made sure all the repositories are checked in Software Sources.

But when I type in terminal:
sudo apt-get install ms-sys

it says:
E:Couldn't find package ms-sys

Do you know what could be wrong? I did RELOAD the software sources to update its list of all sources. I am connected to the internet

I download ms-sys from herehttp://ms-sys.sourceforge.net/  and put the folder on a USB drive. I can see the folder in Nautilus.

How do I terminal to install ms-sys from the USB drive?
Believe me please: you do not really want to do that!

"Fixing" the MBR will eliminate your linux Grub2 bootloader, which means: no more access to Ubuntu. Only Windows would start - provided that it is still there and healthy. If it isn't, the computer will be unusable and in need of a repair more complicated and time consuming than trying to fix your Grub bootmenu - which is what I'd suggest we attempt first.

On a side note: if you want to fix the MBR, it's easily done with your original XP installation disk issuing the command FIXMBR, like this: http://pcsupport.about.com/od/fixtheproblem/ht/repairmbr.htm

So in order to see what is actually going on on your computer, please give us the following data:

1. - the output of
sudo fdisk -l

Open in new window


2. the contents of the file:
/boot/grub/grub.cfg

Note: if you are having trouble opening the file, use this command in a terminal:
gksudo gedit /boot/grub/grub.cfg

Open in new window

Avatar of polaatx

ASKER

Hello Torimar, thanks for your reply.

Here's the output from fdisk.

Please note: /dev/sda1   *           1        2589    20796111   82  Linux swap / Solaris
is actually where Windows XP is. When installing Ubuntu, i chose that partition as the Swap, thinking it won't hurt since there is plenty of space left on that partition. Now Ubunut apparently thinks that's a Linux partition. But it should be NTFS.

 
ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 30.7 GB, 30735581184 bytes
255 heads, 63 sectors/track, 3736 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: 0x6fdd095d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2589    20796111   82  Linux swap / Solaris
/dev/sda2            2590        3736     9213277+  83  Linux

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 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: 0x71c53a0e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       14593   117218241   83  Linux
ubuntu@ubuntu:~$

Open in new window




And

ubuntu@ubuntu:~$ gksudo gedit /boot/grub/grub.cfg
 
opened up a BLANK gedit page.

Remember I am on LiveCD.
ASKER CERTIFIED SOLUTION
Avatar of torimar
torimar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of polaatx

ASKER

Learned by lesson. Thank you for resolving this finally.

I am on LiveCD because was trying a tutorial. Ubuntu works fine.

Can I install windows now on the partition in question? Please let me know the brief process - would I have to reinstall ubuntu afterward?
If you are the adventurous type, you could try to recover the lost partition. After all, it was only used for swap, and that means not much has actually been overwritten.
You could give Testdisk a try: http://www.cgsecurity.org/wiki/TestDisk
It's in the Ubuntu repos and can be normally installed via "apt-get" like any other program.

Here's a step-by-step howto: http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step
And also consult the last sample on this page: http://www.cgsecurity.org/wiki/Data_Recovery_Examples

But first you should disable the Swap partition inside Ubuntu, so that it continues to work.
Here's how to use the "swapoff" command:
http://techie-buzz.com/foss/ubuntu-enable-disable-swap-partition.html

Do this anyway, even if you wish to re-install Windows.
In that case, re-install to C: drive, afterwards boot with the Ubuntu live CD and reinstall Grub2 via "Boot-Repair" as described here:
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
https://help.ubuntu.com/community/Boot-Repair
Once all done, don't forget to shrink the Ubuntu partition for some 2-4 GB at the end (use the Ubuntu live CD). Format that new partition as Swap.
Inside Ubuntu as booted from your HDD, use GParted (partiton editor) to set the "Swapon" command in that new partition (as explained in the link I gave above).

This isn't really necessary if you have 4 GB or more of RAM. So you might also decide to save yourself the trouble as long as you don't run into performance issues.
Avatar of polaatx

ASKER

Hello,

I just realized that I had setup the /home folder on an external drive, which contained 2.5 gigs of important documents transferred from a windows machine.

That is also gone - correct?

For some reason my ubuntu installation does not show the external drive in Nautilus. See screenshot.
Do you think I coulld recover the contents of that drive too?

Disk /dev/sdb: 120.0 GB, 120034123776 bytes User generated image
Avatar of polaatx

ASKER

Hi Torimar,

Testdisk found the 120gig drive.I selected that drive.

It now asks to select select the partition table type. Linux is not one of the choices. Please see screenshot. which one should I select.

Remember, i chose this drive as my "home" drive User generated image
You would select "Intel" because this is a PC.

But this is getting a bit messy. Your original question of retaining "dual boot ability" has already been answered in the way that you lost dual boot ability by the way you setup your Ubuntu installation.
We are now concerned with data recovery, which should be a new topic.

Please bear in mind that you cannot unformat/recover partitions on a running system without damaging said system. If you want to restore your external drive to what it was before installing Ubuntu, the Ubuntu will lose its /home partition and stop working.
I recommend to use the Parted Magic live CD: www.partedmagic.com
which contains TestDisk, GParted and all other necessary tools readily set up to work out of the box.

If you encounter problems with data recovery or with setting up Ubuntu correctly aside a working Windows, please ask them in a new thread.
Avatar of polaatx

ASKER

Thank you torimar. I am trying to download partedmagic. thanks for all the detailed help.
Thank you.
Please feel free to post a link in here to eventually ensuing questions, and I shall have a look at them if my time permits.