LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-13-2012, 04:42 PM   #1
bonanz
LQ Newbie
 
Registered: May 2012
Posts: 7

Rep: Reputation: Disabled
xp and 7 dual boot currently - replace xp with linux? don't harm 7


my desktop has dual boot of xp and 7 with xp boot manager controlling which gets booted.

I never use the xp partition anymore and it was forever-ago that I set this up or done anything messing around with dual booting etc. I'd like to use linux more on my desktop, but I don't want to touch my 7 partition. I'd like to use the get rid of the xp and replace it with some flavor of linux (prob arch) and leave my 7 as is.

I'm unsure of how to proceed seeing as I really don't want to disrupt/harm my 7 install, but the boot manager is xp and I'm a noob about setting up linux. my laptop is dual ubuntu and 7 with grub managing boot, but i set that up even longer ago and don't remember what i did, but i remember having to do something weird because of how win7 and grub being weird or something.

the worry of hosing up my 7 install freezes me from starting...any guidance would be greatly appreciated.
 
Old 06-13-2012, 05:32 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,077

Rep: Reputation: Disabled
I suppose that xp's boot loader is on the master boot record or MBR.

If that is the case you just have to put your Linux' boot loader on your Linux root partition. This will left your MBR untouched.

With lilo that's a matter of:
- checking your partition's names and usage
- choose which will be your Linux root partition and make it bootable with cfdisk or fdisk
- make all other partitions not bootable
- tell lilo to put the boot loader on your Linux root partition.

For instance if /dev/sda3 is your Linux root partition you will include following line:
Code:
boot = /dev/sda3
in the global section of /etc/lilo.conf before running lilo.

This assume that /etc/fstab include following line:
Code:
/dev/sda3        /                ext4        defaults         1   1
If your root partition's filesystem is not ext4, adapt accordingly.

I don't know grub but I suppose that you can do something similar with it.

Of course at time of Linux installation you will have make sure not to format your W7 partitions.

If really you are a noob in setting up linux I'm not sure that arch be the best choice, unless you accept to make a lot of reading before installing it. I can be wrong on that though and hope that this remark won't trigger another flame war

Last edited by Didier Spaier; 06-13-2012 at 05:42 PM.
 
Old 06-13-2012, 05:49 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,568

Rep: Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499
You haven't given any detailed information so it's hard to make suggestions. I assume you manually configured the xp bootloader and edited the boot.ini file to create an entry for windows 7 after you installed, is that correct? Windows bootloaders are backward compatible but you will find at windows sites that you are always instructed to install the newer system last so the older system is detected. If you are not going to be using xp any longer, you will need to put windows 7 bootloader in the mbr. Apparently, there is some boot repair option with windows 7, either in the installation or on the installation DVD. You could try googling reinstalling windows 7 to mbr.

After that you will just need to get partition information for your hard drive to see which partition(s) windows is on so you don't accidentally install Linux to the same partition. You might also check your windows 7 partition to make sure the boot files are there and to verify that it is on a primary partition. You will then have the option to install Grub to the mbr for your Linux and it should create an entry for windows 7. If you want to boot from the windows 7 bootloader, you will need to manually configure or use something like EasyBCD.

You might google bootinfoscript, read the instructions and download it and run it after you have picked a Linux distro. You could do this from any Linux Live CD. This will give you a lot of information on drives/partitions and boot files.
 
Old 06-13-2012, 06:56 PM   #4
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
It does not matter where you will install GRUB loader, at MBR or root partition. Anyway GRUB will found and add existing Windows installation into his boot menu.
If you not sure, just save your MBR backup before. You can boot from any linux liveCD and do this to get backup of your MBR:
dd if=/dev/sdX of=/path/to/where/store/it/mbr.backup bs=512 count=1
If something go wrong you can restore you MBR (and old windows boot menu) in this manner:
dd if=/path/to/where/store/it/mbr.backup of=/dev/sdX bs=512 count=1

These commands must be run as root (su or sudo). sdX must be replaced with correct value. You can get it by running (also as root):
fdisk -l
This command shows partitions list for all harddrives installed in your pc. It will be something like sda or sdb. Just 3 letters, without digit appended. It's important.
Also /path/to/where/store/it/ must be the safe place that wouldn't be formatted during installation (may be flash drive or existing win7 partition. For example: /dev/sdc1/mbr.backup
 
Old 06-13-2012, 10:49 PM   #5
bonanz
LQ Newbie
 
Registered: May 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
sorry i think its actually the win7 boot loader, when i boot it says "7" or "earlier version" of windows are my options.

thanks for the easybcd suggestion, i looked into that a little. seems lie i should just wipe the xp partition to unallocated space using win7 computer management (disk management) so I'll have my win7 partition, then the leftover allocated space, then proceed with a linux install in the unallocated space.

I want to use arch to get more experience learning command line and building up a custom system, not so much user friendly stuff. I've used arch before, but i just installed it on a whole disk and used the "auto" partition option during setup.

maybe this is better served in the arch forum, but does anyone know how arch will do the boot loader for a custom partition option during install? will it install grub over windows mbr? I can't remember if it gives you the option of where to install grub, but if I just keep it on that linux partition, couldn't i complete the install, then when i boot, the pc should just go right into windows 7 like there was no linux partition, then i can use the easybcd to overwrite the mbr with win7 boot loader with a linux option (that i'd assume it could recognize if i've already installed arch in the unallocated space)?

if I just let grub rip on the mbr, it should be able to tell there's a win7 partition and add that as a boot option no?
 
Old 06-14-2012, 12:52 AM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
With wins 7 installed to most likely partition sda3 you may have to use a wins recovery disk because when you remove wins xp the partition numbers will change.
Use a linux live cd & postoutput of
Quote:
fdisk -l

Last edited by EDDY1; 06-14-2012 at 12:53 AM.
 
Old 06-14-2012, 01:24 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
It actually matters quite a lot what you choose to do. It is *not* just a matter of which loader code is in the MBR.
If you wipe out the XP partition, you will (very) likely not be able to boot Win7 at all. M$oft update the "current" boot partition when "dual-boot" installing a later system.

Go here, do as it says and post the RESULTS.txt it generates. That way we can see all the boot architecture, and save the guesswork.
 
Old 06-16-2012, 02:56 AM   #8
bonanz
LQ Newbie
 
Registered: May 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
here's the results of the boot info script

Code:
                                                                     
                                                                     
                                                                     
                                             
                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 => Windows is installed in the MBR of /dev/sda.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows XP
    Boot files:        /boot.ini /bootmgr /Boot/BCD /ntldr /NTDETECT.COM

sda2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /Windows/System32/winload.exe

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *             63   168,007,769   168,007,707   7 NTFS / exFAT / HPFS
/dev/sda2         168,007,770 1,889,243,999 1,721,236,230   7 NTFS / exFAT / HPFS


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/cloop0                                             iso9660    KNOPPIX_FS
/dev/sda1        FA50196B50192FBD                       ntfs       
/dev/sda2        1AB939505F833102                       ntfs       
/dev/sr0                                                iso9660    KNOPPIX
/dev/zram0       92f8eaab-b191-4649-a728-a5171e25f388   swap       

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/cloop       /KNOPPIX                 iso9660    (ro,relatime)
/dev/sr0         /mnt-system              iso9660    (ro,relatime)


================================ sda1/boot.ini: ================================

--------------------------------------------------------------------------------
;
;Warning: Boot.ini is used on Windows XP and earlier operating systems.
;Warning: Use BCDEDIT.exe to modify Windows Vista boot options.
;
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Professional x64 Edition" /NOEXECUTE=OPTIN /FASTDETECT
--------------------------------------------------------------------------------

========= Devices which don't seem to have a corresponding hard drive: =========

sdb sdc sdd sde sdf sdg sdh 

=============================== StdErr Messages: ===============================

  No volume groups found
mdadm: No arrays found in config file or automatically
 
Old 06-16-2012, 03:14 AM   #9
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Either system you choose to delete you will have to repair.
If windows 7 is on sda2 & you delete sda1, sda2 will become sda1 meaning that windows 7 will not be mapped the same.
you can probably use windows disk to repair, but in my case I had to do a repair installation which b acks up your files but then you'll have to restore them yourself.
 
Old 06-16-2012, 03:28 AM   #10
Inkit
Member
 
Registered: Feb 2011
Location: India
Distribution: Mint 10
Posts: 142

Rep: Reputation: 15
I haven't used arch before so cannot comment on it, but why don't you first try something that comes with a very good installer like Ubuntu or Mint. I've used both and the installer is very good and you don't have to do much. Just run it and as long as you choose the right partition to install, everything will go smoothly.
The mint installer for example (a slightly older version because I don't use the current one, but I don't think they've changed it much) first asks you to choose which partition you want to install in. You then choose where to install grub (it's mostly /dev/sda) and will overwrite your windows MBR.
This is however not an issue because grub will find and add your win7 install to it.
Just make sure that you choose your XP partition because the installation will overwrite whatever is existing in the partition. apart from that there's very little to do and almost zero errors.
Just to be on the safe side, clone your current win7 install so you'll have a backup.
 
Old 06-16-2012, 03:32 AM   #11
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Even if the OP uses the installer the fraction of a second that it takes to delete sda1 or C It will change sda2 or D to sda1, displacing windows7.
 
Old 06-16-2012, 05:03 AM   #12
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by EDDY1 View Post
Even if the OP uses the installer the fraction of a second that it takes to delete sda1 or C It will change sda2 or D to sda1, displacing windows7.
Is it really necessary to delete partition? OP can install linux without deleting any partitions, just using existing sda1 as root for installing linux. Of course sda1 must be formatted as ext3 or ext4.
There is no need to change the partitions order.
Just shrink sda2 for new swap area. It can be done with existing win7 tools.
 
Old 06-16-2012, 05:10 AM   #13
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Also the best thing OP can do is the full disk backup. Of course, it may take a lot of time and free external disk space.
 
Old 06-16-2012, 05:32 AM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Note that the BCD is in the XP partition - even though XP never knew of a BCD.
I'm sure you could delete/erase the XP partition and rebuild the BCD into the Win7 partition, but you'd need to ensure this was done and bootable prior to installing a Linux into /dev/sda1.
I've not tested this - and am not inclined to, as I have little to do with Windoze these days.
 
Old 06-16-2012, 01:33 PM   #15
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I just had a thought!
If you have another computer or an external drive, you can save an image of windows7 partition using clonezilla install your linux system & then restore wins7 to sda2.
After restoration go back to linux & update-grub.
 
  


Reply



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
Want to replace Vista with XP/Linux dual-boot darksyde Linux - Newbie 7 01-01-2009 01:15 PM
tip: don't buy Biostar TF720 A2+ mobo for Win/Linux dual boot newbiesforever General 8 12-18-2008 05:12 PM
replace one distro with an other on dual boot system without... lleb Linux - General 4 09-06-2006 11:58 PM
Dual boot with Linux, need help! so i don't loose orginal windoz mr_coffee Linux - Newbie 13 01-05-2006 04:09 PM
Boot Sector on dual boot PC. Remove Mandrake and replace with FreeBSD Phin666 *BSD 1 10-30-2004 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:26 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
Open Source Consulting | Domain Registration