Solved

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

Posted on 2011-10-01
21
428 Views
Last Modified: 2012-06-27
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.
0
Comment
Question by:polaatx
  • 9
  • 8
  • 3
  • +1
21 Comments
 
LVL 21

Expert Comment

by:wyliecoyoteuk
ID: 36896005
0
 
LVL 3

Expert Comment

by:John_Arifin
ID: 36896035
Try https://answers.launchpad.net/ubuntu/+source/grub/+question/45845
See The second answer and the rest. Good Luck.
0
 
LVL 35

Expert Comment

by:torimar
ID: 36896143
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.
0
 

Author Comment

by:polaatx
ID: 36920071
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

0
 

Author Comment

by:polaatx
ID: 36920081
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.
0
 
LVL 21

Expert Comment

by:wyliecoyoteuk
ID: 36920614
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.
0
 

Author Comment

by:polaatx
ID: 36945209
wyliecoyoteuk: Parted is installed. but how do I open it? It's not under applications dropdown.
0
 
LVL 35

Expert Comment

by:torimar
ID: 36945278
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.
0
 
LVL 21

Expert Comment

by:wyliecoyoteuk
ID: 36945499
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
0
 

Author Comment

by:polaatx
ID: 36955363
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?
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 35

Expert Comment

by:torimar
ID: 36957249
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

0
 

Author Comment

by:polaatx
ID: 36957387
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.
0
 
LVL 35

Accepted Solution

by:
torimar earned 500 total points
ID: 36957559
Well, this explains it:
Your Windows no longer exists. By determining to have your linux swap reside on the Windows partition, it was deleted and reformatted as Linux/Swap.
Linux cannot use an existing partition as swap space, nor can it share ntfs partitions for that purpose.

I'm very sorry for you, but it isn't Ubuntu's fault.
Installing another operating system is a very invasive procedure; it should never be undertaken lightly without making yourself very well informed about all of the necessary steps and decisions to be taken. Involving existing partitions in that process is an absolute "no-no" if you wish to keep the existing system intact.

ps:
Why are you on a live CD? Does Ubuntu no longer boot?
0
 

Author Comment

by:polaatx
ID: 36957781
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?
0
 
LVL 35

Expert Comment

by:torimar
ID: 36957981
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
0
 
LVL 35

Expert Comment

by:torimar
ID: 36958021
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.
0
 

Author Comment

by:polaatx
ID: 36958177
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 screenshot nautilus
0
 

Author Comment

by:polaatx
ID: 36958280
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 screenshot testdisk
0
 
LVL 35

Expert Comment

by:torimar
ID: 36958559
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.
0
 

Author Comment

by:polaatx
ID: 36958705
Thank you torimar. I am trying to download partedmagic. thanks for all the detailed help.
0
 
LVL 35

Expert Comment

by:torimar
ID: 36958834
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now