In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to write the configuration file menu.lst of GRUB. I hope you will get something after reading this article. Let's discuss it together.
Menu.lst is located in / boot/grub/menu.lst, and / boot/grub/grub.conf is equivalent to a shortcut for menu.lst under windows (after reinstalling the system sometimes destroys GRUB, when menu.lst is lost and cannot start the GRUB menu, you need to establish a menu.lst under / boot and then establish a link with grub.conf to repair it. The link is: ln-s menu.lst grub.conf (pay attention to the relationship between the two files). Let's learn how to write the configuration file menu.lst. GRUB.
First, let's take a look at the contents of / boot/grub/menu.lst:
Default=0
Timeout=5
# splashp_w_picpath= (hd0,6) / boot/grub/splash.xpm.gz
Hiddenmenu
Title Fedora Core (2.6.11-1.1369_FC4)
Root (hd0,6)
Kernel / boot/vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/
Initrd / boot/initrd-2.6.11-1.1369_FC4.img
Title Windows XP
Rootnoverify (hd0,0)
Chainloader + 1
Where:
A _
Represents the operating system that starts by default. In GRUB, title defines the operating system to boot, starting with the first, 0 in GRUB, 1 in GRUB, and so on.
BJR timeoutbound 5
Indicates the time to enter the operating system set by default without operation after the GRUB interface appears. If you move the selection up and down, this option is invalid.
Cmaine splashpacks wrought picpathies = (hd0,6) / boot/grub/splah.xpm.gz
Represents the path of the allowed GRUB background, obviously (hd0,6) specifies the partition (I don't know if it can be explained in this way, hehe), and then the normal path (in this case, annotate it with # as an option)
D,hiddenmenu
Indicates that the startup menu of hidden GRUB is entered directly into the operating system of the default temple as an option.
Linux class
Its format is generally as follows:
Title (.)
Root (hd [0murn], x)
Kernel (.)
Initrd (.)
Where:
Title line, is to define a boot operating system, and then you can write down your favorite name, oh, of course, at least you have to write it yourself, there is no need to write linux as windows?
Root line, specify all / boot of the corresponding linux. If it is not mounted separately when writing and mounting the partition, then hd [0murn] represents the number of hard disks in the same partition, while x represents [partition-1], that is, x is 1 smaller than the partition number.
The kernel line, which starts with kernel, specifies the absolute path where the Linux kernel file is located (see the full name of the kernel by entering the command: ls / boot/vmlinuz* at the terminal) Because the kernel is in the / boot directory, and if / boot is a separate partition, boot needs to be omitted, because the partition of / boot is specified in root (hd [0murn], x), so there is no need to indicate which partition the kernel is in; ro means read-only; root=LABEL=/ represents the partition where the root of Linux is located. LABEL=/: this is the label added after the hard disk partition is formatted into the corresponding file system; if you don't know what a label is, you can also express it directly as / dev/hd [a Murz] X or / dev/sd [a Muz] X; it depends on which partition your Linux is in. For example, mine is on / dev/hda3, then it can be written as root=/dev/hda3 here.
Initrd line, if / boot is a separate partition, initrd line should omit / boot; if / boot is not in a partition, but in the same partition as Linux / partition, it should not be omitted; we write this line of code by looking at what the file name of initrd in / boot is, and enter: ls / boot/initrd* at the terminal
It is easy to get the initrd file name and write it.
After knowing the above, it is easy for us to understand another way of writing:
Title (.)
Kernel (hd [0murn], y) (/ boot). Ro root=.
Initrd (hd [0murn], y) (/ boot).
In fact, the omitted root is actually written in the kernel and initrd lines.
Attached:
In fact, when the GRUB startup menu does not work, after entering the GRUB command line (you can press the CTRL+C key), we can also start the system step by step. In fact, in menu.lst, except title is not an instruction, the rest are GRUB instructions, we just need to enter them step by step (wrong to start all over again), and enter information about kernel and initrd to use
TAB key to complete the write, and finally as long as boot on the line.
Boot windows with the GRUB instruction:
GRUB > rootnoverify (hd0,0)
GRUB > chainloader + 1
GRUB > boot
After reading this article, I believe you have a certain understanding of "how to write the configuration file menu.lst of GRUB". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.