LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-07-2004, 12:29 PM   #1
krazibon3
LQ Newbie
 
Registered: Aug 2004
Posts: 15

Rep: Reputation: 0
grub, sata detection and device.map to boot win xp


i'm currently trying to get grub to boot win xp located on my sata hd, but i don't know how to get linux to detect my sata drive. The reason why it didn't detect it in the first place because i unplugged my SATA hd before i installed FC2 on my IDE hd.

Using fdisk -l i have:

**************************************************************************************************

Disk /dev/hda: 13.6 GB, 13676544000 bytes
255 heads, 63 sectors/track, 1662 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 1532 12201367+ 83 Linux
/dev/hda3 1533 1662 1044225 82 Linux swap

Disk /dev/hdb: 8455 MB, 8455200768 bytes
16 heads, 63 sectors/track, 16383 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb4 * 1 1 0 0 Empty
Partition 4 does not end on cylinder boundary.

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 4865 39078081 c W95 FAT32 (LBA)
/dev/sda2 4866 9729 39070080 f W95 Ext'd (LBA)
/dev/sda5 4866 9729 39070048+ b W95 FAT32

***************************************************************************************************

in my /boot/grub/device.map i have:

***************************************************************************************************
(fd0) /dev/fd0
(hd0) /dev/hda

**************************************************************************************************

Now i've plugged my SATA back and i'm trying to get linux to detect it so i can edit my grub.conf to boot windows XP. I've tried editing the device.map by adding the line >> (hd1) /dev/sda but that trick didn't work =(. Any ideas on how to do i go about this?
 
Old 09-22-2004, 08:52 AM   #2
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 17
Posts: 5,298

Rep: Reputation: Disabled
ignore grub for the moment.

Either edit your /etc/fstab to mount your windows at boot or better still see if you can mount it manually


open a terminal and type su to get root password then
create a directory under /mnt so its /mnt/xp
then mount xp partition under /mnt/xp the see if you can view its contents

commands
su
password
mkdir /mnt/xp
mount -t ntfs /dev/sda /mnt/xp
cd /mnt/xp
ls
 
Old 09-23-2004, 08:35 AM   #3
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 17
Posts: 5,298

Rep: Reputation: Disabled
I was hoping you may have responded but anyhow lets assume you can manually mount

1) edit your /etc/fstab file to add the line for Xp try

/dev/sda /mnt/xp ntfs ro 0 0
where ro means read only so we can't overwrite or delete with out a manual command to protect the innocent?

2) now for the grub

A) Since you already know about device.map......well done by the way

add last line

(hd1) /dev/sda

B) now edit your /boot/menu.lst or maybe if you have no such file its /etc/grub.conf

add new entry rename title if you prefer

title XP
rootnoverify (hd1,1) # your xp boot partition
hide (hd0,0) # your linux boot paritiion
hide (hd0,1) #as I did not ask which was your /boot and just to be paranoid
unhide (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1) # trick windows into thinking its C drive is first drive first partition
makeactive # if windows was not bootable make it so
chainloader +1 # use windows boot loader
boot # go ahead make my day

please report back if success or failure to help others please

Last edited by aus9; 09-23-2004 at 09:07 PM.
 
Old 10-29-2004, 04:00 PM   #4
ahildoer
LQ Newbie
 
Registered: Oct 2003
Location: Florida
Distribution: FC4 and Ubuntu and Knoppix
Posts: 8

Rep: Reputation: 0
aus9,

I have a similar setup to krazibon3.

/dev/hda1 - /boot
/dev/hda2 - /

/dev/hdb1 - m:\ (fat32)

/dev/hde1 - c:\ (winxp ntfs filesystem) (sata)

I modified your directions to get grub to boot windows as well. Here is my grub.conf:

[root@laslo root]# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda2
# initrd /initrd-version.img
#boot=/dev/hda1
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.6.8-1.521)
root (hd0,0)
kernel /vmlinuz-2.6.8-1.521 ro root=LABEL=/ vga=791 rhgb quiet
initrd /initrd-2.6.8-1.521.img
title Windows XP
rootnoverify (hd2,0) # your xp boot partition
unhide (hd2,0)
map (hd2) (hd0)
map (hd0) (hd2) # trick windows into thinking its C drive is first drive first partition
makeactive # if windows was not bootable make it so
chainloader +1 # use windows boot loader
boot # go ahead make my day



The first time I booted windows it worked fine. When i rebooted the computer, GRUB would not load. Got an Error 17. I had to boot off the Federoa Core 2 CD 1 and do a linux rescue. Assuming my MBR was hosed, I tried to re-install grub manually like so:

$ grub
grub> root (hd0,0) # This is where it fails, saying unknown filesystem
grub> setup (hd0)

So, I get into fdisk

$ fdisk /dev/hda
: p

Disk /dev/hda: 40.0 GB, 40025947648 bytes
16 heads, 63 sectors/track, 77555 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 203 102280+ 93 Amoeba
/dev/hda2 204 36774 18431784 93 Amoeba
/dev/hda3 36775 38854 1048320 82 Linux swap
/dev/hda4 38855 77555 19505304 83 Linux


Notice how /dev/hda1 and /dev/hda2 are both 93 Amoeba and not 83 Linux
So i reset them and save:
: t
: 1
: 83
: t
: 2
: 83
: w

Then I go back in grub and it installs on the MBR no problem. I reboot and linux boots fine.
I tried rebooting windows again, and again it gets hosed. After fixing everything again i try something new. I had set in my bios (gigabyte GA-7VT600 1394) for sata to show up as 'ide' and not 'raid'. Tried windows again, no new changes to grub.conf yet. Now when i choose windows, i get black screen with white text showing this :

rootnoverify (hd2,0) # your xp boot partition
unhide (hd2,0)
map (hd2) (hd0)
map (hd0) (hd2) # trick windows into thinking its C drive is first drive first partition
makeactive # if windows was not bootable make it so
chainloader +1 # use windows boot loader
boot # go ahead make my day

then it hangs forever till i do a hard reboot

Any ideas?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FC4 and Win XP dual boot Sata drives and Raid ChaoticPi Linux - Hardware 2 10-20-2005 12:47 AM
need to access /boot/grub/menu.lst and /boot/grub/device.map neouto Linux - Newbie 8 09-04-2005 12:45 PM
GRUB and Win SATA boot rizzy MEPIS 3 08-29-2005 11:58 AM
Multi-boot win/linux on SATA Raptor? phairest Linux - Newbie 10 04-04-2004 01:20 AM
Grub device map needed for promise raid terrance Linux - Software 0 03-15-2004 06:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:16 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