LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-22-2007, 10:00 AM   #1
aktar
LQ Newbie
 
Registered: Jun 2007
Posts: 13

Rep: Reputation: 0
Re-installing XP on dual boot system


I originally had Xp alone but later installed Debian as a dual boot. Now I have Xp in /dev/sda1 and Debian on /dev/sda7.
When I installed debian, I chose to install the grub in the Xp drive.

But now I need to re-install xp because of those bloody viruses AGAIN (what a suprise)

If I format /dev/sda1 (c:\) then I loose GRUB, and everything collapses.

WHAT DO I DO???
 
Old 06-22-2007, 10:09 AM   #2
deroB
Member
 
Registered: Dec 2005
Location: Sydney, Australia
Distribution: Arch Linux
Posts: 208

Rep: Reputation: 30
If you don't have one already...get yourself a live-cd and reinstall grub after installing windows.

see here for tips on installing grub:
http://ubuntuforums.org/showthread.php?t=224351
 
Old 06-22-2007, 10:30 AM   #3
aktar
LQ Newbie
 
Registered: Jun 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by deroB
If you don't have one already...get yourself a live-cd and reinstall grub after installing windows.

see here for tips on installing grub:
http://ubuntuforums.org/showthread.php?t=224351

Can I not just move the grub to the debian partition first and format the xp drive?
 
Old 06-22-2007, 10:35 AM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Any Live CD can restore Grub at any time.

If it has Grub then you can activate the Grub shell in a root console and tell Grub to get back to the MBR using Debian from sda7 or (hd0,6) to Grub by commands
Code:
grub
root (hd0,6)
setup (hd0)
quit
reboot
If the Live CD has no Grub support so you can activate a Grub shell you can still restore Grub by its kernel. Again in root terminal
Code:
mkdir /mnt/sda7
mount /dev/sda7 /mnt/sda7
chroot /mnt/sda7
grub-install /dev/sda
exit
reboot
The last one can be done on any Live CD even without the Grub support. The reason is you boot up any Linux kernel (from a Live CD) but change root to Debian. You therefore issue the grub-install command inside its Bash shell. It is a sure-fire universal method and the one to remember if you ever wish to restore grub or Lilo.

When you install XP its installer overwrites the MBR and destroys Grub's stage1 file there. The restoration of Grub is to put its stage1 back into the MBR. All the necessary files are already inside the Debian partition. The command "root" + "setup" in a Grub shell or "grub-install" in Bash shell will make the necessary connection.

Last edited by saikee; 06-22-2007 at 10:38 AM.
 
Old 06-23-2007, 09:56 AM   #5
aktar
LQ Newbie
 
Registered: Jun 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Problem sorted

Thanks guys, great help.
Problem sorted
 
Old 07-26-2007, 04:16 PM   #6
ok4life
LQ Newbie
 
Registered: Oct 2006
Posts: 24

Rep: Reputation: 15
I found this thread when I was preparing my laptop for XP repair install, dual booting Suse SLED 10.0/XP Pro SP2. I ran the repair with a SP2 OEM CD and it never wiped my MBR? I was kinda confused due to that GRUB is the loader hda1 is XP hda6 is / and hda7 is /home with the MBR being on hda1. seemed kinda odd to me but just thought I'd throw it our there for others.
 
Old 07-26-2007, 04:57 PM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Nothing odd about that.

Grub can be installed with a Linux or without a Linux. It can boot from any logical or primary partition that Grub can read.

You can put Grub in a data-only primary and use XP to boot up Grub.

You can use Grub from a Solaris to boot Linux or Windows. The choice is endless.

If your XP installation CD did not wipe Grub then you have not succesfully restored XP's MBR.
 
Old 09-12-2008, 07:32 AM   #8
futoskope
LQ Newbie
 
Registered: Feb 2008
Posts: 8

Rep: Reputation: 0
Re Installing XP on a dual boot system

I m also facing the similar kind of problem...but i did one more mistake...Initially I had Windows XP(SP2) and Scientific Linux 5.1 in my dual boot system...and the default bootloader was grub. Now due to some virus problem I am forced to fomat the NTFS partition where previously windows were and re-installed XP on the same existing partition. I didn't touched any other partition during installation. But I forgot to note down the partition where linux is installed. I have the bootable XP cd and one ubuntu live cd. Is it possible to bring back the previous dual boot state(i mean the boot screen where it prompts for linux or windows..and so on...)without effecting the existing linux in the system? Please refer the solution along with the code also.Please tell me how to see the existing linux partition and where to install grub.

thanks and regards.
 
Old 09-12-2008, 08:58 AM   #9
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,484

Rep: Reputation: 696Reputation: 696Reputation: 696Reputation: 696Reputation: 696Reputation: 696
Use the Ubuntu Live CD, open a terminal and enter: sudo fdisk -l, this should output your partition information and show you where your Linux version is installed.
 
  


Reply

Tags
boot, dual, grub, installing, xp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing dual Boot 98/Linux - WONT 'LILO' Dual Boot !? L1nux3d Linux - Laptop and Netbook 15 02-11-2006 05:36 AM
Problems installing dual boot system ernesto_lelo Linux - Software 2 07-03-2004 02:12 AM
Installing Fedora as a dual-boot to a WindowXP system; can't partition HD E.T.Smith Linux - Newbie 3 02-06-2004 09:14 PM
Newbie needs Mandrake/Win98 dual-HD, dual boot system design help... buddha Linux - Newbie 20 09-04-2003 08:57 PM
Installing RedHat 9 onto an existing Win XP system as dual boot Michael2003 Linux - Newbie 9 07-16-2003 04:50 PM


All times are GMT -5. The time now is 01:53 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration