GRUB Legacy: Difference between revisions
[unchecked revision] | [unchecked revision] |
Content deleted Content added
m Fixing incorrect commands for GRUB in FC. |
mNo edit summary |
||
(15 intermediate revisions by 11 users not shown) | |||
Line 1:
{{You}}
GRUB stands for GRand Unified Bootloader and is a [[bootloader]] and the reference implementation of the [[Multiboot|Multiboot Specification]]. GRUB can boot any Multiboot-compliant OS (e.g. Hurd, [http://grub.enbug.org/MultibootSystems among others]), however it can also boot some non-Multiboot-compliant OSes, e.g. Windows, via a chain-loading function, and some others via special support, e.g. Linux. mbchk can be used to determine if a file is Multiboot-compliant.
This article concentrates on GRUB Legacy. Information regarding modern [[GRUB
==Features==
Line 32 ⟶ 33:
Remove the boot disk from the floppy drive and insert the auxiliary disk. The files <code>stage1</code> and <code>stage2</code> from the GRUB distribution must be written to this disk, to sector 0 and sector 1+ respectively. In your shell (for Windows users, this means the [[Cygwin]] shell), type:
<
dd if=<stage1> of=/dev/fd0 bs=512 count=1
dd if=<stage2> of=/dev/fd0 bs=512 seek=1
</syntaxhighlight>
Now GRUB will be able to boot stage1 and stage2 from this disk. We cannot use it as our boot disk, though, since writing stage2 to sector 1 destroyed the floppy's format structure (you can't write files to the disk anymore, and any previously written <code>boot</code> directory could no longer be found). That's why we will now set up the other disk to boot GRUB and have a valid structure.
Line 44 ⟶ 45:
GRUB will boot into its command shell. (If your system does boot from hard drive instead, check your BIOS boot drive settings.) When the <code>grub ></code> prompt appears, remove the auxiliary disk from the drive and replace the boot disk. From the GRUB shell, you can now complete the installation on the boot disk:
<
install (fd0)/boot/stage1 (fd0) (fd0)/boot/stage2 (fd0)/boot/menu.cfg
</syntaxhighlight>
The parameters tell GRUB:
Line 73 ⟶ 74:
===Installing to USB===
'''NOTE''': I have tried many tools to install GRUB onto a USB device under windows, however, I have not been able to figure out how. So, to install, either use a Linux distro on your PC of use a Linux Live CD.
Putting GRUB onto a USB device is as easy as following the above example of installing to a standard hard disk. There is one extra step involved, finding out under which mount point
If you need to mount your USB device: (Exchange <code>sdb1</code> with your device name.)
<
mkdir /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
</syntaxhighlight>
Create required directories:
<
mkdir /mnt/sdb1/boot
mkdir /mnt/sdb1/boot/grub
</syntaxhighlight>
Locate the <code>stage1</code>, <code>stage2</code>, and <code>*_stage1_5</code> files:
<
find / -name stage1
</syntaxhighlight>
Copy stage1 and stage2 files, <code>/usr/lib/grub/</code> is an example location, use the location returned by the find command:
<
cp /usr/lib/grub/stage1 /mnt/sdb1/boot/grub/stage1
cp /usr/lib/grub/stage2 /mnt/sdb1/boot/grub/stage2
</syntaxhighlight>
For FAT formatted USB device use:
<
cp /usr/lib/grub/fat_stage1_5 /mnt/sdb1/boot/grub/fat_stage1_5
</syntaxhighlight>
For ext2 formatted USB device use:
<
cp /usr/lib/grub/e2fs_stage_1_5 /mnt/sdb1/boot/grub/e2fs_stage_1_5
</syntaxhighlight>
Then execute the GRUB install application:
<
sudo grub
</syntaxhighlight>
Enter the following commands:
<
root (hd1,1)
setup (hd1)
quit
</syntaxhighlight>
if you don't know where
===Installing to hard disk===
Line 138 ⟶ 139:
==Load your kernel over network (TFTP)==
{{FirstPerson|section=1}}
You can also use GRUB's builtin network support to increase your build/test turn around time. You can boot another machine with a kernel directly from your build directory without having to copy it over manually. See also, [http://www.gnu.org/software/grub/manual/html_node/General-usage-of-network-support.html#General-usage-of-network-support How to set up your network] in the official GRUB manual.
Line 145 ⟶ 147:
Run
<
./configure --help
</syntaxhighlight>
to see a list of options. In my case, I use Netgear tulip cards, so I execute:
<
./configure --enable-tulip
make
make install
</syntaxhighlight>
You may want to consider using the <code>--prefix</code> option if you don't want to overwrite your existing GRUB install or do not have root access.
Line 188 ⟶ 190:
And that should be it. If you're not running DHCP you can use <code>ifconfig</code> to manually set addresses, gateways, etc. Your can also use the BOOTP or RARP protocol.
==Other loaders that are Multiboot compliant==
Line 292 ⟶ 197:
===Wiki Pages===
*[[Grub Error 13]]
*[[Multiboot]]
===Tutorials===
Line 299 ⟶ 205:
*[[Topic:9548|Switching back to real mode from GRUB]]
*[[Topic:9586|Setting boot-time graphic video mode with GRUB]]
*[[Topic:
===External Links===
Line 308 ⟶ 214:
[[Category:Bootloaders]]
[[Category:GRUB]]
[[de:Grand Unified Bootloader]]
|