LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
LinkBack Search this Thread
Old 07-29-2006, 10:40 PM   #1
yubyub
Newbie
 
Registered: Jul 2006
Posts: 0

Rep: Reputation: 0
Windows Overwrites the linux boot sector when i install it


whenever i install windoes in a comuter with linux installed i overwrits the linux and makes linux unacssesable
can someone plese tell me what to do
 
Old 07-29-2006, 10:43 PM   #2
AAnarchYY
Member
 
Registered: Sep 2004
Location: Carlisle, MA
Distribution: Slackware 10.2 Fluxbox 2.6.17.6
Posts: 419

Rep: Reputation: 30
thats just what windoze does, you will need to configre a bootloader(lilo,grub) to give you a choice, i belive that has been covered.
 
Old 07-29-2006, 11:00 PM   #3
konsolebox
Senior Member
 
Registered: Oct 2005
Location: Philippines
Distribution: Gentoo, Slackware, LFS
Posts: 1,526
Blog Entries: 5

Rep: Reputation: 98
in simplest ways, boot to your livecd then do 'mount /dev/hdaX /mnt/anydir; chroot /mnt/anydir /bin/bash' then reinstall grub or lilo there

Edit: check out this thread: http://www.linuxquestions.org/questi...d.php?t=319076

Last edited by konsolebox; 07-29-2006 at 11:07 PM.
 
Old 07-30-2006, 09:03 PM   #4
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 112Reputation: 112
Windows will overwrite your master boot record. You can't stop it from doing this. After it overwrites your mbr, you can't access anything but Windows.

But with a bit of preparation you can protect yourself. The easiest way is to use the dd command in linux to make a backup of your mbr.

Thus, if your boot drive is hda, you enter this line:

dd if=/dev/hda of=~/bootblockbackup.bin bs=512 count=1

This will copy your mbr to a file called bootblockbackup.bin in your home directory.

Now install windows.

Then, use a Linux boot floppy, or a live CD to start Linux. Go to your home directory and type in this command:

dd if=bootblockbackup.sh of=/dev/hda

This will rewrite your bootblock to the way it was before. Now your problem is that you won't be able to access Windows.

If you are using lilo, I don't know how you fix that. I use grub and in grub you would go to your /boot/grub directory and add lines like this to the file menu.lst:
Code:
title Windows
root (hd0,0)
chainloader +1
These lines assume that your Windows is on drive 0 (hda) partition 0 (hda1). If Windows is someplace else, modify the root line accordingly.
 
Old 07-30-2006, 09:37 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 10,447

Rep: Reputation: 622Reputation: 622Reputation: 622Reputation: 622Reputation: 622Reputation: 622
Peronally I reckon the re-install of the loader is a better option.
If you happen to allocate new (or change) partitions during the 'doze install, you really wouldn't want to be restoring that first sector.
 
Old 08-04-2006, 10:47 AM   #6
anubis26
Member
 
Registered: Jan 2005
Location: Somewhere in the Central Timezone
Distribution: Suse 10.0
Posts: 128

Rep: Reputation: 15
Usually when setting up a configuration like that, I try to install windows before linux, then everything is OK.
 
Old 08-04-2006, 09:43 PM   #7
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416

Rep: Reputation: 30
Way I do it is to have a grub floppy disk lying around, if you use grub there should be a "grub-floppy" command somewhere (usually in sbin directories).

Code:
grub-floppy /dev/fd0
will create the disk for you.

Now boot the computer with the disk. In this example /boot/grub is on (hd0,0).

Once you are at the grub prompt:

Code:
root (hd0,0)
setup (hd0,0)
The loader will be installed and configured as before, at this point you need to add entries for windows in menu.lst or grub.conf.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can't install lilo to boot sector or MBR or floppy? kazuya1977 Slackware 15 02-13-2006 11:31 AM
Windows installation erased linux boot sector? xelt Linux - General 5 05-01-2005 01:35 PM
Add Fedora to Windows Boot Sector? alexgsummer Fedora 11 02-26-2005 09:16 AM
How to grub-install to the 1st sector of /boot? subaruwrx Linux - General 2 09-23-2004 01:52 PM
Win XP Install Overwrites MBR and Linux Rescue Fails to Recognize Linux Partitions carrlane Linux - Software 8 01-14-2004 07:49 AM


All times are GMT -5. The time now is 06:02 PM.

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
Open Source Consulting | Domain Registration