Emergency Boot - Including for Dual-Boot

From Info Wiki
Revision as of 22:44, 7 January 2014 by Rpeters (talk | contribs) (added work-arounds for grub 2)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

For General Users

Boot Only Rescue CD

The following CD can often succeed in booting a system which is failing to start from hard disk drive

  • rEFInd
  • Supergrub2

Either can boot most operating systems, including Linux, MacOSX and Windows

Try rEFInd for systems manufactured from early 2011 onwards. If it does not start on your computer then try Supergrub 2 Older computers are likely to require Supergrub 2

  1. Either CD is downloadable, at no cost, as a dotISO file.
  2. Use the following procedure to burn that file to a bootable CD
  3. Then insert the CD in the faulty computer and reboot
  4. enter Setup and move CDROM above HDD in the boot order, if necessary
  5. save changes and exit Setup
  6. after the CD boots menu items can be selected only via arrow keys - mouse does not work at this stage of boot
    • rEFInd should find all bootable operating systems and present an icon that is readily associated with each eg penguin, apple, flying windows
      • highlight the required one and press enter
    • Supergrub requires an additional step
      • select the first menu line and press Enter
      • it should then identify all bootable operating systems, by name
      • highlight the required one and press enter

Systems that don't boot via the above procedures can often still be recovered, but it gets technical. As described below

Getting Technical

GRUB (aka GRUB 2 )

GRUB 2 is now the most frequently used bootloader in Linux, but has many remaining issues. Some work-arounds:

"on-the-fly" Mode

GRUB 2 relies on a pre-defined config file /boot/grub(2)/grub.cfg. If this is not located, for any reason, GRUB 2 may boot to a grub> prompt. To boot from here use the following commands, substituting relevant drive and partition numbers:

grub> set root='hd0,gpt10'

grub> linux /boot/vmlinuz root=/dev/sda10

grub> initrd /boot/initrd

grub> boot

notes

  • drive numbers start from 0
  • must specify whether partitioned mbr or gpt
  • set root refers to location of partition containing /boot for the operating system to be booted
    • which will often also be the root file system for Linux
    • or merely the system partition for Win
    • partition numbers start from 1 (unlike in GRUB legacy)
  • this procedure is easiest if kernel & initrd have easily remembered names
    • either soft-link generic names or
    • press TAB to see possible names
  • ctrl-x or F10 may be pressed in lieu the "boot" command

The above procedure may be modified to cater for the situation where the menu is presented but the desired OS is not included or fails to boot. either

  • press e to edit a menu item or
  • press Esc to get to command line, then proceed as above.

Menu mode

See GRUB 2 downloadable manual or use "info grub2" to obtain details. Consistent themes amongst various documentation for GRUB 2 are that:

  • it is unreliable beyond the basics
  • OS-probe module is particularly so
  • not putting bootstrap in MBR (protective MBR in case of GPT) will

be problematic

Indeed, "info grub2" recommends avoid all automated installs & configs by distro. Instead, manually grub2-install then write a simple, static /boot/grub2/grub.cfg. See below for outline of this procedure.

As of Jan 2014 and following application of two patches to GRUB in openSUSE 13.1, its GRUB has been brought to ver 2.00-39.4.1. The automated process works well enough for most Linux plus Windows

It failed to find ArchLinux - which uses unusual names for kernels & initrd. Simple work-around for that is to add a 90_persistent section at the end of /boot/grub2/grub.cfg

### BEGIN /etc/grub.d/90_persistent ###

menuentry 'ArchLinux (<your descriptor>) { set root='hd<n>,gpt<n>' linux /boot/vmlinux-linux root=/dev/sd<x><n> initrd /boot/initramfs-linux.img }

### END /etc/grub.d/90_persistent ###

Essentially, the 90_persistent section gets copied verbatim during any subsequent manual or automated run of grub2-mkconfig. Note that this feature might be unique to openSUSE

The curly braces are essential and enclose GRUB2 commands.

This was for a HDD partitioned GPT. replace partition number with mbr<n> if applicable.

Multiple menuentries could be put in 90_persistent to cope with multiple Linuxes.


Headline text

==

Headline text

==