LinuxQuestions.org
Visit Jeremy's Blog.
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 07-23-2008, 10:00 PM   #1
Druegan
LQ Newbie
 
Registered: Jul 2008
Posts: 1

Rep: Reputation: 0
Question How to overwrite old Windows XP bootloader?


Hi.. totally clueless Linux newbie here, please be patient.

Previously I had been running a copy of Windows XP Pro on this box.. I got it hosed up but good with a virus/spyware infestation.. but I recovered the data I needed to other drives.

I decided, instead of reinstalling XP, to install the latest Kubuntu distro instead. I want to be Microsoft Free.

Unfortunately, I was not wise enough in the ways of The Great Migration to thoroughlly wipe the drive before installing Kubuntu.. And the Kubuntu installer program for some reason didn't overwrite the original Windows XP Bootloader..

So here I am, using the Kubuntu Live Cd bit.. with Kubuntu installed on my hard drive.... and accessible, I might add, but only if I go through the Live CD's option of "boot from the first hard disk".. Attempting to boot into Kubuntu with no CD in the drive brings about a failure message from the original XP bootloader.

Can anyone out there perhaps clue me in (in very newbish terms) how to make the XP bootloader go away and nestle GRUB in its new home properly?

I've tried googling for this one.. but I keep getting thousands of hits relating to dual booting with xp... I just want my Kubuntu!

Thanks in advance,
Drue
 
Old 07-23-2008, 10:25 PM   #2
bcwagne
Member
 
Registered: Feb 2008
Distribution: Debian Testing, OSX
Posts: 164

Rep: Reputation: 32
You should be able to install grub from the live cd by either chrooting into the drive where you installed linux, and running grub-install (see the man page for grub), or by running grub-install directly from the live environment.

You may also be able to just do dpkg-reconfigure grub, but I'm not sure that would work from the live cd. Again, you may have to chroot into your linux install (see the man page for chroot).

Good luck.
 
Old 07-23-2008, 10:30 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Welcome to LQ!!
(And thank you for asking a relatively easy question....)

Boot into Kubuntu as you described, open a terminal and do as follows:

su <<to take on root powers>>
fdisk -l <<to confirm the device ID of your Linux partition. If you did a simple install, you'll have one partition mounted at / (aka root), and one for swap.
Let's assume that Linux is on hda1 (or maybe sda1). To GRUB, this is hd0,0>>

grub <<opens the GRUB shell>>
root (hd0,0) <<tells GRUB where to find it's files>>
setup (hd0)

Now we need to setup the GRUB config file (menu.lst)
cd /boot
note the name of the kernel file (vmlinuz--something**) and the initrd file**.
cd grub
nano menu.lst

Make (or edit) an entry to read as follows:

title kubuntu
root (hd0,0)
kernel /boot/vmlinuz-something root=/dev/hda1 <<or sda1---see earlier>>
initrd /boot/initrd-something

re-boot and everything should work.

** What I typically do is to alias these files so that I don't have to remember their exact names.
Like so:

ln -s vmlinuz* vmlinuz
ln -s initrd* initrd

Post back if you get stuck somewhere----and/or look at the booting link in my sig. below.
 
  


Reply


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
Windows 2000 Bootloader vs. Mandriva LILO Bootloader Dregnan Mandriva 7 12-03-2007 09:55 PM
Windows 2000 *didn't* overwrite the MBR vharishankar General 5 12-13-2006 08:30 PM
FreeBSD bootloader, overwrite with lilo Oxagast Linux - Software 1 01-13-2006 02:18 AM
MS Windows overwrite the boot loader shadow11 Linux - General 5 12-09-2004 09:49 PM
Oops, I let my new windows install overwrite my FC2 bootloader on the MBR... mono Fedora 1 08-03-2004 08:02 PM


All times are GMT -5. The time now is 11:56 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration