Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Recently I installed Windows XP on my machine where I had only Ubuntu. The problem is that I had my /boot on a separate, 200 Mb partition at beginning of the hard-disk (the leftmost). Installing windows, it said that it can't write MBR because there's an unknown partition, so I formatted that partition as NTFS, and I could finally get windows installed. Now I want to restore that partition so I can use my Linux keeping both systems.

Now should I install grub2 there, or it's OK by restoring partition data? If the first is the correct answer then provide me a little tutorial on installing it. Keep in mind that there was my /boot folder.

share|improve this question
    
no imho - in this case what to do if windows was installed and /boot partition was completely deleted –  iugamarian Dec 30 '10 at 7:08
    
Related question: How do I restore a linux boot partition? –  Stefano Palazzo Dec 30 '10 at 8:09
    
I see, just leaving it in here as a point of reference –  Stefano Palazzo Dec 30 '10 at 8:09
add comment

1 Answer

First get a copy of a Windows 98 Startup Disk that has fdisk on it (it will repair the MBR if GRUB has errors see down this text).

You should start the live cd (the same cd as the version installed), chroot into the partition of linux (man chroot) and from there (not sure if it will work):

sudo nano /etc/fstab -> remove the /boot entry

sudo mkdir /boot

sudo apt-get install -y linux grub2

sudo init 6

If this did not work and Windows does not start any more, insert the Windows 98 Startup Disk, boot from it and in the command line do:

fdisk /mbr

share|improve this answer
    
Thanks, I'll give it a try. I guess I should mount first my /sdax (boot partition) first to /boot, right? Also I saw that actually grub2 is a dummy package and the right one is grub-pc. –  s3v3n Dec 30 '10 at 8:19
    
OK, I found the official documentation on how to do this :D help.ubuntu.com/community/Grub2#Reinstalling%20GRUB%202 –  s3v3n Dec 30 '10 at 10:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.