LinuxQuestions.org
Visit Jeremy's Blog.
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 07-02-2009, 08:23 AM   #16
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 80

Original Poster
Rep: Reputation: 15

Well, some interesting/puzzling things happening.

Booted to SATA XP drive, which brings up the GRUB menu and selected it to BOOT in debian Linux.

Then tried the grub commands:

Code:
Flo64:/boot/grub# grub-install '(hd2)'
Searching for GRUB installation directory ... found: /boot/grub


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]
grub> root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83
grub> setup  --stage2=/boot/grub/stage2 --prefix=/grub (hd2)
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd2)"... failed (this is not fatal)
 Running "embed /grub/e2fs_stage1_5 (hd1,0)"... failed (this is not fatal)
 Running "install --stage2=/boot/grub/stage2 /grub/stage1 d (hd2) /grub/stage2 p /grub/menu.lst "... failed

Error 21: Selected disk does not exist
grub> quit
hmm strange no hd2, so did:
Code:
Flo64:/boot/grub# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/Flo64-root
                      6.5G  3.5G  2.7G  57% /
tmpfs                 2.0G     0  2.0G   0% /lib/init/rw
udev                   10M  140K  9.9M   2% /dev
tmpfs                 2.0G     0  2.0G   0% /dev/shm
/dev/sdb1             228M   18M  199M   9% /boot
/dev/mapper/Flo64-home
                      900G  224M  854G   1% /home
/dev/scd0             136M  136M     0 100% /media/cdrom0
Flo64:/boot/grub# grub-install /dev/sdb1
Searching for GRUB installation directory ... found: /boot/grub
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)	/dev/sda
(hd1)	/dev/sdb
So that means only 2 drives found.

Code:
cat /var/log/dmesg | grep hd
[    3.413869] hda: ST3300622A, ATA DISK drive
[    4.783154] hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
[    4.783323] hda: UDMA/100 mode selected
[    5.464514] hda: max request size: 512KiB
[    5.509715] hda: 586072368 sectors (300069 MB) w/16384KiB Cache, CHS=36481/255/63
[    5.537718] hda: cache flushes supported
[    5.537718]  hda: hda1 hda2 < >
[   31.184084] hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...

Flo64:/boot/grub# cat /var/log/dmesg | grep sd
[    5.941107] Driver 'sd' needs updating - please use bus_type methods
[    5.941107] sd 0:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)
[    5.941107] sd 0:0:0:0: [sda] Write Protect is off
[    5.941107] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    5.941107] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    5.941107] sd 0:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)
[    5.941107] sd 0:0:0:0: [sda] Write Protect is off
[    5.941107] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    5.941107] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    5.941107]  sda:<4>Driver 'sr' needs updating - please use bus_type methods
[    5.949116]  sda1
[    5.949116] sd 0:0:0:0: [sda] Attached SCSI disk
[    5.949116] sd 0:0:1:0: [sdb] 1953525168 512-byte hardware sectors (1000205 MB)
[    5.949116] sd 0:0:1:0: [sdb] Write Protect is off
[    5.949116] sd 0:0:1:0: [sdb] Mode Sense: 00 3a 00 00
[    5.949116] sd 0:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    5.949116] sd 0:0:1:0: [sdb] 1953525168 512-byte hardware sectors (1000205 MB)
[    5.949116] sd 0:0:1:0: [sdb] Write Protect is off
[    5.949116] sd 0:0:1:0: [sdb] Mode Sense: 00 3a 00 00
[    5.949116] sd 0:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    5.949116]  sdb: sdb1 sdb2
So GRUB only seeing 2 drives.

Think I found problem for sound problem but thats another future thread, just wondered if GRUB got a problem with detecting it?

hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...


I am very confused now.
 
Old 07-02-2009, 08:29 AM   #17
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Rep: Reputation: 39
Clarity is good. I used to have two drives, the first with NTFS stuff and the bootloader, with the actual /boot partition on the second drive. I later chose as you are to put a dedicated /boot partition (managed by Debian) on the same drive as the bootloader. There is one catch——————Windows insists on being installed on the first disk, and sometimes on the first partition. On a separate note, it maybe even needs to be a primary partition for Grub to be able to bootload it, see the grub manual.

Speaking of clarity, I'm a bit confused by now which drive is which. You have three drives:

Drive onesy: SATA drive with XP and NTFS joy
Drive twosy: SATA drive with Debian bliss
Drive threesy: IDE drive for some temporary porpoise

By Linux terminology, I believe these will be described, e.g., by fdisk, as:
onesy = /dev/sda
twosy = /dev/sdb
threesy = /dev/hda

... assuming the BIOS sees them that way.

You selected to install grub to (hd2)... isn't this threesy (IDE)? Are you sure Grub numbers the drives the way you think it is? The Grub manual should help you figure this out.

In any case, as I implied above, you probably need to have both Grub and Windows on (hd0), which is onesy. The actual /boot could reside anywhere Grub can find it, it's up to you.
Quote:
This means that I need to write an MBR to the SATA Linux drive, and set the BIOS to boot to the SATA linus drive, incase the SATA XP drive dies or gets removed etc, to ensure Linux keeps booting.
Almost, but not really. Sure, you can write the same MBR on all drives, and only one will be read and used, as selected by the BIOS. Why not? The point about flexibility is good: It could be at some point that you want or need to remove either drive onesy (Windows) or twosy (Debian). How would you boot Windows without Debian then (assuming you could put Windows as the second drive). Possibly the most flexible way is to have a dedicated /boot partition on (hd0) (it will have to be the one with Windows), and to clone it on (hd0) (the one with Debian). That way, even if you remove one or the other disc, you can still rearrange things in the BIOS and Grub's menu to boot until you reinstall the removed hard drive. By the way, you can edit the Grub entries by hand from the Grub menu, which is often useful when experimenting with your setup.

I'm writing all this from memory, caveat emptor.
 
Old 07-02-2009, 08:38 AM   #18
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Once you have boot the install cd or a rescuecd what do you see when you do a 'fdisk -l'?
 
Old 07-02-2009, 11:35 AM   #19
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 80

Original Poster
Rep: Reputation: 15
Boot order in BIOS
Code:
1) SATA 3 1TB - WDC green thingy
2) SATA 1 500Gb - Hitachi
3) IDE 300.0 GB - ST3300622A
4) SATA 2 - DVD/CD Rom drive
a) Now when I allow auto booting (Not pressing F11 for BIOS Boot menu) it boots too the 1Tb SATA drive and the GRUB menu appears, after the delay it then is suppose to boot into XP, this fails and it keeps bringing the GRUB menu back, forever. If I scroll up to the AMD64 Linux option, it boots fine into Linux.

b) If I reboot and call up the BIOS boot menu (F11) and tell it to boot too the 500Gb SATA drive, the GRUB menu appears, after the delay it then boots into XP as it is suppose too. I can also scroll up too the AMD64 Linux kernel and it boots fine.

Course I want option a to work properly.



fdisk -l rescue CD results:

Code:
fdisk -l

Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/dm-2 doesn't contain a valid partition table

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf4b1995e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       60800   488375968+   7  HPFS/NTFS

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d495f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          31      248976   83  Linux
/dev/sdb2              32      121601   976511025   8e  Linux LVM

Disk /dev/dm-0: 6996 MB, 6996099072 bytes
255 heads, 63 sectors/track, 850 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000


Disk /dev/dm-1: 12.1 GB, 12192841728 bytes
255 heads, 63 sectors/track, 1482 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000


Disk /dev/dm-2: 980.7 GB, 980754104320 bytes
255 heads, 63 sectors/track, 119236 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/hda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x13871386

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1       35970   288928993+   7  HPFS/NTFS
/dev/hda2           35971       36480     4096575    f  W95 Ext'd (LBA)
from the booted hard drive kernel
Code:
fdisk -l

Disk /dev/hda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x13871386

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1       35970   288928993+   7  HPFS/NTFS
/dev/hda2           35971       36480     4096575    f  W95 Ext'd (LBA)

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf4b1995e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       60800   488375968+   7  HPFS/NTFS

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d495f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          31      248976   83  Linux
/dev/sdb2              32      121601   976511025   8e  Linux LVM

Disk /dev/dm-0: 6996 MB, 6996099072 bytes
255 heads, 63 sectors/track, 850 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 12.1 GB, 12192841728 bytes
255 heads, 63 sectors/track, 1482 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/dm-2: 980.7 GB, 980754104320 bytes
255 heads, 63 sectors/track, 119236 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-2 doesn't contain a valid partition table
 
Old 07-02-2009, 03:09 PM   #20
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Ok back.

Now as far as i can tell debian is booting but windows is not am I right?

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

Do you need the remapping for windows since xp Pro is on your second drive (i'm guessing from boot-up sequence) and debian on main (still guessing lol)?

Last edited by Hern_28; 07-02-2009 at 03:14 PM.
 
Old 07-02-2009, 03:50 PM   #21
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 80

Original Poster
Rep: Reputation: 15
Have done all the default GRUB menu stuff so windows boots after delay.

There is a problem when one BOOTS to the 1TB sata drive as the 1st drive, XP won't boot.
 
Old 07-02-2009, 04:36 PM   #22
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Ok.

From one of your previous posts snippets:
PHP Code:
This is the [SNIPedcontents of /boot/grub/menu.lst

title Debian GNU
/Linuxkernel 2.6.26-2-amd64
root 
(hd1,0)

# This entry automatically added by Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root 
(hd0,0
is there no:

chainloader +1

at the end of the windows boot?

might be better to post the entire menu.lst
 
Old 07-02-2009, 05:33 PM   #23
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 80

Original Poster
Rep: Reputation: 15
If you see my earlier posts, page 1, I snipped the menu.lst file for the posting.

All works fine in GRUB menu.


default 3
timeout 5
color cyan/blue white/blue

title Debian GNU/Linux, kernel 2.6.26-2-amd64
root (hd1,0)
kernel /vmlinuz-2.6.26-2-amd64 root=/dev/mapper/Flo64-root ro quiet
initrd /initrd.img-2.6.26-2-amd64

title Debian GNU/Linux, kernel 2.6.26-2-amd64 (single-user mode)
root (hd1,0)
kernel /vmlinuz-2.6.26-2-amd64 root=/dev/mapper/Flo64-root ro single
initrd /initrd.img-2.6.26-2-amd64

title Other operating systems:
root

title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1



and device.map:
(hd0) /dev/sda
(hd1) /dev/sdb



My head is totally swimming in confusion.

Last edited by wikapuki; 07-02-2009 at 05:58 PM.
 
Old 07-02-2009, 06:12 PM   #24
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
ahh.. ok kewl.

Glad to hear you got it working lol
 
Old 07-02-2009, 06:24 PM   #25
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 80

Original Poster
Rep: Reputation: 15
No, not working.

The menu systems works, its when it boots to the 1Tb SATA drive that it fails to Boot the 500Gb SATA windows drive. Also GRUB don't mention the 1st IDE drive.

I am just lost and is despair., Just re-installed it all from Debiuan CD and same problems, YET when I installed the windows7 to it t worked fine, yes I tried the anti - christ, which I did not want to and will not use.

Even the VMware ESXI 4 won't install to that drive cos it won't find the NIC that came with the machien, thier forum says out a new NIC in la la la rather than sort thier bug.


And when I boot to the deb AMD84 drive it has nosound can't enumareate the USB stuff etc,!!!

It just feel I am beeing forced down the anti-christ route for ever.

Do you thinbk GRUB2 would solve this?
 
Old 07-02-2009, 07:10 PM   #26
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Hmm.

So you want the system to boot to all your systems no matter which drive is set to boot?
 
Old 07-02-2009, 07:23 PM   #27
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 80

Original Poster
Rep: Reputation: 15
Hi :-)

No,

1) I want the BIOS set so the 1st (default) boot drive is 1Tb SATA drive.

2) The systems Boots to that drive and loads the GRUB menu.

3) By default the GRUB menu has Windows XP set as default

4) After the delay it boots into windows XP


HOWEVER if I am there at the GRUB boot menu I can choose debian and it boots that up.


I have done a video of my hell, 2moro when my PA comes she can put the SD card into the PC and I will upload it to youtube.

At moment I have to select f11 to select the 500Gb stat drive to boot to, then edit the XP entry from (hd1,0) to (hd0,0) and then it boots XP

Last edited by wikapuki; 07-03-2009 at 06:30 AM.
 
Old 07-03-2009, 06:41 AM   #28
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 80

Original Poster
Rep: Reputation: 15
Video of problem:
http://www.youtube.com/watch?v=t4Ivxq53D6s

Sorry about the beginning and time but you can skip to relevent parts.
 
Old 07-03-2009, 07:16 AM   #29
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Rep: Reputation: 39
Quote:
It just feel I am beeing forced down the anti-christ route for ever.

Do you thinbk GRUB2 would solve this?
It may rather be a question of reading the Grub manual more carefully, see below.


What is causing your problem? I think I addressed it above:
Quote:
Originally Posted by michapma View Post
There is one catch——————Windows insists on being installed on the first disk
When you booted from the rescue CD and from the hard drive, both times fdisk reported your 500 GB NTFS drive as being /dev/sda, so we can say that Windows is installed on the first disk. However... I am guessing that when you tell the BIOS to select to boot from the 1000 GB drive and try to chainload Windows, the Windows bootloader no longer sees itself as residing on the first disk, and can't figure out how to load, hence it fails and Grub helpfully brings back up its menu (though this could give you the impression of mocking your intentions). For a possible workaround, see below.

Quote:
Originally Posted by michapma View Post
In any case, as I implied above, you probably need to have both Grub and Windows on (hd0), which is onesy. The actual /boot could reside anywhere Grub can find it, it's up to you.
I would like to suggest this again. Let Grub live on the 500 GB NTFS disc. If and when you remove this 500 GB NTFS disc, for whatever reason, you can at that point simply use a rescue CD to install GRUB on the 1000 GB MBR (it is already) and edit your menu.lst. That's not hard, it isn't hell—certainly less frustrating than what you're going through now.

If, however, you'd like to pursue your plan of booting from the 1000 GB drive—even though it's the second drive—as you describe in post #27, you then need to read the Grub manual more carefully:
Quote:
Originally Posted by The GRUB folk
GRUB cannot boot DOS or Windows directly, so you must chain-load them (see Chain-loading). However, their boot loaders have some critical deficiencies, so it may not work to just chain-load them. To overcome the problems, GRUB provides you with two helper functions.

If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one. The workaround used in GRUB is the command map (see map), like this:

grub> map (hd0) (hd1)
grub> map (hd1) (hd0)

This performs a virtual swap between your first and second hard drive.

Caution: This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won't work.
And a bit more.

Hope that helps.
 
Old 07-03-2009, 08:14 AM   #30
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 80

Original Poster
Rep: Reputation: 15
Hi, feeling very good and michapma, your solutions works. I tried just doing:

map (hd0,0) (hd1,0)

and that worked fine, but have edited th XP section of the menu.lst and added:

map (hd0) (hd1)
map (hd1) (hd0)

So I thank you all for your help and above al patience.
 
  


Reply

Tags
grub, linux, map, multiboot, xp



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
again-dual boot windows XP, 1st drive-linux Mepis 8.0 2nd drive marvinudy Linux - Newbie 2 06-09-2009 09:51 AM
SCO 505 partition on 2nd SCSI drive, 1st running suse9.3 jimbo85 Linux - Hardware 9 01-28-2008 09:31 PM
Added a 2nd Sata Drive installed Fedora Core 5, BIOS Doesn't See 2nd Drive. mtmcc1 Linux - General 3 12-03-2005 04:01 PM
Installed GRUB on 3rd hard drive, how do I boot 1st drive? jesusphreak Linux - Newbie 4 04-06-2005 09:34 AM
FC2 install on 2nd drive, no dual-boot, will install modify 1st WinXP drive at all? Equisilus Fedora - Installation 14 06-27-2004 02:38 AM

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

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