GRUB Legacy

GRUB Legacy - это текущая версия GRUB - стабильная версия, в настоящее время не разрабатывается. Это самодостаточный загрузчик, имеющий много пользователей и большое сообщество.

GRUB 2, сейчас pre-release - будет содержать много новых характеристик.

Поддержка GRUB Legacy

Если Вы пишете, или хотите писать код для GRUB Legacy, Вы можете найти статью "Hacking Grub for fun and profit" from Phrack Volume 0x0b, Issue 0x3f useful. Here's link: http://www.phrack.org/archives/63/p63-0x0a_Hacking_Grub.txt

Последовательная загрузка загрузочного CD из Grub

Это возможно используя memdisk из Sys/Isolinux project и образ загрузочного floppy из (заброшенного) SBM smart boot manager project.

Больше информации здесь: http://www.lrz.de/~bernhard/grub-chain-cd.html

Создание загрузочного floppy

Стандартный путь создания загрузочного floppy описан в Grub manual (создание floppy без файловой системы и без меню. Если Вы хотите иметь стандартную отформатированную floppy, Вы можете сделать следующее:

Скачайте текущую версию grub (legacy) отсюда ftp://alpha.gnu.org/gnu/grub/grub-0.97-i386-pc.tar.gz (0.97 текущая версия Grub legacy на 16-Jan-2006).

Распакуйте grub-0.97-i386-pc.tar.gz и разместите его содержание на floppy (can be e.g. ext2 or VFAT). Это содержит дерево каталогов с файлами в /boot/grub/.

Теперь Вы должны загрузить компьютер используя Grub. Есть несколько возможностей для этого, наиболее известная:

Kanotix-CD

другие ситемы также используют Grub в их installation.

Или Вы можете создать bootable floppy without file system by following the instructions in the Grub manual, which I repeat here:

Save stage1 and stage2 to some place, where you can access them later. Take a second floppy and put stage1 immediately followed by stage2 on the first sectors of that floppy:

# dd if=stage1 of=/dev/fd0 bs=512 count=1
# dd if=stage2 of=/dev/fd0 bs=512 seek=1

Then you can boot the second floppy (without file system). It should put you into Grub command line mode.

Now the important step: swap flopies, i.e. pull out the floppy without the file system and exchange it with the floppy with the FAT file system and grub files on it and tell grub

root (fd0)
setup (fd0)

now Grub should setup the floppy with the file system correctly.

You can leave the floppy in the PC and reboot for a test or you can tell Grub to load the boot sector from the floppy and boot it interactively

chainload (fd0)+1
boot

GRUB for Linux

Linux Distros

Troubleshooting

Grub hangs at Stage1.5 or Stage2

After bios POST, you see:

Grub loading Stage1.5
Grub loading, please wait...

And then grub hangs up indefinetely. Also, you may see this message followed by a hang up.

Loading stage2 ....

This may happen due to corrupt files in /boot/grub directory. You can use a rescue CD to boot, and then chroot to the root partition with /boot mounted. Move all the files except menu.lst and grub.conf out of /boot/grub. Then run grub-install on the drive. This should repopulate the /boot/grub folder with the appropriate files.

The following example assumes you have your root partition on /dev/hda1, and /boot on /dev/hda2. And grub will be installed on the MBR of /dev/hda.

mount /dev/hda1 /mnt/sysimage
mount /dev/hda2 /mnt/sysimage/boot
chroot /mnt/sysimage
mv /boot/grub /boot/grub.old
mkdir /boot/grub
cp /boot/grub/menu.lst /boot/grub
cp /boot/grub/grub.conf /boot/grub
grub-install /dev/hda

Eltorito bootable CD drops into GRUB shell

If you followed the GrubBootableCDHowto, you may find your CD always booting into the grub shell. The right behaviour should be to drop into the menu if you specify one in menu.lst.

The problem might be from the way distributions changed their grub releases. Some like Fedora for instance, use grub.conf instead of menu.lst as the place to look for menu. Hence, you should put a grub.conf in the /boot/grub directory instead of menu.lst as described in the HOWTO.

Note: Symlinking grub.conf to menu.lst won't help, as GRUB doesn't understand symlinks on ISO9660 (CD filesystem).

GrubWiki: GrubLegacyRu (last edited 2007-05-12 03:50:54 by host-39-222)