LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 09-03-2007, 04:42 PM   #1
RagingGoose
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Rep: Reputation: 0
GRUB question Arch Linux/XP


Hello all,

I just recently tried to set up my first dual boot machine (single hdd) and I'm having a bit of difficulty. My ArchLinux distro boots up fine straight out of GRUB but the XP doesn't. I have Grub setup in root (which contains my /boot) and it does set the XP NTFS partition to bootable when I attempt to load windows but GRUB throws error 13 at me telling me it is an unrecognized or unbootable partition. The real hassel is after I attempt to boot XP and fail I have to use a rescue cd everytime to cfdisk and take off the bootflag from the NTFS and put it back on my root partition otherwise it just looks in the NTFS partition and can't find grub to boot into Arch or XP.

fdisk info:

/dev/sda1 is my NTFS windows partition
/dev/sda2 is my root/boot (with boot flag) partition
/dev/sda3 is my swap
/dev/sda4 is my /home

GRUB menu.lst

Code:
#(0) Arch Linux
title Arch Linux
root (hd0,1)
kernel /boot/vmlinuz26 root=/dev/sda2 ro vga=795
initrd /boot/kernel26.img

#(1) Arch Linux
title Arch Backup
root (hd0,1)
kernel /boot/vmlinuz26 root=/dev/sda2 ro vga=795
initrd /boot/kernel26-fallback.img

#(2) Windows
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1
Any help with this would be much appreciated.
 
Old 09-03-2007, 05:19 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,056

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
Sorry, that didn't make a lot of sense to me. Let's see the output from this (from an Arch terminal) - it'll confirm what's in the MBR
Code:
dd if=/dev/sda count=1  2>/dev/null | strings | egrep -i "grub|ntfs"
 
Old 09-03-2007, 05:33 PM   #3
RagingGoose
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: 0
I typed the command you asked after I logged in and I guess it completed the CLI just gave me my next prompt. Is that suppose to be outputting some data to a text file somewhere? Sorry I'm really out of my element at the moment.


Also, to try and simplify the jumble up there, I had an XP installation on my system I shrank the partition down to around 70GB and moved it 10GB away from the start of the drive. I then installed Arch with the /root partition in the 10GB opening at the beginning of the disk. Grub was installed to the root partition so it should be at the beginning of the drive in the MBR. Fdisk shows the sda2 (my root) partition starting at 1 so I'm pretty sure that Grub is in the right place.

Thank you for the help so far sorry I couldn't get your command to work.

EDIT: Quick update I read through your command once more and I changed /dev/sda to /dev/sda2 in your if statement and it output grub, which is where I had planned it to install.

Last edited by RagingGoose; 09-03-2007 at 05:36 PM.
 
Old 09-03-2007, 05:57 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,056

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
What brand of machine is it ??? Try these commands
Code:
dd if=/dev/sda count=1  | hexdump -C | less
fdisk -l
This will be a fair bit, but let's see it anyway. BTW that's a lower case ell, as in list.
 
Old 09-03-2007, 06:17 PM   #5
RagingGoose
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: 0
It's a custom machine I built. It has been running just Arch for the past few months but I need XP on it for some of my new college classes.

Anyway the results you asked for are:

Code:
1+0 records in
1+0 records out
512 bytes (512 B) copied, 1.4594e-05 s, 35.1 MB/s
fdisk: No such file or directory
-l: No such file or directory
I think the less threw off the fdisk part. I only have files from the Base install on the system right now. Anyway a normal fdisk -l reports
Code:
Disk /dev/sda: 150.0GB, 150039945216 bytes
255 heads, 63 sectors/track, 18241 cylinders
Units = cylinders of 16065 * 512 = 8225280 byte

Device    | Boot | Start | End   | Blocks    | ID | System

/dev/sda1 |      | 1276  | 10199 | 71682030  | 7  | HPFS/NTFS
/dev/sda2 | *    | 1     | 1275  | 10241406  | 83 | Linux
/dev/sda3 |      | 10200 | 10448 | 2000092+  | 82 | Linux swap / Solaris
/dev/sda4 |      | 10449 | 18241 | 62597272+ | 83 | Linux
Sorry about the weird formatting I'm typing this up on a laptop until I can get this fixed.
 
Old 09-03-2007, 07:54 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Those two lines were separate commands...

Since you can boot into Arch, I'm assuming that you put GRUB in the MBR and not the boot sector of the Arch partition. OR: Were you getting to Arch by setting the boot flag?

Normally, you want GRUB in the MBR, and the Windows partition marked active. Your menu.lst looks correct for that configuration. (except I think you need to add "boot" as the last line of the Windows entry

To put GRUB in the MBR:

grub
root (hd0,1)
setup (hd0)
 
Old 09-03-2007, 08:44 PM   #7
RagingGoose
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: 0
I followed your commands pixellany and installed Grub to the MBR and it did its thing no problem. I also added the "boot" to the last line of my Windows section. I still am able to load GRUB and boot into arch fine but GRUB gives me an error code 13 when I try to boot into the Win XP.

The bootflag is set for /dev/sda2 which is where I have Grub installed at as part of my ArchLinux /root partition. I don't have a seperate /boot partition it is included into the /dev/sda2 partition. I'm thinking maybe something is wrong with the partition that is holding my Win XP (sda1) or maybe I'm missing something in my Grub menu but I have cross checked it against several tutorials.

I just wanted to thank you both again for your time. If nothing comes to mind tonight I might just redo the installs tommarrow and maybe find a step I missed or something.
 
Old 09-04-2007, 01:18 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
You probably need to set the boot flag on the Windows partition. It does NOT need to be set for Linux.

You may have GRUB in the bootsector of the Linux partition, but--since it is now in the MBR--the one in the bootsector is not used.
 
Old 09-04-2007, 10:54 AM   #9
RagingGoose
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: 0
I managed to get it working this morning.

I booted into the XP recovery console and used "FIXMBR" to re-write grub temporarily and see if my XP would boot on its own which it could not.

I then went back into the recovery console and did a "FIXBOOT" to re-write windows boot.ini. This allowed windows to boot up.

Lastly I just reinstalled Grub to the MBR with a linux boot cd following Pixellany's instructions.

I just wanted to post a follow up in case anyone searches up this topic with a similar problem. Thanks for the help all.
 
Old 09-04-2007, 07:09 PM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
And thank YOU for sticking with it---LQ should be giving out prizes to members who actually follow-up, say thank you, etc.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
HP Pavillion dv9000 arch question SeanInSeattle Linux - Laptop and Netbook 4 08-25-2007 11:41 AM
FC6 SMP Arch Question cuco76 Fedora 1 12-12-2006 11:52 AM
Stuck at grub config for Arch Linux DeadPenguin Linux - Newbie 1 11-14-2004 02:34 AM
{version} and {arch} question. zer01 Linux - Newbie 1 06-06-2004 02:13 PM
Installing Arch--bootloader killed my Grub busbarn Linux - Software 4 03-13-2004 11:34 PM


All times are GMT -5. The time now is 06:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration