GRUB: Difference between revisions
No edit summary |
No edit summary |
||
| Line 38: | Line 38: | ||
==== Standard ==== | ==== Standard ==== | ||
{{File|/etc/default/grub| | |||
<pre> | |||
GRUB_DEFAULT="GNU/Linux, current kernel" | |||
</pre> | |||
}} | |||
{{File|/etc/grub.d/40_custom| | |||
<pre> | <pre> | ||
# | #!/bin/sh | ||
menuentry | exec tail -n +3 $0 | ||
# This file provides an easy way to add custom menu entries. Simply type the | |||
# menu entries you want to add after this comment. Be careful not to change | |||
# the 'exec tail' line above. | |||
menuentry 'GNU/Linux, current kernel' --class gnu-linux --class gnu --class os { | |||
load_video | |||
insmod gzio | |||
insmod part_msdos | |||
insmod ext2 | insmod ext2 | ||
set root='(hd0, | set root='(hd0,msdos1)' | ||
search --no-floppy --fs-uuid --set | search --no-floppy --fs-uuid --set=root 5e056c75-61b4-42a5-8dd8-9fefd5f5b7fb | ||
echo Loading Linux ... | echo 'Loading Linux ...' | ||
linux /vmlinuz root=/dev/sda3 ro | linux /vmlinuz root=/dev/sda3 ro init=/sbin/bootchartd | ||
} | } | ||
menuentry | menuentry 'GNU/Linux, current kernel (recovery mode)' --class gnu-linux --class gnu --class os { | ||
load_video | |||
insmod gzio | |||
insmod part_msdos | |||
insmod ext2 | insmod ext2 | ||
set root='(hd0, | set root='(hd0,msdos1)' | ||
search --no-floppy --fs-uuid --set | search --no-floppy --fs-uuid --set=root 5e056c75-61b4-42a5-8dd8-9fefd5f5b7fb | ||
echo Loading Linux ... | echo 'Loading Linux ...' | ||
linux /vmlinuz root=/dev/sda3 ro single | linux /vmlinuz root=/dev/sda3 ro single | ||
} | } | ||
menuentry | menuentry 'GNU/Linux, previous kernel' --class gnu-linux --class gnu --class os { | ||
load_video | |||
insmod gzio | |||
insmod part_msdos | |||
insmod ext2 | insmod ext2 | ||
set root='(hd0, | set root='(hd0,msdos1)' | ||
search --no-floppy --fs-uuid --set | search --no-floppy --fs-uuid --set=root 5e056c75-61b4-42a5-8dd8-9fefd5f5b7fb | ||
echo Loading Linux ... | echo 'Loading Linux ...' | ||
linux /vmlinuz root=/dev/sda3 ro | linux /vmlinuz.old root=/dev/sda3 ro | ||
} | } | ||
menuentry | menuentry 'GNU/Linux, previous kernel (recovery mode)' --class gnu-linux --class gnu --class os { | ||
load_video | |||
insmod gzio | |||
insmod part_msdos | |||
insmod ext2 | insmod ext2 | ||
set root='(hd0, | set root='(hd0,msdos1)' | ||
search --no-floppy --fs-uuid --set | search --no-floppy --fs-uuid --set=root 5e056c75-61b4-42a5-8dd8-9fefd5f5b7fb | ||
echo Loading Linux ... | echo 'Loading Linux ...' | ||
linux /vmlinuz root=/dev/sda3 ro single | linux /vmlinuz.old root=/dev/sda3 ro single | ||
} | } | ||
</pre> | </pre> | ||
}} | |||
==== cciss ==== | ==== cciss ==== | ||
{{File|/etc/grub.d/40_custom| | |||
<pre> | <pre> | ||
# | #!/bin/sh | ||
menuentry ' | exec tail -n +3 $0 | ||
# This file provides an easy way to add custom menu entries. Simply type the | |||
# menu entries you want to add after this comment. Be careful not to change | |||
# the 'exec tail' line above. | |||
menuentry 'GNU/Linux, current kernel' --class gnu-linux --class gnu --class os { | |||
load_video | load_video | ||
insmod gzio | |||
insmod part_msdos | insmod part_msdos | ||
insmod ext2 | insmod ext2 | ||
| Line 87: | Line 113: | ||
linux /vmlinuzo root=/dev/cciss/c0d0p3 ro | linux /vmlinuzo root=/dev/cciss/c0d0p3 ro | ||
} | } | ||
menuentry ' | menuentry 'GNU/Linux, current kernel (recovery mode)' --class gnu-linux --class gnu --class os { | ||
load_video | load_video | ||
insmod gzio | |||
insmod part_msdos | insmod part_msdos | ||
insmod ext2 | insmod ext2 | ||
| Line 96: | Line 123: | ||
linux /vmlinuz root=/dev/cciss/c0d0p3 ro single | linux /vmlinuz root=/dev/cciss/c0d0p3 ro single | ||
} | } | ||
menuentry ' | menuentry 'GNU/Linux, previous kernel' --class gnu-linux --class gnu --class os { | ||
load_video | load_video | ||
insmod gzio | |||
insmod part_msdos | insmod part_msdos | ||
insmod ext2 | insmod ext2 | ||
| Line 105: | Line 133: | ||
linux /vmlinuz.old root=/dev/cciss/c0d0p3 ro | linux /vmlinuz.old root=/dev/cciss/c0d0p3 ro | ||
} | } | ||
menuentry ' | menuentry 'GNU/Linux, previous kernel (recovery mode)' --class gnu-linux --class gnu --class os { | ||
load_video | load_video | ||
insmod gzio | |||
insmod part_msdos | insmod part_msdos | ||
insmod ext2 | insmod ext2 | ||
| Line 114: | Line 143: | ||
linux /vmlinuz.old root=/dev/cciss/c0d0p3 ro single | linux /vmlinuz.old root=/dev/cciss/c0d0p3 ro single | ||
} | } | ||
</pre> | </pre> | ||
}} | |||
Revision as of 16:56, 31 August 2011
GRUB 2
Packages
Exherbo: sys-boot/grub
Gentoo: sys-boot/grub
Installation
Install grub after mounting /boot.
Standard installation:
HP Server /dev/cciss installation:
/sbin/grub-setup: warn: Your embedding area is unusually small. core.img won't fit in it.. /sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged.. /sbin/grub-setup: error: will not proceed with blocklists.
/sbin/grub-setup: warn: Your embedding area is unusually small. core.img won't fit in it.. /sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged.. Installation finished. No error reported.
Configuration
Standard
GRUB_DEFAULT="GNU/Linux, current kernel"
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'GNU/Linux, current kernel' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 5e056c75-61b4-42a5-8dd8-9fefd5f5b7fb
echo 'Loading Linux ...'
linux /vmlinuz root=/dev/sda3 ro init=/sbin/bootchartd
}
menuentry 'GNU/Linux, current kernel (recovery mode)' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 5e056c75-61b4-42a5-8dd8-9fefd5f5b7fb
echo 'Loading Linux ...'
linux /vmlinuz root=/dev/sda3 ro single
}
menuentry 'GNU/Linux, previous kernel' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 5e056c75-61b4-42a5-8dd8-9fefd5f5b7fb
echo 'Loading Linux ...'
linux /vmlinuz.old root=/dev/sda3 ro
}
menuentry 'GNU/Linux, previous kernel (recovery mode)' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 5e056c75-61b4-42a5-8dd8-9fefd5f5b7fb
echo 'Loading Linux ...'
linux /vmlinuz.old root=/dev/sda3 ro single
}
cciss
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'GNU/Linux, current kernel' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root b3727853-ae78-4a00-b21c-7b974c233e1c
echo 'Loading Linux ...'
linux /vmlinuzo root=/dev/cciss/c0d0p3 ro
}
menuentry 'GNU/Linux, current kernel (recovery mode)' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root b3727853-ae78-4a00-b21c-7b974c233e1c
echo 'Loading Linux ...'
linux /vmlinuz root=/dev/cciss/c0d0p3 ro single
}
menuentry 'GNU/Linux, previous kernel' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root b3727853-ae78-4a00-b21c-7b974c233e1c
echo 'Loading Linux ...'
linux /vmlinuz.old root=/dev/cciss/c0d0p3 ro
}
menuentry 'GNU/Linux, previous kernel (recovery mode)' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root b3727853-ae78-4a00-b21c-7b974c233e1c
echo 'Loading Linux ...'
linux /vmlinuz.old root=/dev/cciss/c0d0p3 ro single
}
Updating Grub 2
Serial Console
GRUB_TERMINAL=serial GRUB_SERIAL=COMMAND="serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1" GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,57600"
If you want to be able to login to your system via the serial console you need to edit /etc/inittab.
Uncomment the s0 entry and change the speed to your needs.
# SERIAL CONSOLES s0:12345:respawn:/sbin/agetty 57600 ttyS0 vt100 #s1:12345:respawn:/sbin/agetty 9600 ttyS1 vt100