Boot Loader:grub Advanced [Turn]

Source: Internet
Author: User
Tags password protection

Boot Loader:grub Advanced

This document records some of the advanced configuration of Grub

VGA configuration for core functions

In fact, your tty1~tty6 in addition to the resolution of 80x24, but also can have other resolution support Oh! But the premise is that your core must support framebuffer_console this core feature option. How do you determine if there is support? You can check the/boot/config-2.6.18-92.el5 file and search for it:

[[email protected] ~]# grep ' framebuffer_console '/boot/config-2.6.18-92.el5config_framebuffer_console=y# this item if it appears y That's a support! If it is annotated or n, it is not supported!
Color \ Resolution 640x480 800x600 1024x768 1280x1024 Bit
256 769 771 773 775 8 bit
32768 784 787 790 793 -bit
65536 785 788 791 794 -bit
16.8M 786 789 792 795 + bit

So how to adjust the resolution of Tty1 ~ Tty6 terminal? Please refer to the table below (this is a 10-digit value):

If you want to adjust the resolution of your terminal screen to 1024x768, and the color depth is 15bit color, you have to specify vga=790 that number! For example, when Brother Bird's tty1 wants such resolution, you can do this:

[Email protected] ~]# vim/boot/grub/menu.lst .... (omitted before) .... Title CentOS (2.6.18-92.el5)        root (hd0,0)        kernel/vmlinuz-2.6.18-92.el5 ro root=label=/1 rhgb quiet vga=790        initrd/initrd-2.6.18-92.el5.img .... (omitted later) ....

Restart and select this menu to enter Linux, you run to Tty1 to see, Hey! is already the resolution of 1024x768 Luo! Only the words will be small, but the scope of the screen will be increased just. However, some editions support a 16-bit system, so you need to change the format! The values in the table above should be used in general. However, due to different operating systems and hardware may be the case, so the above value is not necessarily able to test the success of your machine, it is recommended that you can configure a look miles to find the value you can use! ^_^

The BIOS cannot read the problem with a large hard drive

Today's hard disk capacity is growing, if you use the old motherboard to insert large-capacity hard disk, may be due to the system BIOS or other problems, the BIOS can not determine the capacity of the hard disk, at this time your system read may be a problem. Why is it?

We talked about the start-up process at the beginning of this chapter, when entering the Linux core function, he will proactively detect the entire system, so the BIOS can not catch the hardware in the Linux core may be able to catch and normal use. For example, many friends in the past often found, " my system use DVD boot installation, you can install Linux smoothly, but the first time when the screen appears only a dark one, and appear grub> words, and can not enter the Linux system", what is the matter?

    • In the process of installation, because it is started with a DVD or CD, so loading the Linux core is not a problem, and the core will be to detect the system hardware, so you can catch the BIOS cannot catch the hard disk, at this time you can install Linux on a large-capacity hard disk, and there is no problem.

    • However, as the kernel and INITRD files are read through the BIOS's INT 13 channels when entering the hard drive, your kernel and INITRD cannot be loaded by the system if it is placed in a magnetic area that cannot be determined by the BIOS, but only the grub s Hell (grub>) is waiting for your treatment.

More GRUB error code queries can be found at the bottom of the link:

    • Http://orgs.man.ac.uk/documentation/grub/grub_toc.html#SEC_Contents

Now you know where the problem lies! That is , the BIOS cannot read the kernel and INITRD files in the bulk disk. How to solve it? Very simple! Let the kernel and initrd files be placed at the forefront of the large hard drive, since the BIOS can read at least 1024 of the data in the large disk, so it can read the file ROM of the core and virtual file system. So how do you get kernel and initrd to the front of the entire hard drive? Simple and deadly! Create a/ boot stand-alone split slot and put the/boot to the front!

What if you have installed Linux and have the above problems? You can do this:

    • The simplest way to do this is to re-pour directly, and make a partition that is mounted on/boot, while confirming that the partition is before the cylinder.

    • If you really do not want to re-pour, no matter, using the Grub feature we just mentioned, create a bootable floppy disk, or boot directly to the CD drive, and then go to Linux with the ability to write to grub.

    • Another way is to cheat the BIOS, directly to the hard disk cylinder, head, sector and so on the information directly into the BIOS, so that your BIOS may be able to read and support to your large hard drive.

However, Brother Bird is still recommended that you can reinstall, and make A/boot this partition! ^_^! This is also why the more version, Bird Brother special emphasis on the division of/boot This partition slot reason Ah!

add a password to individual menus

Imagine an environment where if you are running a computer classroom and this computer classroom is open to the outside world, but you are worried that some partition are being accidentally messed up by students, you may want to protect certain boot menus. At this point, it's a viable option to encrypt the password for each menu! How to provide password protection in the boot process? First, you have to create a password, and it needs to be encrypted! Or else they'll run to/boot/grub/menu.lst, and they'll be able to sniff your boot password? So how do you create an encrypted password? We can deal with the MD5 encoding provided by GRUB, as follows:

[Email protected] ~]# grub-md5-cryptpassword: <== Enter password Retype password: <== and enter $1$kvli0/$byrbNgkt/. REKPQdfg287. <== this is the resulting MD5 password!

In the case of the above table, our two menus entered the password is not the same, you can do the classification of classmates! However, this also creates a problem, it is necessary to enter the password to be able to enter the startup process, if you are remotely using reboot reboot, and there is no one in front of the host .... Your host does not actively enter the startup program Oh! ^_^ the last line generated above, starting from $ to. The end of the line, is your password after MD5 code after the boom! Copy this password! Suppose we want to add the first option to this password, and the fourth option to add a different password, you should do this:

[Email protected] ~]# vim/boot/grub/menu.lst .... (omitted previously) .... Title CentOS (2.6.18-92.el5)        password--md5 $1$kvli0/$byrbNgkt/. REKPQdfg287.        Root (hd0,0)        kernel/vmlinuz-2.6.18-92.el5 ro root=label=/1 rhgb quiet vga=790        initrd/ Initrd-2.6.18-92.el5.img .... (middle omitted) .... title Single user mode        password--md5 $1$gfni0/$UuiZc/7snugltvn4j/wym/        root (hd0,0)        kernel/ Vmlinuz-2.6.18-92.el5 ro root=label=/1 rhgb quiet single        initrd/initrd-2.6.18-92.el5.img

What you have to note is:password This project must be in the first line under the title. However, this feature can still be cracked, because the user through the editing mode (e) To enter the menu, and delete the password field and press B to be able to start the process! It's awful! What do you do? Had to go through the whole password (before all the title), and then the first line under the title to configure the lock, the user wants to edit, also need to enter a password! The configuration is a bit like this:

[Email protected] ~]# Vim/boot/grub/menu.lstdefault=0timeout=30password--md5 $1$kvli0/$byrbNgkt/. REKPQdfg287.  <== placed in the overall configuration splashimage= (hd0,0)/grub/splash.xpm.gz#hiddenmenutitle CentOS (2.6.18-92.EL5)        lock  <== More lock-Dead feature        root (hd0,0)        kernel/vmlinuz-2.6.18-92.el5 ro root=label=/1 rhgb quiet vga=790        initrd/ Initrd-2.6.18-92.el5.img

Then after restarting, the screen will look like this:

You can see only the function of p at the bottom, since the 2, 3, 4 menus do not use lock, so these three menu users can still run the launcher, but the first menu has a lock project, so unless you enter the correct password, the first menu cannot be loaded and run. In addition, this project can also avoid your menu.lst in the process of the start of the change, is a confidential menu.lst function! Unlike the new menu password feature.

Transfer from HTTP://VBIRD.DIC.KSU.EDU.TW/LINUX_BASIC/0510OSLOADER_3.PHP#GRUB_VGA

Boot Loader:grub Advanced [Turn]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.