Difference between revisions of "GRUB Legacy"

From ArchWiki
Jump to: navigation, search
Line 59: Line 59:
 
#  for more details and different resolutions see
 
#  for more details and different resolutions see
 
#  https://wiki.archlinux.org/index.php/GRUB#Framebuffer_Resolution
 
#  https://wiki.archlinux.org/index.php/GRUB#Framebuffer_Resolution
 
== Troubleshooting ==
 
 
=== /boot/grub/stage1 not read correctly ===
 
If you see this error message while trying to set up GRUB, and you are not using a fresh partition table, it is worth checking it.
 
 
# fdisk -l /dev/sda
 
 
This will show you the partition table for {{ic|/dev/sda}}. So check here, whether the "Id" values of your partitions are correct.
 
The "System" column will show you the description of the "Id" values.
 
 
If your boot partition is marked as being "HPFS/NTFS", for example, then you have to change it to "Linux". To do this, go to fdisk,
 
 
# fdisk /dev/sda
 
 
change a partition's system id with [t], select you partition number and type in the new system id (Linux = 83).
 
You can also list all available system ids by typing "L" instead of a system id.
 
 
If you have changed a partitions system id, you should [v]erify your partition table and then [w]rite it.
 
 
Now try to set up GRUB again.
 
 
[[https://bbs.archlinux.org/viewtopic.php?pid=799930 Here]] is the forum post reporting this problem.
 
 
=== Accidental install to a Windows partition ===
 
 
If you accidentally install GRUB to a Windows partition, GRUB will write some information to the boot sector of the partition, erasing the reference to the Windows bootloader. (This is true for NTLDR the bootloader for Windows XP and earlier, unsure about later versions).
 
 
To fix this you will need to use the Windows Recovery Console for your Windows release.  Because many computer manufacturers do not include this with their product (many choose to use a recovery partition) Microsoft has made them available for download. If you use XP, look at [http://tips.vlaurie.com/2006/05/recovery-console-for-those-without-an-xp-disk/ this page] to be able to turn the floppy disks to a Recovery CD.  Boot the Recovery CD (or enable Windows Recovery mode) and run {{ic|fixboot}} to repair the partition boot sector.  After this, you will have to install GRUB again---this time, to the MBR, not to the Windows partition---to boot Linux.
 
 
See [[MBR#Restoring a Windows boot record|further discussion here]].
 
 
=== Edit GRUB entries in the boot menu ===
 
 
Once you have selected and entry in the boot menu, you can edit it by pressing key {{Keypress|e}}. Use tab-completion if you need to to discover devices then {{Keypress|Esc}} to exit. Then you can try to boot by pressing {{Keypress|b}}.
 
{{Note|These settings '''will not be saved'''.}}
 
 
=== device.map error ===
 
 
If an error is raised mentioning {{ic|/boot/grub/device.map}} during installation or boot, run:
 
 
# grub-install --recheck /dev/sda
 
 
to force GRUB to recheck the device map, even if it already exists. This may be necessary after resizing partitions or adding/removing drives.
 
 
=== KDE reboot pull-down menu fails ===
 
 
If you have opened a sub-menu with the list of all operating systems configured in GRUB, selected one, and upon restart, you still booted your default OS, then you might want to check if you have the line:
 
 
default saved
 
 
in {{ic|/boot/grub/menu.lst}}.
 
 
=== GRUB fails to find or install to any virtio ''/dev/vd*'' or other non-BIOS devices ===
 
I had trouble installing GRUB while installing Arch Linux in an virtual KVM machine using a virtio device for hard drive. To install GRUB, I figured out the following:
 
Enter a virtual console by typing {{Keypress|Ctrl+Alt+F2}} or any other F-key for a free virtual console.
 
This assumes that your root file system is mounted in the folder {{ic|/mnt}} and the boot file system is either mounted or stored in the folder {{ic|/mnt/boot}}.
 
 
1. Assure that all needed GRUB files is present in your boot directory (assuming it is mounted in {{ic|/mnt/boot}} folder), by issuing the command:
 
 
# ls /mnt/boot/grub
 
 
2. If the {{ic|/mnt/boot/grub}} folder already contains all the needed files, jump to step 3. Otherwise, do the following commands (replacing {{ic|/mnt}}, {{ic|your_kernel}} and {{ic|your_initrd}} with the real paths and file names). You should also have the {{ic|menu.lst}} file written to this folder:
 
 
# mkdir -p /mnt/boot/grub                # if the folder is not yet present
 
# cp -r /boot/grub/stage1 /boot/grub/stage2 /mnt/boot/grub
 
# cp -r your_kernel your_initrd /mnt/boot
 
 
3. Start the GRUB shell with the following command:
 
 
# grub --device-map=/dev/null
 
 
4. Enter the following commands. Replace {{ic|/dev/vda}}, and {{ic|(hd0,0)}} with the correct device and partition corresponding to your setup.
 
 
device (hd0) /dev/vda
 
root (hd0,0)
 
setup (hd0)
 
quit
 
 
5. If GRUB reports no error messages, then you probably are done. You also need to add appropriate modules to the ramdisk. For more information, please refer to the KVM guide on [[KVM#Preparing_an_.28Arch.29_Linux_guest|Preparing an (Arch) Linux guest]]
 
  
 
==See also==
 
==See also==

Revision as of 16:18, 7 June 2013

Summary help replacing me
Covers various aspects of Arch Linux's default bootloader, the GRand Unified Bootloader (GRUB).
Overview
Template:Boot process overview
Related
Boot Debugging
grub-gfx
Kernel parameters

GRUB Legacy is a multiboot bootloader previously maintained by the GNU Project. It was derived from GRUB, the GRand Unified Bootloader, which was originally designed and implemented by Erich Stefan Boleyn.

Briefly, the bootloader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the Linux kernel. The kernel, in turn, initializes the rest of the operating system.

Note: GRUB Legacy has been deprecated and replaced by GRUB version 2.x in Arch Linux. See the news here. Users are recommended to switch to GRUB2 or Syslinux instead. See #Upgrading to GRUB2 below.

Installation

GRUB Legacy has been dropped from the official repositories in favor of GRUB version 2.x. grub-legacyAUR is still available from the AUR.

Additionally, GRUB must be installed to the boot sector of a drive or partition to serve as a bootloader. This is covered in the #Bootloader installation section.

Upgrading to GRUB2

Is upgrading necessary?

The short answer is No. GRUB legacy will not be removed from your system and will stay fully functional.

However, as any other packages which are not supported anymore, bugs are unlikely to be fixed. So you should consider upgrading to GRUB version 2.x, or one of the other supported Boot Loaders.

GRUB legacy does not support GPT disks, Btrfs filesystem and UEFI firmwares.

How to upgrade

Upgrade from GRUB Legacy to GRUB version 2.x is the much same as installing GRUB on a running Arch Linux. Detailed instructions is covered here.


  1. FRAMEBUFFER RESOLUTION SETTINGS
  2. +-------------------------------------------------+
  3. | 640x480 800x600 1024x768 1280x1024
  4. ----+--------------------------------------------
  5. 256 | 0x301=769 0x303=771 0x305=773 0x307=775
  6. 32K | 0x310=784 0x313=787 0x316=790 0x319=793
  7. 64K | 0x311=785 0x314=788 0x317=791 0x31A=794
  8. 16M | 0x312=786 0x315=789 0x318=792 0x31B=795
  9. +-------------------------------------------------+
  10. for more details and different resolutions see
  11. https://wiki.archlinux.org/index.php/GRUB#Framebuffer_Resolution

See also