LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Going back to a dual-boot environment: can I do it without reformatting? (https://www.linuxquestions.org/questions/linux-software-2/going-back-to-a-dual-boot-environment-can-i-do-it-without-reformatting-462785/)

The MJ 07-10-2006 08:09 PM

Going back to a dual-boot environment: can I do it without reformatting?
 
I have begun to realize that, while it works perfectly for some things, linux is just not good enough alone. I find myself unable to do many things I wish I could. Cedega just doesn't cut it for gaming, flash 7 just doesn't cut it for games/movies online.

But since I can't stand the idea of using Windows exclusively, I want to go back to dual-booting. Unfortunately, windows overwrites that one part of the hard drive that says to boot linux (I think its called the MBR, but that may be something else).

Backing up to another hard drive and reinstalling later is too expensive to justify. I need something along the lines of:
1. copy my mbr? onto a floppy or something
2. install windows on a new partition
3. put the mbr? back
4. install grub to switch between the two
I do not even know where to begin though, or if its even possible.

How can I keep my linux installation working after installing Windows?

infestator 07-11-2006 03:26 AM

if you have any kind of linux livecd you can fix the problem manualy:
1. install win
2. boot from livecd
3. mount your root partition, proc partition and boot partition in place of mounted root partition, then simply say 'chroot <place_where_you_mounted_root>'
4. use your favourite console editor (vi, nano, etc...) to edit grub.conf (menu.lst) in /boot/grub (or in place your boot partition generaly mounted) and add there two sections for windows:
Code:

title windows
rootnoverify (hd0,0)
makeactive
chainloader  +1

and for linux:
Code:

title  linux
kernel (hd0,1)/<kernel_name-version> root=/dev/hda6

5. enter command:
Code:

# grub-install /dev/hda
6. reboot

(hd0,0) means /dev/hda1, (hd0,1) - /dev/hda2, also (hd1,0) and (hd1,1) mean /dev/hdb1 and hdb2 accordingly. so you should choise right names for (hdx,y) and /dev/hd. if in doubt - you can use fdisk (or cfdisk) to see partition table (and mount them).
if all done right, then two new entries ('linux' and 'windows') should appear in grub menu.

The MJ 07-12-2006 12:19 AM

Perfect, thanks a lot. I will try that out as soon as I get back to my computer.

Thanks
-Max

infestator 07-13-2006 01:58 AM

when you chroot you'll may be need to make 'cp /proc/mounts /etc/mtab' (don't forget to mount proc :))


All times are GMT -5. The time now is 10:22 AM.