Suse 12.1 fails to load GRUB when AHCI is enable in BIOS.

Had a new install of Suse 12.1 with the AHCI enable in BIOS. Grub stops loading with “Loading stage1.5”.
If I disable AHCI and use IDE in bios Grub loads fine but then my dual boot with Windows 7 stops working as windows is installed with AHCI enable.

fdisk -l:


Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0x0005ff91

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   211435519   105614336    7  HPFS/NTFS/exFAT
/dev/sda3   *   211435520   625141759   206853120    f  W95 Ext'd (LBA)
/dev/sda5       211437568   337274711    62918572   83  Linux
/dev/sda6       337274880   625121279   143923200   83  Linux

Disk /dev/sdb: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 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: 0x84d41073

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     4208639     2103296   82  Linux swap / Solaris
/dev/sdb2   *     4208640    46153727    20972544   83  Linux
/dev/sdb3        46153728  1465147391   709496832   83  Linux

My /boot/grub/menu.lst

# Modified by YaST2. Last modification on lø. nov. 26 19:51:59 CET 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd0,4)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,4)
    kernel /boot/vmlinuz-3.1.0-1.2-desktop root=/dev/disk/by-id/ata-ST3320620AS_9QF64VE8-part5 resume=/dev/disk/by-id/ata-SAMSUNG_HD753LJ_S13UJDWQ324408-part1 splash=silent quiet showopts vga=0x314
    initrd /boot/initrd-3.1.0-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,4)
    kernel /boot/vmlinuz-3.1.0-1.2-desktop root=/dev/disk/by-id/ata-ST3320620AS_9QF64VE8-part5 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
    initrd /boot/initrd-3.1.0-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name:  openSUSE 11.3 - 2.6.34.10-0.2 (/dev/sdb2)###
title openSUSE 11.3 - 2.6.34.10-0.2 (/dev/sdb2)
    rootnoverify (hd1,1)
    chainloader +1

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

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

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

Sounds like the kernel is not loading the AHCI module. Caveat: My reply is based on 11.4, I’m still testing 12.1.

You can check if AHCI is being loaded by the kernel from a terminal as root with:

lsmod | grep ahci

The module needs to be in the initrd. Go to the YaST /etc/sysconfig tool under System/Kernel, the INITRD_MODULES entry. Add AHCI and exit. YaST will re-create the initrd, giving the kernel AHCI capability when it loads. Without that, it cannot access the disks, hence the grub error.

Good luck.

Interesting. I stumbled across this thread because I was pondering the implications of changing the BIOS setting in my Asus P6T Deluxe V2 motherboard from ‘IDE’ to ‘AHCI’ (currently I have this set to ‘IDE’ on a 64-bit openSUSE-11.4).

The reason I am thinking of changing that setting is I have an Asus U3S6 PCI-e USB-3.0 card, where I read of one user who has used this card with the same motherboard as mine, claim categorically that one needs to set the BIOS to AHCI to obtain the USB-3.0 speeds with the motherboard/card combination. I don’t know if that is true but I do know I currently do not obtain USB-3.0 speeds from the card in my motherboard.

I may wait until Easter, at the same time as I install openSUSE-12.1, before I change from ‘IDE’ to ‘AHCI’. I’m reluctant to test this on my main PC outside the time window of an openSUSE update.

It’s interesting because I checked on two systems with SATA set in AHCI mode and the ahci module is neither loaded ("lsmod | grep ahc"i is empty), nor in initrd.

# lsinitrd /boot/initrd | grep drivers
lib/modules/3.1.0-1.2-desktop/kernel/drivers
lib/modules/3.1.0-1.2-desktop/kernel/drivers/ata
lib/modules/3.1.0-1.2-desktop/kernel/drivers/ata/ata_generic.ko
lib/modules/3.1.0-1.2-desktop/kernel/drivers/ata/pata_marvell.ko
lib/modules/3.1.0-1.2-desktop/kernel/drivers/acpi
lib/modules/3.1.0-1.2-desktop/kernel/drivers/acpi/fan.ko
lib/modules/3.1.0-1.2-desktop/kernel/drivers/acpi/processor.ko
lib/modules/3.1.0-1.2-desktop/kernel/drivers/acpi/thermal.ko
lib/modules/3.1.0-1.2-desktop/kernel/drivers/thermal
lib/modules/3.1.0-1.2-desktop/kernel/drivers/thermal/thermal_sys.ko
lib/udev/rules.d/80-drivers.rules
usr/lib64/directfb-1.4-5/inputdrivers
usr/lib64/directfb-1.4-5/inputdrivers/libdirectfb_keyboard.so

It must be in the kernel then.
Notice that the ahci module is there on the same machine in ArchLinux (kernel 3.1.6-1). (!)

As for the Grub error, if the bootloader doesn’t find the offset of the next stage because this offset has changed - after you moved the root partition, applied a brutal fsck or tell the BIOS to handle the drive geometry differently (LBA, Large, Legacy, AHCI, etc) - you would need to reinstall Grub.

This should read “currently I have this set to ‘IDE’ on a 64-bit openSUSE-11.4”

Just fyi . . . if you happen to have Windows on that machine, you might want to check whether there are any implications with making that AHCI change in the bios. I recall that at one time in the past a re-install was required because MS used a different kernel for AHCI.

And, yep, AHCI is now built into the linux kernel.

Thanks for the warning …

Yes, I have a legal copy of MS-WindowsXP on a separate partition. I don’t use it often (boot to it about once every 3 or 4 months). I still have the installation CD kicking around somewhere, and I probably need to dig that up for when I decide to change the BIOS setting.

I did a little checking myself to refresh my memory a bit. Have to correct myself; not in a different kernel but is a separate hardware driver that must be loaded like we do with the initrd. Not positive but there may be different ones, as determined by the chipset Southbridge. Hope you have a floppy on the machine, because the F6 method is the only way to install unless you slipstream. IIRC it can also be done if you have 2 drives and your BIOS supports IDE or AHCI on different ports, but not many boards offer this feature. Not trivial.

Well, Easter is approaching, and I am taking some extra vacation. I’m thinking either Saturday (tomorrow), Sunday, or Monday I’ll apply the AHCI setting in BIOS, and re-install both WindowsXP and also install openSUSE-12.1 on my main PC (which is an Asus P6T Deluxe V2 motherboard with a Core i7 CPU currently running openSUSE-11.4). I checked the BIOS and as I noted above, under ‘storage configuration’ I can change the ‘configure sata’ from its current IDE setting to ‘AHCI’ or ‘RAID’. I plan to choose AHCI.

I don’t have a floppy drive. :frowning: … But I did borrow a floppy drive that connects via a USB line … I’m not sure plugged in when booting the MS-Windows-XP SP3 installation CD if that will be recognized when I press F6 during the MS-Windows-XP install. I only have one hard drive on this PC (but i do have two CD drives (a reader and a writer)). So I have possibilities here. I may also burn a data CD and put the MS-Windows drivers on that CD.

I have not figured out exactly what winXP driver I need thou.

First thing I need to do tomorrow is make a current backup of my hard drive. I’d do that tonight, but work was busy today … real real busy … and I’m exhausted (well in need of vacation).

… Partial success - I think.

Details:

I completed my backups, went to the Asus site for my Aus P6T Deluxe V2 motherboard, and downloaded the appropriate WinXP drivers. I copied them to a floppy disk with the USB floppy drive. Then I booted to a Parted Magic liveCD and made MS-Windows my active partition (changing the active from /dev/sda3 (openSUSE-11.4 linux on my PC) to /dev/sda1). Then I rebooted to BIOS, changed to AHCI, booted to the WindowsXP SP3 installation CD, pressed F6 when prompted (so as to load external drives). But could I get it to load the drivers off of the USB floppy drive ? No. … … after 15 minute of my wheel spinning, I went to the internet and found this suggestion: HOW TO switch from IDE to AHCI mode without having to reinstall Win XP (GUIDE) in reply 104

perhaps i have a other way:

Now go to your Device Manager. Klick on your IDE/ATAPI Controller. Right click on intel(R) XXXXX Bus Master Ide Controller. Klick on Driver update. Let Windows not search!

Klick on Search Driver manually from a list!.. Klick on Drive… search. Go to the place where you the IAstore.inf have placed.

klick OK. Remove the Check at “kompatible Hardware”.Now in the List right, chose the right driver. On my (X48C Platinium) it was Intel(R) ICH9R/DO/DH SATA AHCI Controller.

Klick all ok. Ignore possibly warnings incompatible Hardware. Install the Driver. Make a Reboot and jump into Bios.

On integated Peripherals—>On-Chip ATA Devices chose AHCI. Save and exit the Bios and reboot.

Perhaps to make a check that Your Harddrive where the OS is installed, has the first Boot priority.

If necessary re enter Bios and change it.

I have make this way anymore. It works fine.

so I decided to try it. I rebooted to BIOS, restored IDE, booted winXP off the hard drive (which is setup for IDE drivers), and followed the above. I had previous noted in my motherboard manual that my motherboard uses for Storage the “Intel ICH10R Southbridge” so when given a choice as to what SATA-AHCI drivers to use I selected the ICH10R. I then after installation was told to reboot to use the SATA-AHCI drivers. When rebooting I went again to BIOS, changed from IDE to AHCI, and proceeded to boot WinXP. … Interesting. So I don’t have to re-install WinXP (at least not thus far).

So I rebooted to the Parted Magic liveCD, changed the active partition back to /dev/sda3 (where I have grub and my / boot partition for openSUSE) and found that grub came up. Interesting. But I again selected WinXP, and again it booted.

I have not tried openSUSE-11.4 with the AHCI setting. I’m not venturous enough to do that (even though I have backups). Instead I am now going to directly install openSUSE-12.1 with the AHCI setting in BIOS.

Ehh… I also have now ASUS mobo (but P8H67) w/USB 3.0 controller and AHCI switched off in BIOS.
But my Windows is Windows 7. It’s interesting, should I try the same trick as w/Windows XP ?

And now some question about grub menu.lst from 1st message here.
Grub numberings of partitions start from 0 (in opposition to grub2).
But
root (hd0,4)

or the reference in gfxmenu points then to /dev/sda6 - or grub takes into account also “missing” sda5 ?

I installed openSUSE-12.1 on this Asus P6T Deluxe V2 with the AHCI settings for my 1.5 TB drive. No drama’s unique to AHCI , although I did encounter the nominal openSUSE-12.1 nVidia installation glitches. openSUSE-12.1 is running well with AHCI selected with my 1.5 TB drive.

I can’t help you with Windows7. The last Windows I spent any time using was Win95. And while I do have a legal copy of WinXP, I typically switch it on once every 3 or 4 months. I mentioned to my wife (a BIG MS-windows fan) if perhaps I should/could buy windows7 since my Core i7 920 cpu should handle it with no problem, and switching winXP to AHCI could be a pain. My wife is laughed and is still laughing, telling me for the amount of time (a big zero) I use MS-Windows I would be better served by installing MS-DOS ! … She pulled out the spousal veto and nixed any Windows7 purchase for me. She probably has a point. So no Windows7 for me.

I recommend you install the application ‘updategrub’ from please-try-again’s repository:


http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_12.1/

and then after it is installed, don’t run ‘updategrub’, but rather run ‘findgrub’.


findgrub

It provides a good indication as to what is installed where wrt legacy grub. For example on my Corei7 920 (ASUS mobo P6T Deluxe V2) :


Find Grub Version 3.7.2 - Written for openSUSE Forums

 - reading MBR on disk /dev/sda                       ... --> SUSE Generic MBR (Sig: 0x4fab09)
 - searching partition /dev/sda1      (NTFS)          ... --> Windows NT/2K/XP Loader found in /dev/sda1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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/sda1
    rootnoverify (hd0,0)
    chainloader +1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 - reading bootsector  /dev/sda2   *  (LINUX)         ... --> Legacy GRUB  found in /dev/sda2   => sda2   0x83 (openSUSE)
 - reading bootsector  /dev/sda3      (LINUX)         ... --> Legacy GRUB  found in /dev/sda3   => sda3   0x83 (openSUSE)
 - reading bootsector  /dev/sda4      (Extended)      ...
 - skipping partition  /dev/sda5      (swap)         
 - reading bootsector  /dev/sda6      (LINUX)         ...
 - reading bootsector  /dev/sda7      (LINUX)         ...

You can see from the above that my active partition is /dev/sda2 which is my new openSUSE-12.1 install. On /dev/sda3 is another openSUSE install (root partition). Sda6 and sda7 are both home partitions. Clearly in my example sda1 is my WinXP.

I hope to put in a PCI-e USB-3.0 card back in my PC later this weekend, and see if it works better with AHCI selected than it did with IDE selected (as I had it in my PC many months back). With IDE selected under openSUSE-11.4 it did not provide much better speed than the nominal USB-2.0 output.

Which trick? Windows7 supports AHCI out of the box. With Windows XP, it was necessary to install a driver before setup in order to access SATA HDDs in AHCI mode.

Open a new thread and post the output of

sudo /sbin/fdisk -l

and

sudo cat /boot/grub/menu.lst

The output of findgrub would also be useful. You’ll have to install findgrub first.

su -l
zypper ar [noparse]http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_12.1/[/noparse]  PTA
zypper refresh -r PTA
zypper in updategrub
findgrub

@oldcpu,

You were one-tenth of a second faster! :wink:

But if I switch AHCI to “on” in BIOS, my W-7 simple do not boot. Sorry - it’s not a question for OpenSuSE forums.

That’s because your Windows has been installed in another mode. You can not “switch” to AHCI after an OS has been installed in IDE, RAID or another storage mode. But you could switch to AHCI before installing/reinstalling Windows - although there are exceptions to this rule.

By the way you have the answer to your question. If you change the storage mode in BIOS, the disk geometry is handled differently and Grub won’t be able to see your partitions.

I changed SATA mode settings to AHCI in BIOS, booted Parted Magic СD - and the drive geometry is the same as w/IDE, the same 255 heads, 63 sectors per track, 60801 cyls. All the partitions are visible and OK, both in fdisk or in Gparted.

What is about W7, my previous question/message was just about possibility to perform some trick (like existing for W/XP) which allows switch to AHCI w/o re-installation.

I wasn’t talking about the CHS geometry and you’re not booting from the hard disk. Seeing the partitions on a hard disk that you didn’t boot and finding the second stage of Grub when the offset of the partition might have changed are not the same thing.

I have no idea. It might work or not with Linux, depending on the hardware and where the bootloader is installed. With Windows, I don’t know. I would guess probably not. But you should ask Windows experts.

Installation of both W7 (factory installed) and OpenSuSE 12.1 (by me myself, now) was performed using AHCI switched off in BIOS. Legacy grub (paced in MBR) is used as “main” bootloader.

Now I set (in BIOS) SATA mode to AHCI. grub works OK w/o any changes (and do not see any problems w/geometry) , and can successfully load, in particular, OpenSuSE 12.1 which also works OK w/o any changes.

What is about W7, it can’t boot successfully w/AHCI. But there is simple trick w/small registry modification via regedit, see Error message when you start a Windows 7 or Windows Vista-based computer after you change the SATA mode of the boot drive: “STOP 0x0000007B INACCESSABLE_BOOT_DEVICE”

It’s not a question for an openSUSE forum, as you said before, but it sounds like an answer for a Windows forum. :wink: