System won't boot after grub/kernel update

Hello,

I run a win7/Suse 12,3 kde 32bit dual-boot and when i turn on my pc, the system don’t go pass the bios. It just hangs on the grub (Stooorage - Free Image Hosting). I remember before the last shutdown, i run an update where a new grub and kernel got installed, so i figure that must be the issue. I was thinking about reinstalling the bootloader through the live media, but i didn’t find that an option. It seems the installation process cannot go forward if i don’t chose to run a complete installation.

I don’t know if this could be a factor, but i have the /boot in a separate partition:

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes255 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: 0x00053535


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   114690047    57344000    7  HPFS/NTFS/exFAT
/dev/sda2       114690048   169768959    27539456   83  Linux
/dev/sda4   *   169771006  1953519615   891874305    5  Extended
/dev/sda5       172036096  1953519615   890741760    7  HPFS/NTFS/exFAT
/dev/sda6       169771008   171724799      976896   82  Linux swap / Solaris
/dev/sda7       171726848   172023807      148480   83  Linux



So have you read this: https://forums.opensuse.org/content/128-re-install-grub2-dvd-rescue.html

Here is some Partitioning info to read: Creating Partitions During Install for MBR and GPT Hard Disks - Blogs - openSUSE Forums

It appears you have installed the Grub boot loader into an Extended Partition sda4. This works with openSUSE and grub, but the Windows partition program will not work properly with that configuration and if used, can mess it up. If the openSUSE root / partition is loaded in an extended partition, sda5 or higher, the normal solution is to load grub into the MBR, but your old method could work if you resolve to never run the Windows partition program on this setup. Be very careful as you could render this hard disk such that a total reload may be required.

Thank You,

Is there a way i can fix this within the live suse iso which i have already on a usb?

EDIT: NVM, I’ve found the link https://forums.opensuse.org/content/146-using-livecd-take-over-repair-installed-system.html.

I just don’t understand what in my case would be the root partition since i have /boot in a own partition?

Thanks.

So give us an fdisk -l and df command from terminal from the live openSUSE media and it would be nice to see the /etc/fstab file from your openSUSE install. The su - may not be needed:

su -

fdisk -l

df

So, you can use the second link you found to get in a position to run the commands from the first, but we need more information to help. Did you run the Windows Partition program by chance?

Thank You,

I went through the steps, mounted and chroot /dev/sda2 which is my root partition. Everything good until i need to run

linux:/> grub2-mkconfig -o /boot/grub2/grub.cfg/usr/sbin/grub2-probe: error: failed to get canonical path of /dev/sda2. 

The issue i believe is because /boot is on dev/sda7 :mad:, which i’m also unable to mount for some reason :

linux:/> mount /boot/
mount: special device /dev/disk/by-id/ata-SAMSUNG_HD103SJ_S246J90Z913185-part7 does not exist

Or maybe i’m missing something else?

You did not tell what you did, so it is hard to say what you are missing. Show what you did step by step.

So if you booted from a LiveUSB, you already have a /boot folder. Anything to do with your original system would been to be mounted elsewhere. Meaning that there is a folder called boot on your root openSUSE install root partition and I guess you were mounting /dev/sda7 there in boot, but you must mount /dev/sda7 elsewhere when booting from a liveCD/USB drive. Further, having the root partition or the /boot partition on a logical drive normally means loading grub into the MBR.

Thank You,

Sorry, i was writing my last post at the time you posted this and i’ve missed it.

fdisk output:

linux:~ # fdisk -l


Disk /dev/sda: 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: 0x00053535


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   114690047    57344000    7  HPFS/NTFS/exFAT
/dev/sda2       114690048   169768959    27539456   83  Linux
/dev/sda4   *   169771006  1953519615   891874305    5  Extended
/dev/sda5       172036096  1953519615   890741760    7  HPFS/NTFS/exFAT
/dev/sda6       169771008   171724799      976896   82  Linux swap / Solaris
/dev/sda7       171726848   172023807      148480   83  Linux


Partition table entries are not in disk order


Disk /dev/sdb: 4009 MB, 4009754624 bytes
64 heads, 32 sectors/track, 3824 cylinders, total 7831552 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: 0x21e53f60


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          64     1900543      950240   83  Linux

/dev/sdb is the live usb i’m running now.

df output:Filesystem     1K-blocks    Used Available Use% Mounted ondevtmpfs          487784      16    487768   1% /dev
tmpfs             513856      80    513776   1% /dev/shm
tmpfs             513856    2912    510944   1% /run
/dev/sdb          949592  949592         0 100% /livecd
/dev/loop0       3551904 3114520    437384  88% /
tmpfs             513856       0    513856   0% /sys/fs/cgroup
tmpfs             513856    2912    510944   1% /var/lock
tmpfs             513856    2912    510944   1% /var/run

I’m guessing you mean the fstab from the installation i can’t access:

/dev/disk/by-id/ata-SAMSUNG_HD103SJ_S246J90Z913185-part6 swap                 s$
/dev/disk/by-id/ata-SAMSUNG_HD103SJ_S246J90Z913185-part2 /                    e$
/dev/disk/by-id/ata-SAMSUNG_HD103SJ_S246J90Z913185-part7 /boot                e$
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

I’m confused on which boot folder you’re referring. If you mean the one on my root partion where opensuse is installed (dev/sda2), the /boot folder there is empty because up-to installing Suse i set the /boot folder to be on a separate partion in dev/sda7. Where am i supposed to mount boot if i’m unable to rung grub2-mkconfig /boot/grub2/grub.cfg, since the grub to be repaired is in sda7?

Try with

mount /dev/sda7 /boot

then

Or replace those /dev/disk/by-id/ata-SAMSUNG_HD103SJ_S246J90Z913185-partX entries in your fstab by /dev/sda2, /dev/sda6 and /dev/sda7 respectively.

That did it! With some errors though, but i can log onto both suse and win, so it must’ve fixed. Thanks!

linux:~ # chroot /mnt
linux:/> mount /proc
linux:/> mount /sys     
linux:/> mount /dev/sda7 /boot
linux:/> grub2-mkconfig -o /boot/grub2/grub.cfg 
Generating grub.cfg ...
Found theme: /boot/grub2/themes/openSUSE/theme.txt
Found linux image: /boot/vmlinuz-3.7.10-1.4-default
Found initrd image: /boot/initrd-3.7.10-1.4-default
Found linux image: /boot/vmlinuz-3.7.10-1.1-default
Found initrd image: /boot/initrd-3.7.10-1.1-default
Found memtest image: /boot/memtest.bin
ERROR: opening path /mnt/sys/block
ERROR: failed to discover devices
ERROR: opening path /mnt/sys/block
ERROR: failed to discover devices
ERROR: opening path /mnt/sys/block
ERROR: failed to discover devices
ERROR: opening path /mnt/sys/block
ERROR: failed to discover devices
ERROR: opening path /mnt/sys/block
ERROR: failed to discover devices
ERROR: opening path /mnt/sys/block
ERROR: failed to discover devices
ERROR: opening path /mnt/sys/block
ERROR: failed to discover devices
  No volume groups found
done
linux:/> grub2-install /dev/sda
Installation finished. No error reported.

Any suggestions if can i do something now to prevent this in the future? Like getting /boot inside root, without doing a clean install? I don’t quite remember why i choose to dedicate a partition to /boot. I did this a few years ago, seen from someone or read somewhere it was safer and i’ve been running this type of setup ever since across multiple distros.

You did not mount /dev in chroot which explains why /dev/disk/… files were missing.

Please show

cat /boot/grub2/device.map
cat /etc/default/grub_installdevice
linux-jfbz:~ # cat /boot/grub2/device.map
(hd1)   /dev/disk/by-id/usb-General_USB_Flash_Disk_093000000000E1F6-0:0
(hd0)   /dev/disk/by-id/ata-SAMSUNG_HD103SJ_S246J90Z913185
linux-jfbz:~ # cat /etc/default/grub_installdevice
(hd0,7)
activate
generic_mbr

Hmm … looks like a bug, grub_installdevice points to partition 7 (/boot) which is impossible to boot from because it is logical partition. That explains boot failure after bootloader update. How long ago did you install your system? Logs from installation may still be present.

Anyway, now you have grub2 in MBR. So you should go into YaSY2 bootloader configuration and select booting from MBR and let it update configuration files. Verify that after that grub_installdevice contains (hd0) (not (jd0,7)) and that device.map still points (hd0) to your hard disk. You may also remove reference to USB flashdisk from device.map to keep it clean.

No, that’s not a bug. Well, maybe it is, but we would have to know more to determine this.

On one of my boxes, I have grub installed on “/boot” which is “/dev/sda6”.

If I set it up that way during install, then the installer wants to also install on the extended partition and set that active. I usually clear that, because I want to boot another way.

This works fine as long as you intend to chain-load boot using another grub, or you intend to boot from the Windows Boot manager, and add a copy of the boot sector to Windows.

If you installed with grub on “/boot” and booting from the extended partition, then it is a bug if reinstalling grub does not also update the extended partition. If you did not install to the extended partition, then it is your problem if you failed to update Windows Boot Manager. That is to say, it is a user bug, not an opensuse bug.

However, to emphasize a point I have previously made, reinstalling grub whenever “mkinitrd” is run causes problems for people who do this. And if they are using the Windows Boot Manager, they are probably naive users who won’t know that they must update the Windows Boot Manager after every “mkinitrd”.

The current value in grub_installdevice is wrong and result is

reinstalling grub does not also update the extended partition.

You are right. I tested installation with /boot and / on logical partitions. Installer suggested bootloader location on extended partition and it was installed this way and grub_installdevice also contained extended partition as well. So it appears like at some point bootloader location was changed to /boot manually.

What do you suggest can be done about it? Having bootloader on logical partition is by itself not impossible - may be user wants to chainload it from another bootloader? It is not possible if this is the only OS (or your primary OS) but how should installer know it?

May be YaST2 should indeed ask user “Do you want to boot directly into this installation?” and filter choices depending on this. Or at least bring up large red warning explaining in “layman speak” the implications of having this choice.

The more I look at it, the more I agree with Fedora choice to disallow anything except MBR. You do not need to install any boot sector to chainload bootloader from another operating system (well, not sure about Windows …) so basically there are two sensible choices - “Boot from MBR” (may be selecting device) or “Do not install bootloader”. You select the first on primary installation and the second in all other cases.

If I may interject my opinion here, I also suggest that installing Grub into the MBR be the only choice when Extended/Logical and Windows Partitions are being used together. Installing Grub into an Extended Primary partition is a booting solution that often falls in on its self like a house of cards. Running the Windows Partition program does not understand it and may corrupt it and perhaps even an openSUSE update though you think a manual choice may have caused the problem this time. Loading Grub into the MBR in a dual boot setup can prevent Windows from wanting to install a service pack and having a generic MBR and active partitions is an easier setup to recover back to Windows control from, but making an Extended Partition as an Active partition is a kind of fluky solution in my opinion. I can only say that having a recovery setup in the openSUSE DVD install disk which would allow the install of a generic MBR boot loader and the ability to select the Active boot partition is what I would provide over ever placing Grub into an Extended Partition and marking it active for booting. I would also prevent /boot from being loaded into an logical partition unless grub is in the MBR. Anyway, these are only my opinion on the subject for anyone able to make such changes to the openSUSE installer.

Thank You,

I would favor a Yast warning for this.

When I setup opensuse this way, I am surprised that there is no warning to the effect:
“The system will be unbootable unless you have set up some alternative way of boot, which typically requires expertise”.

I totally disagree. That was a terrible Fedora choice. And the reasoning behind it is nonsense.

I disagree.

However, I agree with that. And I try to avoid using the extended partition that way.

My most recent install had “/boot” as “/dev/sda6”, which is a logical partition. During install, I unchecked the flag to boot from the extended partition.

I’ll describe three systems that I use:

System 1: There are two linux installs. For one of them, “/boot” is “/dev/sda1” and for the other, “/boot” is “/dev/sda6”. I currently have “/dev/sda1” set as the active partition, and it happily chain loads to the other installed version if I choose to boot that.

System 2: There are two linux installs. For one of them, “/boot” is “/dev/sda1” and for the other “/boot” is “/dev/sda5”. I currently have Windows 7 set as the active partition, with entries in the Windows boot manager to boot either linux installation.

System 3: There are currently two linux install. For one of them (opensuse), “/boot” is “/dev/sda1”. For the other (Fedora 18), there is no separate “/boot”, and it boots from the MBR because of an unbelievably stupid decision made by Fedora.

Since opensuse is my primary system, it is annoying that I have to go through the Fedora boot manager every time. The worst thing is that the Fedora install made opensuse unbootable, until I modified the boot menu. This is because my opensuse system is in an encrypted LVM, and the “osprober” does not find it.