11.3 - can't find grub without disc/boot from hard disc

Yes. The two Grub entries in the example below are equivalent. However the first one is safer, as the second one uses devices names. Whenever the device names change, this entry will look at the wrong device and not boot the kernel as expected.

title openSUSE 11.3 (Teal) - kernel 2.6.34.7-0.5 (Default)
    root (hd1,4)
    kernel /boot/vmlinuz-2.6.34.7-0.5-default root=/dev/disk/by-uuid/eca02a7d-12f1-427f-8661-0011ad9562dd resume=/dev/disk/by-id/ata-IC35L120AVV207-0_VNVD06G4CNG4GL-part11 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-2.6.34.7-0.5-default

title openSUSE 11.3 (Teal) - kernel 2.6.34.7-0.5 (Default)
    root (hd1,4)
    kernel /boot/vmlinuz-2.6.34.7-0.5-default root=/dev/sdb5 resume=/dev/sdb11 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-2.6.34.7-0.5-default

James,
Thanks.

#1 - Naming and order. OK, but with note of the sata udev issue identified by please_try_again. I haven’t changed any of the physical drive locations.

#2 - Grub device.map. Everything, Linux and windoze, is now on the Hitachi drive, which is currently hd1. Should I change this order in grub so that it will be hd0? Then will it write to the MBR on hd0? Below is what the device.map shows currently.

 cat /boot/grub/device.map
(fd0)	/dev/fd0
(hd0)	/dev/disk/by-id/ata-IBM-DJNA-351520_G80GLW4M080
(hd2)	/dev/disk/by-id/ata-ST380815AS_6RW0L125
(hd1)	/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN

#3 - I am somewhat lost when you mention the Bios. I haven’t made any changes to that

#4 - fstab & grub. In an effort to get everything to one drive, I changed the mounts via YaST/Partition Mgr and rebooted. In doing so, fstab was also changed.


/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part1 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part2 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part3 /home                ext3       defaults              1 2
/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part5 /local               ext3       defaults              1 2
/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part6 /windows/C           vfat       users,gid=users,umask=0002,utf8=true 0 0
/dev/disk/by-id/ata-ST380815AS_6RW0L125-part1 /downloads           ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-ST380815AS_6RW0L125-part2 /backup              ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-IBM-DJNA-351520_G80GLW4M080-part1 /windows/D           vfat       users,gid=users,umask=0002,utf8=true 0 0

#5 - I have not made any physical connection changes within the pc. Everything to this point is software only.

#6 - Grub location. On the Hitachi drive the first 4 partitions are swap, /, /home, & extended, in that order. If we make the changes mentioned above to reset this drive to be hd0, and then rewrite Grub to the MBR or root directory, will it be placed on the Hitachi drive (as opposed to the IBM it is stuck on now)?

#7 - I don’t want grub to be separated on different drives, I’m just not smart enough to do this on my own without screwing it up. Therefore all of the questions.

thanks for your help and patience.

I ask that you go into your BIOS setup and find the boot drive. If it is not this drive:

(hd0)    /dev/disk/by-id/ata-IBM-DJNA-351520_G80GLW4M080

Then nothing else will be correct. Based on the fact that sda seems to be this drive:

(hd1)    /dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN <--- sda

sda would normally be your boot drive if you did not change anything. The drive called HD0 in your device.map file must be the boot drive for things to work out right. Your setup is possible, just not normal by default.

Thank You,

Thanks, It will take me a couple of minutes to reboot and check. I’ll be back.

Nope. See how confusing it can be, even for advanced users! :wink:
I would say they are both logical and both illogical. But sda, sdb are certainly the more illogical of both. If you look at the special files (/dev/sda, /dev/sdb), you’ll notice that they date from the last time you booted the system. These files and all others (sda1, sda2, etc) are generated by udev at boot time. If it fails to read the partition table (it happens), they won’t even exist. If it loads the modules in a different order, they will have different names. Why would it load modules in different orders? Because, again:

udev loads kernel modules by utilizing coding parallelism to provide a potential performance advantage versus loading these modules serially.

This becomes particularly obvious when you mix SATA and IDE drives.

As for Grub devices (hd0, hd1), they are expected to match BIOS drives (0x80, 0x81). device.map (as the name indicates) maps OS files (sda, sdb) to them, and not the contrary. Whether drives plugged in SATA1, SATA2, etc will be seen as hd0, hd1 depends on BIOS settings and - last but not least - on particular BIOS issues.

Device map - GNU GRUB Manual 1.99~beta0

  • although, this link doesn’t refer to Legacy Grub, this hasn’t changed.

First off, if there ever was an expert on hard drive naming and oddities thereof, it would surely be you please_try_again. And to that end, I would never question what you say to be true. However, the following drive must be the first drive to boot from in his BIOS, this sets the tone for all other things to come.

(hd0)    /dev/disk/by-id/ata-IBM-DJNA-351520_G80GLW4M080

Further, most often people are not switching drives around after openSUSE has been installed and if I thought it is was true, I would most likely suggest they reinstall openSUSE and … please_try_again … rotfl! P.S., it is getting late here and it takes very little to get me tickled.

Thank You,

Good news, the bios was wrong. James, you were correct, and now it is finding grub and booting. I don’t know how it got changed. Before the installation I added the second sata, and somehow the IBM was bumped to the end. Thank you all for your help and patience to work this problem through.

In light of all that was said, and the challenges with sata vs ide drives. Would it be wise to move the windows over to the Hitachi and set the Hitachi to be the boot drive in the bios? Or is that pushing your patience? Some day that will likely be needed, correct? So if I understand, I need to:

1 - Change the bios back to the Hitachi as the boot drive.
2 - Reload grub into the MBR via YaST Boot Manager. (now that the Hitachi is boot, will it will be written there?).
3 - Make the windows partition bootable, (how do I do that?)
4 - Change the drive for the windows boot in the YaST Boot Manager for grub.

Is that correct? I don’t want to mess it up, but I really don’t want to go through this again when the ide dies, or needs to change.

thanks again.

I think you’ll find I told you that earlier too
Happy to see you sorted it :slight_smile:

Thank you, yes. I do remember seeing it posted by someone earlier, but it didn’t make sense to me back then. Over the years, of all the times in bios, I have never changed the boot order by device. That just missed my brain.

James, you mentioned this in post #6 as I go back over this. It is so obvious now, but I just didn’t catch it then. Sorry. Thanks again to all.

Any thoughts on the question for the other moves above?

This is a hardware issue you will note on the mother board the drive connectors are labeled S1,S2—Sx if you originally had the drive plugged to S2 and added a new one to S1 suddenly the new drive comes before the original thus changing the boot order since the The BIOS without other instruction uses the First drive it finds as boot HD0. IDE just adds another layer of complexity.

Doing a little digging on the XP side, the answer seems to be:
Make an XP hard drive or partition bootable?
1 - boot from the XP CD and “repairing” the Windows XP installation or through recovery console.
2 - fixmbr and enter.

If I do this I assume it will remove grub. Can I boot to openSuSE via the installation disc / boot hard disc (as was being forced at the beginning of this post)? Once there, I can use YaST Boot Manager to reset grub. Does this look right?

I don’t know if you did change something since your findgrub output at post #5 - didn’t reread the whole thread - . But yes, if you use fixmbr, it will replace Grub on your Windows HD (assuming it is the first one) with a generic bootcode. But why would you do that? Does that Grub bother anyone? You can have Grub installed anywhere and everywhere - except in the bootsector of your Windows partition. An yes, if you boot from a live CD, you can install Grub … anywhere as well.

  • But of course only one will boot at a time, the one ine the MBR of the first disk (if there is one), otherwise the one in the bootsector of the active partition on the first disk (if there is one), otherwise the one in the MBR of the second disk (if it is set in the BIOS as second choice boot device), etc.

Hi James!
I didn’t mean to tickle you. Anyway you must be sleeping now.
All I was saying it that the devices names (sda, etc), that are called “OS devices” in the Grub manual page following the link I provided, are a creation of the OS, more exactly of the udev daemon, and do not reflect the reality of the BIOS order - even if it does in most simple situations. Otherwise I guess we all agree about the fact that the bootdisk has to be the first one in the BIOS… although it is more tricky in a SATA/IDE mixed combination. As gogalthorp said:

IDE just adds another layer of complexity.

Is also said that, despite the fact that you don’t have influence of the names, it is not a problem as long as you don’t use device names in grub menu and /etc/fstab. Most users won’t notice that sda has suddenly become sdb since they last reboot the system, as they don’t run findgrub or halinfo on a daily basis. :wink:

On 2011-01-02 02:36, idee wrote:

> Once this is resolved I was going to post another question. I add it
> here in case it affects this issue. This installation moved the drive
> that was previously sda to sdd. It has windows XP on it.

How exactly did it move?

It does affect.

Did you move cables or what?

Or do you mean simply that it calls that disk by the sdd name? That depends
on the bios ordering, not on linux (nor windows).

By the way, booting from dvd, function boot hd, bypasses the order, I think

  • which is why it works.

The repair functionality is sadly gone.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

On 2011-01-02 06:36, jdmcdaniel3 wrote:
>
> Code:
> --------------------
> (fd0) /dev/fd0
> (hd0) /dev/disk/by-id/ata-IBM-DJNA-351520_G80GLW4M080 <— sdc
> (hd2) /dev/disk/by-id/ata-ST380815AS_6RW0L125 <— sdb
> (hd1) /dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN <— sda
> --------------------
> So, you have the IBM (sdc) drive designated as the boot drive even as
> you have openSUSE installed on the Hitachi designated as sda. As far as
> I know, the grub menu.lst file needs to be on the same drive as the grub
> boot loader.

Not really.

It is not the case, for example, when grub is installed on an extended
partition, which can’t contain any /file/. This is what the second
parameter to “setup” does, IIRC.

Code:

minas-tirith:/home/cer # cat /etc/grub.conf
setup --stage2=/boot/grub/stage2 --force-lba (hd0,3) (hd0,5)
quit

You could try to put something like “(hd0,3) (hd1,5)” for a different disk.
In any case, it is problematic.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Good news, the bios was wrong. James, you were correct, and now it is finding grub and booting. I don’t know how it got changed. Before the installation I added the second sata, and somehow the IBM was bumped to the end. Thank you all for your help and patience to work this problem through.

In light of all that was said, and the challenges with sata vs ide drives. Would it be wise to move the windows over to the Hitachi and set the Hitachi to be the boot drive in the bios? Or is that pushing your patience? Some day that will likely be needed, correct? So if I understand, I need to:

1 - Change the bios back to the Hitachi as the boot drive.
2 - Reload grub into the MBR via YaST Boot Manager. (now that the Hitachi is boot, will it will be written there?).
3 - Make the windows partition bootable, (how do I do that?)
4 - Change the drive for the windows boot in the YaST Boot Manager for grub.

Is that correct? I don’t want to mess it up, but I really don’t want to go through this again when the ide dies, or needs to change.

thanks again
This is very good news to hear idee. Lets see if I can answer your added questions.

  1. Yes
  2. Yes
  3. This is more complicated. You can boot from the Windows disk and use it to repair (but not reinstall) Windows. I am not sure if the Windows disk need to be the first disk or not, but some times, I disconnect all other drives (marking where they came from before removing them) before I run the repair disk. I normally try, if I have more than one disk, to leave the Windows disk totally alone and original, so I can just remove the openSUSE hard disk and find that Windows boots as normal.
  4. If you get Windows booting as Normal and openSUSE is loaded on a different disk, there is no need to take any action with YaST and the Windows disk.

Thank You,

James, thanks,

#3 - thanks for the tips. I’ll disconnect all but the drive with XP on it. It also has linux on it, so that’s where I thought I might need to clean up grub (#4).

#4 - if grub comes up fine, but linux and xp will be on the same drive, so I kind of expect windows to try to take over. I won’t mess with anything, but if it doesn’t it will just be making the adjustments as discussed in grub via yast.

Below is the current state of my system before I try the switch, just fyi:

 menu.lst

# Modified by YaST2. Last modification on Sun Jan  2 22:45:34 EST 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd1,1)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.3
    root (hd1,1)
    kernel /boot/vmlinuz-2.6.34.7-0.5-desktop root=/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part2 resume=/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part1 splash=silent quiet showopts vga=0x348
    initrd /boot/initrd-2.6.34.7-0.5-desktop

###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
    rootnoverify (hd0,0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
    rootnoverify (fd0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.3
    root (hd1,1)
    kernel /boot/vmlinuz-2.6.34.7-0.5-desktop root=/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part2 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset  x11failsafe vga=0x348
    initrd /boot/initrd-2.6.34.7-0.5-desktop



fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000378f2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2             263        4179    31463302+  83  Linux
/dev/sda3            4180       10707    52436160   83  Linux
/dev/sda4           10708       19457    70284375    f  W95 Ext'd (LBA)
/dev/sda5           10708       15276    36700461   83  Linux
/dev/sda6           15277       19457    33583851    c  W95 FAT32 (LBA)

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d9e73

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        2550    20482843+  83  Linux
/dev/sdb2            2551        9729    57665317+  83  Linux

Disk /dev/sdc: 15.4 GB, 15377080320 bytes
255 heads, 63 sectors/track, 1869 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00037716

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        1868    15004678+   c  W95 FAT32 (LBA)


sh findgrub.run

Find Grub Version 2.2b - Written for openSUSE Forums


 - reading MBR on disk /dev/sda                    ...
 - skiping partition   /dev/sda1   (swap)         
 - reading bootsector  /dev/sda2   (LINUX)         ...
 - reading bootsector  /dev/sda3   (LINUX)         ...
 - reading bootsector  /dev/sda4   (Extended)      ...
 - reading bootsector  /dev/sda5   (LINUX)         ...
 - searching partition /dev/sda6   (FAT32)         ...
 - reading MBR on disk /dev/sdb                    ...
 - reading bootsector  /dev/sdb1   (LINUX)         ...
 - reading bootsector  /dev/sdb2   (LINUX)         ...
 - reading MBR on disk /dev/sdc                    ... --> Grub found in MBR
 - searching partition /dev/sdc1   (FAT32)         ... --> Windows NT/2K/XP Loader found in /dev/sdc1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can add the following entry to /boot/grub/menu.lst :

###Don't change this comment - YaST2 identifier: Original name: WindowsBootLoader###
title Windows on /dev/sdc1
    rootnoverify (hd0,0)
    chainloader +1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.


cat /boot/grub/device.map
(fd0)	/dev/fd0
(hd0)	/dev/disk/by-id/ata-IBM-DJNA-351520_G80GLW4M080
(hd2)	/dev/disk/by-id/ata-ST380815AS_6RW0L125
(hd1)	/dev/disk/by-id/ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN


sh halinfo.run -uV
|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| dev  mount   fs       label          uuid                                     diskID                                                      start          size |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| sda1         DOS Ext                 4f128a35-874f-44b2-8191-539d5e4eeae6     ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part1               63       2055 MB |
| sda2    *    DOS Ext                 37b60f6a-2012-4fbd-848a-d8edf4671faa     ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part2          4209030      30725 MB |
| sda3    *    DOS Ext                 30e91ddb-3182-44dd-bded-53a883ebeaf1     ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part3         67135635      51207 MB |
| sda4         DOS Ext                                                          ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part4        172007955      68637 MB |
| sda5    *    ext3                    de99d9ce-98a3-46f8-a4e6-c2d8102b2433     ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part5        172008018      35840 MB |
| sda6    *    vfat                    47C0-D00A                                ata-Hitachi_HDS721616PLA380_PVF904Z23A71RN-part6        245409003      32796 MB |
| sdb1    *    DOS Ext                 a0e47e9d-eaef-414b-95df-30ff15f80939     ata-ST380815AS_6RW0L125-part1                                  63      20002 MB |
| sdb2    *    DOS Ext                 92a20ef1-30e3-4255-8a57-38a696f098e5     ata-ST380815AS_6RW0L125-part2                            40965750      56313 MB |
| sdc1    *    DOS Ext                 98DD-FA6D                                ata-IBM-DJNA-351520_G80GLW4M080-part1                          63      14653 MB |
|-------------------------------------------------------------------------------

thanks all