GRUB error 17 on external HDD

This is my first post here so i’ll start by saying hi. Hi!

As for the problem

I recently decided to try out openSUSE 11.4 with gnome and install it on my external USB HDD. To do so i followed this guide here SDB:Installation on external hard drive - openSUSE

Unfortunately after finishing the install when trying to boot into the system i got GRUB error 17. The only thing i did differently from the guide was placing the /boot partition after a ~800 GB NTFS partition with my data.

I tried to solve the problem by reinstalling the system with different settings than before. After completing all of the steps in the guide mentioned i disabled booting from MBR and enabled booting from /boot partition. Also set the installer to write generic boot code to MBR.

Though after the installation i realized that grub is not loading at all this time and went on to fix it by completing the steps here SDB:All about GRUB - openSUSE . After doing so i’m back to GRUB error 17.

Could anyone help me with this? Also a brief explanation of GRUB installation options (the ones i messed up in the second go) would be appreciated.

                 This is my first post here so i'll start by saying hi. Hi!

As for the problem

I recently decided to try out openSUSE 11.4 with gnome and install it on my external USB HDD. To do so i followed this guide here SDB:Installation on external hard drive - openSUSE

Unfortunately after finishing the install when trying to boot into the system i got GRUB error 17. The only thing i did differently from the guide was placing the /boot partition after a ~800 GB NTFS partition with my data.

I tried to solve the problem by reinstalling the system with different settings than before. After completing all of the steps in the guide mentioned i disabled booting from MBR and enabled booting from /boot partition. Also set the installer to write generic boot code to MBR.

Though after the installation i realized that grub is not loading at all this time and went on to fix it by completing the steps here SDB:All about GRUB - openSUSE . After doing so i’m back to GRUB error 17.

Could anyone help me with this? Also a brief explanation of GRUB installation options (the ones i messed up in the second go) would be appreciated.
First off, sorry to hear of your troubles and welcome to the openSUSE forum. Grub Error 17 says:

17 : “Invalid device requested” This error is returned if a device string is recognizable but does not fall under the other device errors.

So I must ask, if you remove your External Hard Drive (Disconnect it) does your main computer boot? Here is what I give to anyone trying to boot from a second or external hard drive. Why not read this and see if it helps.

Each hard drive can have up to four PRIMARY partitions, any of which could be marked active and bootable. No matter what you might hear, only one of the first four primary partitions can be booted from. That means you can boot from Primary partitions 1, 2, 3 or 4 and that is all. In order to boot openSUSE, you must load openSUSE and the grub boot loader into one of the first four partitions. Or, your second choice is to load the grub boot loader into the MBR (Master Boot Record) at the start of the disk. The MBR can be blank, like a new disk, it can contain a Windows partition booting code or generic booting code to boot the active partition 1, 2, 3, or 4. Or, as stated before, it can contain the grub boot loader. Why load grub into the MBR then? You do this so that you can “boot” openSUSE from a logical partition, numbered 5 or higher, which is not normally possible. In order to have more than four partitions, one of them (and only one can be assigned as extended) must be a extended partition. It is called an Extended Primary Partition, a container partition, it can be any one of the first four and it can contain one or more logical partitions within. Anytime you see partition numbers 5, 6 or higher for instance, they can only occur inside of the one and only Extended Primary partition you could have.

What does openSUSE want as far as partitions? It needs at minimum a SWAP partition and a “/” partition where all of your software is loaded. Further, it is recommended you create a separate /home partition, which makes it easier to upgrade or reload openSUSE without losing all of your settings. So, that is three more partitions you must add to what you have now. What must you do to load and boot openSUSE from an external hard drive? Number one, you must be able to select your external hard drive as the boot drive in your BIOS setup. Number two, you need to make sure that the external hard drive, perhaps /dev/sdb, is listed as the first hard drive in your grub device.map file and listed as drive hd0. I always suggest that you do not load grub into the MBR, but rather into the openSUSE “/” root primary partition which means a primary number of 1, 2, 3 or 4. If number one is used, then that will be out. You will mark the openSUSE partition as active for booting and finally you must load generic booting code into the MBR so that it will boot the openSUSE partition. I suggest a partition like this:

  1. /dev/sdb, Load MBR with generic booting code
  2. /dev/sdb1, Primary NTFS Partition for Windows
  3. /dev/sdb2, Primary SWAP (4 GB)
  4. /dev/sdb3, Primary EXT4 “/” openSUSE Partition Marked Active for booting (80-120 GB)
  5. /dev/sdb4, Primary EXT4 “/home” Your main home directory (Rest of the disk)

Thank You,

Yes, while installing openSUSE i left the primary hard drive intact so it boots windows normally.

The partition setup that you suggested only slightly differs from the one i had before (at least i think so):

/dev/sdb, MBR loaded with generic boot code
/dev/sdb1 800 GB NTFS, My data
/dev/sdb2 100 MB ext2, “/boot” Marked as active, GRUB loaded here
/dev/sdb3 8 GB swap
/dev/sdb4 Max., Extended partition
/dev/sdb5 20 GB ext3, “/”
/dev/sdb6 Max. XFS, “/home”

But i’ll try the setup you suggested and post back with results.

I tried the partition setup you suggested but the result is the same as it was after the reinstall mentioned in my original post - the grub won’t load at all. More specifically after booting the external HDD i’m left with a black screen and cursor blinking int the upper left corner.

Here is the partition setup from fdisk

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63  1866463892   933231915    7  HPFS/NTFS/exFAT
/dev/sdb2      1866465280  1874866175     4200448   82  Linux swap / Solaris
/dev/sdb3   *  1874866176  1927301119    26217472   83  Linux
/dev/sdb4      1927301120  1953523711    13111296   83  Linux

The contents of device.map

(hd0)	/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0

Contents of menu.lst

# Modified by YaST2. Last modification on Sun Apr 10 14:20:53 EEST 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
##YaST - generic_mbr
gfxmenu (hd1,2)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part3 resume=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part2 splash=silent quiet showopts vga=0x345
    initrd /boot/initrd-2.6.37.1-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part3 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x345
    initrd /boot/initrd-2.6.37.1-1.2-desktop
readlink /dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0

From your menu.lst

gfxmenu (hd1,2)/boot/message

That should be (hd0,2). But you have reinstalled so that may no longer be the problem.

Do you mean i should change “(hd0)” to “readlink” in device.map? If so, then it did not change anything.

I noticed that to but changing it to (hd0,2) had no effect.

No, I asked you to type (copy/paste) this command in a terminal. It should output something like …/…/sda or …/…/sdb.
The device.map file is only used when you install/reinstall Grub, but it provides an indication about the BIOS/Linux device mapping as you installed Grub.

So I see a few oddities. First off, your device.map file should have two hard drives listed. /dev/sda, which would be hd1 and /dev/sdb which would be hd0. Your entry of /dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0 might be OK if this is the external hard drive, but if so, where is the internal hard drive? Also, I see the listed drive ends with -0:0 which I think means it is a USB hard drive. Now here is the part that must be wrong right here from your menu.lst file:

gfxmenu (hd1,2)/boot/message

This must say (hd0,2) to be pointing to the USB hard drive and you don’t even have a hd1 entry in your device.map file. So this is likely the source of the error 17 you are getting from grub.

Thank You,

It returned …/…/sdb

Yes that is the external drive. The internal drive is not listed probably because i removed all Windows entries from GRUB menu when installing openSUSE. I see of no reason why i would want internal drive to be listed and judging by this guide SDB:Installation on external hard drive - openSUSE list with only external drive is OK (i used this guide when installing openSUSE the first time, as mentioned in the original post).

Yes it is.

As i said before, i no longer have the error 17. Since i reinstalled openSUSE, as you suggested, GRUB won’t load at all. After booting the external HDD a black screen appears with cursor blinking in the upper left corner.

Nevertheless i replaced (hd1,2) with (hd0,2) but it had no effect. I’m still left with the black screen with blinking cursor.

The gfxmenu is neither the problem nor he solution. This entry is optional and only relevant for the graphical menu. If it points to a wrong partition, you’ll see a message

(hd1,2)/boot/message: file not found

for a couple seconds and you’ll get the boot menu in text mode. If it’s missing, you’ll just see the boot menu in text mode.

You should reinstall Grub with an accurate device.map.

So consider that if you add the Internal hard drive to your device.map file you can have an entry made in grub to load Windows. It works just fine and there is no reason not to include this entry in your menu.lst file. please_try_again has a great script file that can identify your Windows setup and propose a menu.lst entry to run it, but you need the /dev/sda entry in the device.map file to work properly.

http://unixversal.com/linux/openSUSE/findgrub24.tgz

Thank You,

I’m relatively new to Linux so could you please list the steps needed to do so (and what entries should be in device.map?). Please note that i would like to make changes only to the external hard drive /dev/sdb

Hmm … Could it be that your external HD has a sector size of 4096 bytes and was preformated by the constructor to be compatible with Windows XP?

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x742fd272

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63  1866463892   933231915    7  HPFS/NTFS/exFAT
/dev/sdb2      1866465280  1874866175     4200448   82  Linux swap / Solaris
/dev/sdb3   *  1874866176  1927301119    26217472   83  Linux
/dev/sdb4      1927301120  1953523711    13111296   83  Linux

Judging by what fdisk -l returned sector size should be 512 bytes.

I don’t quite understand what you mean by “preformated by the constructor”, but it think it is unlikely since the only formatting made to my drive was after it’s purchase - formated to NTFS (unless it was preformated, don’t quite remember about that) - and later when installing openSUSE - NTFS partition shrinked and linux partitions created/formated by the installer. And also i don’t have Windows XP.

Ok, i reinstalled openSUSE one more time to make absolutely sure that i am doing nothing wrong at the install. This time the only things i changed in GRUB settings were:

  • set installer to write generic boot code to MBR;
  • disabled boot from MBR;
  • enabled boot from root partition;
  • changed the device order, so that /dev/sdb comes before /dev/sda (i assumed this would ensure that changes are made only to /dev/sdb).

Yet again when booting i get the same black screen with only a blinking cursor on it.

fsdisk -l

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x742fd272

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63  1866463892   933231915    7  HPFS/NTFS/exFAT
/dev/sdb2      1866465280  1874866175     4200448   82  Linux swap / Solaris
/dev/sdb3   *  1874866176  1927301119    26217472   83  Linux
/dev/sdb4      1927301120  1953523711    13111296   83  Linux

device.map

(hd0)	/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0
(hd1)	/dev/disk/by-id/ata-WDC_WD3200BEVT-22ZCT0_WD-WXA0A69C9390

menu.lst

# Modified by YaST2. Last modification on Mon Apr 11 00:53:27 EEST 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
##YaST - generic_mbr
gfxmenu (hd0,2)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part3 resume=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part2 splash=silent quiet showopts vga=0x345
    initrd /boot/initrd-2.6.37.1-1.2-desktop

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

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title windows 2
    map (hd1) (hd0)
    map (hd0) (hd1)
    rootnoverify (hd1,1)
    makeactive
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows 3###
title windows 3
    map (hd1) (hd0)
    map (hd0) (hd1)
    rootnoverify (hd1,2)
    makeactive
    chainloader +1

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

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part3 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x345
    initrd /boot/initrd-2.6.37.1-1.2-desktop

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

Also when i tried to use cfdisk on Ubuntu 9.10 live CD i got an error message:

FATAL ERROR: Bad primary partition 2: Partition ends in the final partial cylinder

Maybe this is somehow relevant to the problem.

I would ask if you have tried the kernel load option nomodeset? You would add it like so:

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part3 resume=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part2 splash=silent **nomodeset** quiet showopts vga=0x345
    initrd /boot/initrd-2.6.37.1-1.2-desktop

Next, you need to be careful running the Windows entries. Only one of them is valid. I would run that copy of findgrub as it will show which is the right one to use.

If nomodeset helps, tell us more about your video hardware.

Thank You,

I replaced menu.lst contents with the lines with nomodeset option and added the lines i got after running cfindgrub. It didn’ t help.

My menu.lst after editing:

# Modified by YaST2. Last modification on Mon Apr 11 00:53:27 EEST 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
##YaST - generic_mbr
gfxmenu (hd0,2)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part3 resume=/dev/disk/by-id/usb-Samsung_STORY_Station_0000002CE093105002BD-0:0-part2 splash=silent nomodeset quiet showopts vga=0x345
    initrd /boot/initrd-2.6.37.1-1.2-desktop

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

I must ask how you are obtaining all of these nice data displays for us to look at? You must have something that boots. If you get no boot message when booting from an external hard drive and the BIOS has been set properly to boot from that hard drive, one must assume the MBR is not working for some reason. Now if you do get a boot menu, but the screen goes blank after loading of the kernel starts, then the situation is quite different. So, I ask you to describe in detail the boot process and just what happens before all goes blank.

Thank You,