LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I'd like to dual boot my system but need a hand with an unorthodox method (https://www.linuxquestions.org/questions/linux-newbie-8/id-like-to-dual-boot-my-system-but-need-a-hand-with-an-unorthodox-method-613737/)

helptonewbie 01-15-2008 11:03 AM

I'd like to dual boot my system but need a hand with an unorthodox method
 
Hi All,
I've had a computer just die on me and whilst i'm deciding what to do about it i'd like to set-up dual boot. ie, i have my normal Windows computer and a Linux computer (died and the HD is fine!). And i'd like to dual boot so nick the linux HD put into the Windows comp and then i guess i can set the linux hard drive to be primary master and all that and then all i need to do is tell the grub where to boot windows. How can i find the line i need to add to the grub, i know how to edit it and all that just don't know how you know what to type in there so to get windows as a boot option, or is there another way. The Windos i'm running is Windows X64 professonal, is there a simpler way? am i on the right track? and how can i know what line to add into the grub to get windows up as a boot option?

Thanks and Regards
Me

bigrigdriver 01-15-2008 12:21 PM

Edit /boot/grub/menu.lst to add the following:
Code:

title Windows XP
    map (hd0) (hd1)
    map (hd1) (hd0)
    rootnoverify (hd1,0)
    makeactive
    chainloader +1

There are two assumptions here:
a) The windows drive is the slave drive. If it is the master, delete the map lines from the above code, and edit the rootnoverify line to read (hd0,0).
b) Windows is in the first partition of the drive. If not, edit the rootnoverify line to show the correct partition number (start numbering from zero).

helptonewbie 01-17-2008 01:43 PM

Hey, thanks for the input, i can see i've now looked into the grub website etc and found out some stuff there however i'd like to know if its possible to find out in particular what hd? the windows drive is. Is there a way this is possible as i'm able to mount the windows drive fine with /dev/hdb1 but i don't know how to find what hd? number it has if its possible?

Cheers

ps-as it didn't work with the above but i didn't try lots of combinations i'd rather try to get it right without trial and error if possible. Thanks

bigrigdriver 01-17-2008 02:04 PM

Boot a liveCD. Run 'fdisk -l' to get a listing of harddrives, partitions, and fileystem types.

Running the liveCD will also make it possible to mount the Linux drive and edit /boot/grub/menu.lst and /etc/fstab (if necessary) to fit the information you get from fdisk.

jay73 01-17-2008 02:08 PM

Well, mine looks like this:

Quote:

title Windows XP 64 Professional
rootnoverify (hd3,0)
makeactive
map (hd0) (hd3)
map (hd3) (hd0)
chainloader +1
I suspect that you'll simply need to replace 3 with 1.

To make sure: boot your computer, select your Linux boot line, press Enter, select the line that has (hdx,x), press Enter and remove the trailing "x)", then press TAB. That should show which numbers are available. Press ESC to return to the boot line.

helptonewbie 01-17-2008 02:08 PM

cheers, i just run that here's the output, it didn't display the hd? number can i edit the menu.lst and put in map hda1 hdb1? or is that incorrect syntax for grub?

fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
240 heads, 63 sectors/track, 10337 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1137 8595688+ 83 Linux
/dev/hda2 1138 8836 58204440 5 Extended
/dev/hda5 1138 1261 937408+ 82 Linux swap / Solaris
/dev/hda6 1262 3305 15452608+ 83 Linux
/dev/hda7 3306 6095 21092368+ 83 Linux
/dev/hda8 6096 8097 15135088+ 83 Linux
/dev/hda9 8098 8836 5586808+ 83 Linux

Disk /dev/hdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 24320 195350368+ 7 HPFS/NTFS

tahnks

ps- i admit i did't use a boot cd already booted into Linux.

JAY - do you mean e for edit the grub and then remove x) from the boot options line for one of the boot options then tab?

helptonewbie 01-17-2008 02:14 PM

pss - i have tried it the way bigrigdriver said which looks pretty much the same as your method, and did use a hd1

jay73 01-17-2008 02:19 PM

Quote:

JAY - do you mean e for edit the grub and then remove x) from the boot options line for one of the boot options then tab?
Yes, that's what I meant.

PTrenholme 01-17-2008 02:29 PM

It's somewhat easier if you just use the tab-completion feature of the GRUB editor. Just boot and, when GRUB shows you the selection menu, press "e" to start the editor. Then select one of the root (hd lines, delete from the end of the line so it looks like the bold string in this sentence, and press the tab key. That will display all the hard drive numbers visible to GRUB. Pick any one of the displayed numbers, enter it and a comma and press tab again. That will list all the partitions on the drive you selected.

Note that using the GRUB editor does NOT change the GRUB configuration file, just the file copy in GRUB's memory. So an Escape keystroke will discard any changes you made. In other words, you can try anything you want to try out using the editor until you get it to work, and then make the changes you know will work to your configuration file.

helptonewbie 01-17-2008 02:32 PM

Your right Jay, it does tab along once i got it into grub text mode, however it didn't work, for some reason it still producing the error when trying to boot,

A disk read error
press cntrl ++ alt + del to restart

Does it matter in the order the lines exist as you both have the lines in a different order in which case makes me think this shouldn't be an issue?

helptonewbie 01-17-2008 02:34 PM

thanks for the response PTrenholme, it is a cool thing i wasn't aware of, i've done some grub editing before but didn't know this one :-)

jay73 01-17-2008 02:36 PM

The TAB trick is only for checking - it doesn't modify anything. You'd still need to edit grub manually.

And yes, the order can be important but I don't remember whether XP is as picky a some other operating systems.

helptonewbie 01-17-2008 02:41 PM

i'm able to boot what change i made by typing 'b' after editing and thats when the error occurs, i know the disk is fine as i can mount it when booted into linux no problems

helptonewbie 01-17-2008 02:52 PM

the grub manual i just see recommends adding the command boot on the end ie

Code:

title Windows XP 64 Professional
rootnoverify (hd1,0)
makeactive
chainloader +1
map (hd0) (hd1)
map (hd1) (hd0)
boot


helptonewbie 01-17-2008 03:04 PM

I'm still getting that very annoying read error. I've now tried it the following methods:-

title Windows XP 64 Professional
rootnoverify (hd1,0)
makeactive
chainloader +1
map (hd0,0) (hd1,0)
map (hd1,0) (hd0,0)
boot

title Windows XP 64 Professional
map (hd0,0) (hd1,0)
map (hd1,0) (hd0,0)
rootnoverify (hd1,0)
makeactive
chainloader +1
boot

title Windows XP 64 Professional
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
makeactive
chainloader +1

title Windows XP 64 Professional
rootnoverify (hd1,0)
makeactive
chainloader +1
map (hd0) (hd1)
map (hd1) (hd0)

and none of those have worked


All times are GMT -5. The time now is 08:33 AM.