Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Dual-boot xp/Debian two disk setup

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
bluesdog
Posts: 2077
Joined: 2006-02-01 09:02
Location: Similkameen, British Columbia, Canada
Been thanked: 1 time

Dual-boot xp/Debian two disk setup

#1 Post by bluesdog »

How to set up dual boot windows xp, (henceforth referred to simply as xp) and Debian Gnu/Linux, (henceforth referred to simply as Debian), using separate IDE* hard drives for each operating system

Preamble:

Many new or potential Debian users are understandably nervous about possible disruption of their xp installation and data. Installing Debian on a physically separate hard drive, can greatly mitigate their anxiety, and provide a safe, simple way to restore the system to its prior, single-boot xp state.


Assumptions:
  • The target system has xp installed on the master, or primary IDE hard disk. This disk will be referred to as the xp drive.

    The target system has a slave, or secondary IDE hard disk intended for Debian. This disk will be referred to as the Debian drive.

    The target BIOS is configured to boot from CD/DVD first, then fallback to hard disk if no bootable CD/DVD is found

    The user is familiar with the system's basic hardware and BIOS settings, or has access to such information, and is familiar with the system's particular BIOS setup method

    The user is familiar with SOP hardware safety protocols, including disconnecting from the mains power supply, and using proper anti-static grounding procedures.

    The target system is in good working order, and has an adequate power supply capable of powering an additional hard drive

    The user is familiar with, or has access to manuals or other information regarding all system peripherals, including graphics and network cards, audio adaptors, monitors, keyboards, mice etc. Note most cordless mice should be detected during installation, but cordless keyboards often pose difficulty. Use of a standard, ps/2 type wired keyboard during installation is recommended.

    The user has set aside a sensible amount of time to perform the installation procedure, and has an adequate, well-lit working area, tools etc.

    The user has downloaded and prepared Debian installation media, using a recent Etch/Stable release.

    Debian installation has included installing the nano text editor

What is NOT included in this how to:
  • This how to will NOT describe how to install Debian. For installation instructions, please visit the official Debian installation how to, or see other how tos on this forum

    The GRUB bootloader will be installed to the hard drive containing Debian. This how to will NOT cover installation using the LILO bootloader

System preparation and hardware configuration:

Power off and disconnect the system from mains power.

Using standard protocols, including anti-static procedures, move or install the pin jumper on the xp drive to the 'slave' or secondary drive configuration

Similarly, move or install the pin jumper on the Debian drive to the 'master' or primary drive configuration.

On most modern systems, the 80 pin EIDE data cable has three terminals: The blue terminal connects to the IDE socket on the system board, the gray terminal to the 'slave' or secondary hard drive, and the black to the 'master' or primary hard drive.
Although many newer 'smart' hard drives can ignore cable terminal position, it is generally better to follow SOP, and connect the drives according to their designation.

Connect the Debian 'master'/primary drive to the black cable terminal

Connect the xp 'slave'/secondary drive to the gray cable terminal

Note: The paranoid may elect to leave the xp 'slave'/secondary drive disconnected until after Debian has been successfully installed.

Connect the appropriate power cable(s) to the drive(s)

Power up the system, enter the BIOS setup to ensure the system 'sees' the new hard drive as master.


Debian installation and GRUB bootloader modifications:

Load the installation media, and proceed with installation of Debian.

Once Debian is installed, with whatever windows manager you selected, you may now proceed to configure the GRUB bootloader to detect and load MS windows xp when selected at boot

If you have left the xp 'slave'/secondary hard drive disconnected, you may wish to power off the system and connect the xp drive, and restart the system before proceeding

Either from the command line, text interface (cli), or from a 'terminal' within the gui window manager, login as root by typing 'su', then your root password

The command prompt changes from a '$' to a '#'

Note in the following examples, the convention of indicating commands typed as 'root' are illustrated using the '#' symbol. Do not type the symbol, it is already there as part of the command prompt

First make a backup of the /boot/grub/menu.lst script:

Code: Select all

# cp /boot/grub/menu.lst /boot/grub/menu.backup_lst
Now use the nano text editor:

Code: Select all

# nano /boot/grub/menu.lst
Use the keyboard arrow keys to scroll to the bottom of the file, and add the following lines:
title windows xp
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
makeactive
boot
Save your changes by typing <ctrl> <o> <enter>
Exit nano by typing <ctrl> <x>

On subsequent boots, you may now choose 'windows xp' from the GRUB menu


Explanation:

GRUB's mapping feature effectively swaps the 'master'/'slave' identification, allowing xp to act as if it were installed on the 'master' hard drive.


Note: New users may wish to familiarize themselves with the nano editor on non-critical text files prior to editing the /boot/grub/menu.lst script

*Machines with SATA drives are even easier to setup, since the boot order can be changed in BIOS. The procedure is the same, otherwise.
Last edited by bluesdog on 2007-08-17 09:04, edited 4 times in total.
Tips & Tricks

Something more to read while waiting

If you obviously have not read THIS, don't expect too much...




*winter bluesdog....*

thamarok

#2 Post by thamarok »

Thanks! +1!
Very good HOWTO!

plugwash
Posts: 2507
Joined: 2006-09-17 01:10
Contact:

#3 Post by plugwash »

wouldn't it be simpler to just leave the windows drive as master and let grub install to its mbr?

thamarok

#4 Post by thamarok »

plugwash wrote:wouldn't it be simpler to just leave the windows drive as master and let grub install to its mbr?
I guess the other's do it the easy way while others do it the harder way ;)
I guess you mean to install Windows first, then install Linux and configure GRUB to boot Windows and Linux, right? Well, yeah it seems like another approach too.

pilgrim
Posts: 44
Joined: 2007-01-20 00:42

Dual-boot xp/Debian two IDE disk setup

#5 Post by pilgrim »

Bluesdog;

First of all; thanks for the tute. You've obviously been reading my mind. Let me know when you get to the end; I'd like to know how I turn out.

Or have you just been reading my theads?

Being both a newbie and a GNUbie, (i.e a neo-newbie) I'm on a pretty steep learning curve; trying to apply common sense based in the analog world to the virtual binary realm of bits and bytes. Putting aside the question of whether or not computers are the manifestation of the Antichrist (I'm still wavering on that issue), the rationale I've cobbled together for setting up the HDDs with Etch as Master and XP-Home as slave is probably worth being challenged/verified/de-bunked; whichever.

My PC came with XP-Home installed. This OEM version, eMachines T2893, has some distictive characteristics that I have to keep in mind when tinkering.

There are limitations that pertain to what can be done with this XP/OEM installation. There is no "Command Console" written/included in the program and access to the Directory is further interdicted by some code (DoD?) contractually agreed upon between eMach and Microsoft. I understand this practice is not universal among OEM distros, but it is not uncommon.

The upshot of this is that if an important directory file becomes damaged, repair is nigh unto impossible; which distinguishes these OEMs from installtions done from Windows XP-Home CDs purchased at market. "Recovery DVDs" do come with the package, but in the event of a HD crash or even minor divots caused by power outages or inadvertent disconnection of periperal cable jacks, the result can be a nightmare well beyond the skill set of the average desktop camper. The PC would have to get 'benched'.

What this means to me, is that I do not want to mess with the partitioning on the XP HD. Re-partitioning and putting a second OS on it is asking for trouble. I should state, however, the advantage of this architectural stiffness, is that it is very stable and darned near idiot proof;... a big plus for the home DT Camper that shouldn't be depreciated out of hand just because it's Microsoft.

But once the decision is made to migrate to Linux, us linear thinking, analog heads are bound to find leaving XP as the Master HD is, well, aesthetically unsatisfying and contrary to logic. Like dating: its OK to stay friends, but we want to make it clear we've 'moved on'. You know; "Its not you, its me...yada, yada, yada"

This raises a question of hardware and power management. Drives wear out. It would make sense if the XP drive was not running all the time if it is not in use. I am assuming the 'chainload' setup can be configured to achieve this.

Same time: all that extra storage space on the XP disk would be handy for data, photo, music or video storage/backups that can be readily accessed without having to burn disks all the time. That way, if either HD fails, you've got dupes. I am assuming there are protocols/routines for transferring files back and forth between drives/OSs.

Before I make the switch 'per' your tute, I think this would be a good time for me to do a reality check against my 'neo-newbie' rationales and assumptions.
pilgrim

I thimk, therefore I am.

pilgrim
Posts: 44
Joined: 2007-01-20 00:42

..two IDE disk setup login as root

#6 Post by pilgrim »

Bluesdog;

I keep running into a problem logging on as root. I've tried to access the command console using a number of different routes, but when I enter 'su' at login; [Enter] => Password, the cursor sits there blinking but no keyboard entry will register.

I'm convinced there must be a problem with the Etch install or a bug.

I was able to pull up "Shell -Konsole"
"GNU nano 2.0.2 File: boot/grub/menu.1st", somehow (too tedious to rehearse here)
...but when I enter the index you mention, I get the error message:
"Error writing boot/grub/menu.1st No such file or directory".

The other anomaly is that there was nothing on this page requiring scrolling down to the bottom. It was 'tabla rasa'.

But I got my HDDs sorted out... so I'm making some headway; eh? But now I'm really hung up because there is no way to access my Windows HDD; and I need to.
pilgrim

I thimk, therefore I am.

User avatar
bluesdog
Posts: 2077
Joined: 2006-02-01 09:02
Location: Similkameen, British Columbia, Canada
Been thanked: 1 time

#7 Post by bluesdog »

when I enter 'su' at login; [Enter] => Password, the cursor sits there blinking but no keyboard entry will register.
Just to clarify: su is not a login, but a command issued from your user login.

If you are at any time unsure of your user level, type whoami at a terminal

The user-level command prompt in Debian typically ends with '$'
Thus, on my main machine, the user prompt usually looks like this:
[alj@debbie:~]$
If I need to issue a root-level command, I type the shortcut for super user -- su
The system requests the root password.
If it accepts the password, the prompt changes to end with a '#'.
It all looks like this:
[alj@debbie:~]$ su
<enter>
Password:
<enter>
[root@debbie:/home/alj]#
Note the typed password does not echo to the screen.

/boot/grub/menu.lst is most definitely there, otherwise you would not be able to boot into Etch. Note the 'l' in 'lst' is not numeral 'one', but lower case 'L'

Remember to make a backup of your /boot/grub/menu.lst before editing:

Code: Select all

$ su
password:
# cp /boot/grub/menu.lst /boot/grub/menu.backup_lst
If it gets messed up somehow, you'll be able to restore the original by typing mv /boot/grub/menu.backup_lst /boot/grub/menu.lst (probably from a live cd, if /boot/grub/menu.lst is really screwed up!)

To edit the file using nano, first become root/super user, then type nano /boot/grub/menu.lst

Note the comment contained in the file:
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
I generally put the xp stanza after.

Regarding questions from your previous post:
This raises a question of hardware and power management. Drives wear out. It would make sense if the XP drive was not running all the time if it is not in use. I am assuming the 'chainload' setup can be configured to achieve this.
You can possibly setup the system BIOS to 'power down' a hard drive if it is not accessed for a specified time period. In a dual-boot system, only the drive with the currently active OS needs to be spinning; the other would power down shortly after boot.

afaik, 'chainloading' refers to linking to other bootloaders. An 'other' bootloader can be the NTloader, LILO, or even another instance of GRUB. Chainloading therefore has little to do, directly, with hardware and power management.
Same time: all that extra storage space on the XP disk would be handy for data, photo, music or video storage/backups that can be readily accessed without having to burn disks all the time. That way, if either HD fails, you've got dupes. I am assuming there are protocols/routines for transferring files back and forth between drives/OSs.
The extra storage space on the XP drive would, as you say, be handy, and it is now possible for Linux to read and write to NT file system

Code: Select all

# apt-get install ntfs-3g
. Whether it is safe to do so is a whole other question, since this is BETA technology. imo the safest method involves at least separate partitions: data(stuff) and binary(OS/programs), but as you note, partitioning can be hazardous. Many users opt for a shared vfat partition, since both OS can easilty read/write to vfat. In any case, regular backups mitigate disaster. Checkout partimage and tar.

Hope this helps
Tips & Tricks

Something more to read while waiting

If you obviously have not read THIS, don't expect too much...




*winter bluesdog....*

plugwash
Posts: 2507
Joined: 2006-09-17 01:10
Contact:

#8 Post by plugwash »

afaict the author of ntfs-3g heavilly stress tests it and is pretty paraniod about keeping stuff correct/safe.

ultimately without the specs (or given microsofts reputation for documentation quality even with the specs) it will never be possible to know for sure if you have it right or not, but all the evidence so far seems to point to it being so.
The current usability issues and driver limitations should be all documented on the support page. It may be revealing about the high reliability of the NTFS-3G driver that an increasing number of users find hidden hardware faults, and several Microsoft released NTFS bugs during NTFS-3G testing and usage.
assuming he is telling the truth and i have no reason to suspect he is not doing so i'd say thats pretty much as good as it can ever be.

djpython
Posts: 3
Joined: 2012-09-09 19:12

Re: Dual-boot xp/Debian two disk setup

#9 Post by djpython »

Interesting reading blue dog. Though it is a little over my head, it does not surpass my ambitions.
Really, I just want w7 and unix on different disks and I want the system set up so that if one hard disk goes down, I will still have a working computer by just booting into the other drive. Much of the talk I have seen online deals with boot loaders etc..., but what if the code for the boot loader is on the disk that goes down. I gather that I could have a disk or flash drive to run the boot loader, but that goes against my principle of simplicity, and I think it is not secure. I am trying to understand core boot, but don't. Does it go on a flash drive or can it even be written to the PROM?
So I like your presentation style, its sounds comprehensive and reliable. Just let me get it... In the end of your instructions, the debian drive ends up being the true master drive and will contain the boot loader and it own MBR, while the xp drive will be the true slave drive, have its own MBR, but needs to be tricked into thinking it is the master?? Also, there are several other posts about similar goals but none of them mention moving the jumpers. Is that a PATA thing, no longer as widely necessary with SATA?
I think Ill go to my local PC repair shop for the real deal cause its a new computer and I am chasing my tail for a couple days now, but I try anyway because my wizard/guru thinks its good for me to bang my head on stuff.
Thanks for any wizdom yous can come up with for my project.-dj

djpython
Posts: 3
Joined: 2012-09-09 19:12

Re: Dual-boot xp/Debian two disk setup

#10 Post by djpython »

Having two OSs then, it would be cool if you had the back up and restore code for the debian Master on the windows Slave (poetic justice, m i rite) and likewise, visa versa, the normal Windows recovery partition might be placed on the Debian drive. There are normally two more partitions on my windows installations, but I dont know exactly what/how they are. These as well as important Debian drive data could then be backed up on the windows drive. Back ups should be quick and reliable (and cheap) and restoring system as well as data should be simple once you plug a new drive in. Tell me it is so and there is a way.

Esteemed Reader, I would really appreciate whatever light you may shed on this. Or if you want to know more yourself.
Thank You
dj

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Dual-boot xp/Debian two disk setup

#11 Post by dasein »

Would you please stop necro-bumping a 5+ year old thread? :roll:

djpython
Posts: 3
Joined: 2012-09-09 19:12

Re: Dual-boot xp/Debian two disk setup

#12 Post by djpython »

My system is an HP DV7(i7) Windows7 laptop with 2 500 g drives, one of which has not yet been initialized yet.
Thought my context could be helpful.

Post Reply