OpenSUSE 11.3 intallation - Grub Error 17

Hi all,

I am installing OpenSuSE on a flashdisk @ /dev/hdc from another flashdisk @ /dev/hdb (hda can’t be used, including MBR. It’s encrypted and the user is legally oblidged not to install anything to primary HD).

I had to figure out few things like using a 100MB /boot partition (ext4) at the beginning of the /dev/hdc and everything went well with the installation untill first restart. System is on /dev/hdc6 (ext4). Sytem must boot from hdc, not from the MBR on hda!

I had to do fdisk the flashdisk on another system and set hdc1 and hdc6 (probably not required) as bootable. Apparently, OpensSUSE can’t do that on it’s own.

Problem is, I can’t boot the system - getting a Grub Error 17: Cannot mount selected partition.
Of course I googled the net, but in all cases I found the problem was in messed up disks in /boot/grub/devices.map. This is not my case, because I’m pretty sure the (hd1,0) is the correct device /dev/hdc1 (yes, it IS correct, I switched order to hda-hdc-hdb due to the fact, that after installation there won’t be the 2nd flashisk hdb. Anyway, the disks are identified by ID and don’t get messed).

Where can be the source of problems? Anyone can suggest what to do? Please :’(

Thanks in advance

Hi oakld,

Have a look through the thread cloning hard drives
It covers how to align the boot sequence with Yast.

Michael.

Hi Michael,

thank you for your suggestion, however I’m not clonning a system. The /dev/hdb contains a proper installation DVD (on a flashdisk), set up and configured (used approx. 10 times for installatoin with no problem). So, /dev/hdb is instllation DVD (a source) and /dev/hdc is where system is getting installed (a target). All installation procedure is standard and done the correct way, except I pre-partitioned the disk on other system and switched order of hd devices in YaST.
I am reading through the thread and tutorial, to see if I can use any of it’s points for hints, but I recon it won’t help me…

Best regards,

Oak

Hi Oak,

Can you post the contents of the following files from your flash disk, /boot/grub/device.map, /etc/grub.conf, /boot/grub/menu.1st, /etc/fstab.

I’m assuming you have changed your machine bios to boot from the flash disk.

Michael

Hi again Michael,

I gave this exact setting up and I’m trying to go work-around-way, having a new partition layout on the /dev/sdc flashdisk:
/dev/sdc1 as “/” - ext4
/dev/sdc2 as “swap” - swap
/dev/sdc3 as “Windows drive” - FAT

Note, that I started with keeping/shrinking windows partiotion at /dev/sdc1, than found out BIOS requires to have /boot somewhere within first 4GB of the disk I shifted a small /boot device to /dev/sdc1, keeping root “/” at /dev/sdc6 and swap at /dev/sdc5. I guess this is what could cause the confusion to the system, so I got rid of that.

I guess a problem can be in /etc/grub.conf where there was something like:

grub setup --stage2=/boot/grub/stage2 --lba-enable (hd1,0) (hd1,0)

I’ve googled for 2 hours but haven’t found anything explainig the two drive adreses at the end, I’m just assuming one can point to /boot and one to “/” partitions, being same most of the time (if no /boot is used).

I’ll let you know when installation finishes whether this solution helped or the problem persists.

Best regards,

Oak

Hi Oak,

Did not have the info that you were dual booting. Hence my comment wrt bios is not relevant.

Happy hunting.

Michael

Hi,

well, technically it’s a single boot on /dev/sdc, as there is no reference and interference at all to/with /dev/sda. As I said, the user is legally oblidged not to do anything with internal harddrive of the laptop. This is why external USB flashdisk is the root and boot disk for the linux. Booting is done via boot menu (F12 at boottime) and selection “USB disk device”.

I’ll know in 15minutes if the effort will give some fruits :-).

Best regards,

Oak

Hi again,

still the SAME PROBLEM! I had to again use the fdisk to mark /dev/sdc1 as bootable. At one stage it said that the partition borders does not correspond with cylinderes (I think it’s irrelevant to USB flashdisk) and that the filesystem type is not specified! I think that can be the problem, as obviously Error 17 is linked to “Filesystem type unknown, partition type 0x7” message.

I did the partiotioning with YaST during the installation this time - but got the same result…

:frowning:

Any hints?

Best regards,

Oak

“Filesystem type unknown, partition type 0x7” That is a NTFS partition. So if the flash hdd does not have a NTFS partition, some where it is being pointed to the main hdd. Look at /boot/grub/menu.lst being sure it is pointing Suse loading to the correct hdd.

Are you being dropped to the grub prompt after error ?
If so , at prompt: type in

  1. root (hd <tab> – it will list all hdds
  2. root (hdx, <tab> – it will list all partitions of selected hdd, x=value’s returned in step #1

The above will tell you how grub is seeing the hdd’s, and modify menu.lst any where (HD or SD) is being used. Have never use a flash hdd, so take care.

Your grub.config file is saying , your grub files is on (hd0,1) and install grub on (hd0,1). So a generic boot code is in the MBR (hd0) and the boot flag would be needed on (hd0,1). The problem might be (hd0) is seen by grub as the internal hdd.

The first (hd0,1) is where /boot/grub/ is found and the second (hd0,1) is where grub will be installed. If command was (hd0,1) (hd0) the grub would be installed in the MBR of hd0.

Take extreme caution or you will mess up the internal hdd. Would advice to get more then 1 persons advice before doing mush, as errors on are part can be found sometimes due to a typeing error.

Thanks Michael,

“Filesystem type unknown, partition type 0x7” That is a NTFS partition.

I don’t know what the FS is on internal HD, but it is not accessed and can’t be, as it is hardware-side encrypted. However what is strange, is that /dev/hdc1 starts on cylinder 2 - I don’t think it’s normal. Fdisks displays several (not critical) warinings, including that the disk capacity is not used completely.

Are you being dropped to the grub prompt after error ?

Yes, correct. I can edit the commands executed by grub, however there’s nothing to correct, all references appear to be completely correct. I.e. it says “root (hd1,0)”, that is correct (as internal (hd0,0) can’t be accessed). I also tried (hd2,0) to make sure it is not switched with 2nd [install] flashdisk, but it’s not the case. Strange thing is, that when executing command of the grub, if I have 2nd flashdisk attached, it’s blinking for a few seconds, while the /dev/hdc flashdisk doesn’t.

So a generic boot code is in the MBR (hd0) and the boot flag would be needed on (hd0,1)

…good thinking, but no, this time it isn’t. I made sure to uncheck the option to use MBR in YaST during the installation. Only /dev/hdc is used for booting. The problem is, that after it reads those few bytes in stage 1, it should then boot from /boot, but for that it needs to mount the device - and it’s failing to mount the device (either correct one or at all).

The first (hd0,1) is where /boot/grub/ is found and the second (hd0,1) is where grub will be installed.

In my case, /boot/grub was located in separate disk (hd1,0) “/boot” preivously, now I made just one system (and one swap) disk without separate “/home” and “/boot” disks at the same location (hd1,0).
I know it’s the correct disk, as I can MOUNT the partitions from rescue system (so I was able to mount “/boot” disk as /dev/hdc1 device previously).

I think that source of the confusion is simple: When installing the system, I have three disks in:

  1. Internal /dev/hda - (hd0)
  2. Installation flash disk /dev/hdb - (hd2) - obviously, to boot the installation, it has to be plugged in before the future system disk
  3. Target system flash disk /dev/hdc - (hd1)
    When making first reboot after installation, I have to obviously unplug the /dev/hdb. The /dev/hdX is assigned by disk ID, so stays correct (and I helped it by switching order to hda-hdc-hdb).

I am really appreciating your effort! Finally we will find out that the cause is something stupid, simple :slight_smile:

Here is grub command:

root (hd1,0)
kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk-by-id/usb-Kingston_DT_101_II_001372xxJUSTNUMBERSxx-0:0-part1 resume=/dev/disk-by-id/usb-Kingston_DT_101_II_001372xxJUSTNUMBERSxx-0:0-part2 splash=silent quiet showopts
initrd /boot/initrd-2.6.34-12-desktop

This code is shown when going to edit mode in stage1 of grub booting and obviously is read from /boot/grub/menu.lst.

Here is content of /etc/grub.conf:

setup --stage2=/boot/grub/stage2 --force-lba (hd1,0) (hd1,0)
quit

Here is content of /boot/grub/device.map:

(hd2) /dev/disk/by-id/usb-_USB_DISK_2.0_xxxxxxxxxxx
(hd1) /dev/disk/by-id/usb-Kingston_DT_1O1-II_0013xxxxxxxxxxx
(hd0) /dev/disk/by-id/ata-ST916xxxxxxxxx

I am on this 2nd day, so a kick into right direction is well appreciated.

Best regards,

Oak

BTW, grub says: “Possible disks are: hd0 hd1”, when the installation flashdisk is unplugged. So everything is as expected. …but not working… :frowning:

Bloody hell! I think I found the problem, somehow the hd0 and hd1 are messed up! When tabbing through hd0,<tab> options in grub, I see that /dev/hdc is (hd0), even though it supposed to be hd1 according to the configuration and all convensions.
When putting in “root (hd0,0)” I get “Error 18: Selected cyliinder exceeds maximum supported by BIOS”, which I guess will now make me to repartition the disk again with separate “/boot” disk at /dev/hdc1 to put grub stage2 files to the beginning of the disk.

Michael, thanks a lot, you helped me a lot by pointing out the possibility of “tabbing” the options in grub.

Best regards,

Oak

On 2010-12-26 22:36, oakld wrote:
>
> Bloody hell! I think I found the problem, somehow the hd0 and hd1 are
> messed up! When tabbing through hd0,<tab> options in grub, I see that
> /dev/hdc is (hd0), even though it supposed to be hd1 according to the
> configuration and all convensions.

No, because when your thing starts to boot, you press a key to select boot
device, and this device becomes the first bios device. Ie, the bios
reconfigures itself.

I don’t know if all bioses do this, but it makes sense.


Cheers / Saludos,

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

I don’t know what the FS is on internal HD, but it is not accessed and can’t be, as it is hardware-side encrypted.
I do not now just what hardware is in use but be very careful , just because it is encrypted does not mean linux can not write to it, just means linux can not read the data on it. The only way I know linux likely can not mess with it ,if hdd password protection is on.

Yes, I try to be very careful and I do most of the time partitioning on another laptop (via YaST). The installation fails to start if I don’t select the system drives to be formatted, so I format them, but I make sure that only /dev/sdcX drives are touched.

Thanks for all help, hopefully I’ll be able to finish the job tomorrow.

Best regards,

Oak

On 2010-12-27 00:36, oakld wrote:
> but I make
> sure that only /dev/sdcX drives are touched.

This, and your initial message mentioning /dev/hdc makes me doubt what
distribution you are using.


Cheers / Saludos,

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

Solved! :slight_smile: lol! Everything went right after re-partitioning the disk with “/boot” partition (100MB) at the beginning of the disk and edit work on (hdX,0) adresses in grub.

@Wise Penguin: OpenSuSE 11.3 as mentioned in the title. Even though the system now can use different references, you can still use the old /dev/hdX names, i.e. I mount disks in rescue mode this way:

mkdir /sdc1
mount /dev/sdc1 /sdc1

In general, is this worth to put it as a small tutorial somewhere on the wiki for another users?

Best regards,

Oak

On 2010-12-27 16:06, oakld wrote:

> @Wise Penguin: OpenSuSE 11.3 as mentioned in the title. Even though the
> system now can use different references, you can still use the old
> /dev/hdX names, i.e. I mount disks in rescue mode this way:
>> > mkdir /sdc1
>> > mount /dev/sdc1 /sdc1

Your answer is still confusing. You say “you can still use the old
/dev/hdX names”, then you use “/dev/sdc1” in the mount command, which is
certainly no /dev/hdX device.

Ie.

a /dev/hdX is not equivalent to an /dev/sdX device. Please do not confuse them.


Cheers / Saludos,

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