搜索

第 6 章 配​​​​​​​置​​​​​​​ GRUB

download PDF
GNU Grand Unified Boot Loader (or GRUB) is a program which enables the user to select which installed operating system or kernel to load at system boot time. It also allows the user to pass arguments to the kernel. The GRUB configuration file (located in /boot/grub/grub.conf) is used to create a list of operating systems to boot in GRUB's menu interface. When you install the kernel-xen RPM, a post script adds kernel-xen entries to the GRUB configuration file. You can edit the grub.conf file and enable the following GRUB parameter:
title Red Hat Enterprise Linux Server (2.6.18-3.el5xen)
root   (hd0; 0)
kernel  /xen.gz.-2.6.18-3.el5
module  /vmlinuz-2.6..18-3.el5xen ro root=/dev/VolGroup00/LogVol00  rhgb quiet
module  /initrd-2.6.18-3. el5xenxen.img

如​​​​​​​果​​​​​​​你​​​​​​​设​​​​​​​置​​​​​​​与​​​​​​​示​​​​​​​例​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​ Linux grub 条​​​​​​​目​​​​​​​,引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​会​​​​​​​载​​​​​​​入​​​​​​​ hypervisor、​​​​​​​initrd 映​​​​​​​像​​​​​​​和​​​​​​​ Linux 内​​​​​​​核​​​​​​​。​​​​​​​既​​​​​​​然​​​​​​​关​​​​​​​于​​​​​​​内​​​​​​​核​​​​​​​的​​​​​​​条​​​​​​​目​​​​​​​是​​​​​​​在​​​​​​​所​​​​​​​有​​​​​​​其​​​​​​​他​​​​​​​条​​​​​​​目​​​​​​​之​​​​​​​上​​​​​​​,内​​​​​​​核​​​​​​​会​​​​​​​先​​​​​​​被​​​​​​​载​​​​​​​入​​​​​​​内​​​​​​​存​​​​​​​。​​​​​​​引​​​​​​​导​​​​​​​装​​​​​​​载​​​​​​​程​​​​​​​序​​​​​​​向​​​​​​​ hypervisor 和​​​​​​​ Linux 内​​​​​​​核​​​​​​​发​​​​​​​送​​​​​​​(和​​​​​​​接​​​​​​​受​​​​​​​)命​​​​​​​令​​​​​​​行​​​​​​​参​​​​​​​数​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​示​​​​​​​例​​​​​​​条​​​​​​​目​​​​​​​展​​​​​​​示​​​​​​​了​​​​​​​怎​​​​​​​样​​​​​​​把​​​​​​​ Domain0 linux 内​​​​​​​核​​​​​​​内​​​​​​​存​​​​​​​限​​​​​​​制​​​​​​​在​​​​​​​ 800MB 之​​​​​​​内​​​​​​​:

title Red Hat Enterprise Linux Server (2.6.18-3.el5xen)
root   (hd0; 0)
kernel  /xen.gz.-2.6.18-3.el5 dom0_mem=800M
module  /vmlinuz-2.6..18-3.el5xen ro root=/dev/VolGroup00/LogVol00  rhgb quiet
module  /initrd-2.6.18-3. el5xenxen.img

你​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​这​​​​​​​些​​​​​​​ GRUB 参​​​​​​​数​​​​​​​来​​​​​​​配​​​​​​​置​​​​​​​虚​​​​​​​拟​​​​​​​化​​​​​​​管​​​​​​​理​​​​​​​程​​​​​​​序​​​​​​​(hypervisor):
mem

这​​​​​​​限​​​​​​​制​​​​​​​了​​​​​​​可​​​​​​​用​​​​​​​于​​​​​​​ domain0 的​​​​​​​内​​​​​​​存​​​​​​​数​​​​​​​量​​​​​​​。​​​​​​​

com1=115200, 8n1

这​​​​​​​启​​​​​​​用​​​​​​​了​​​​​​​系​​​​​​​统​​​​​​​里​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​串​​​​​​​口​​​​​​​来​​​​​​​充​​​​​​​当​​​​​​​串​​​​​​​行​​​​​​​控​​​​​​​制​​​​​​​台​​​​​​​(com2 被​​​​​​​分​​​​​​​配​​​​​​​给​​​​​​​下​​​​​​​一​​​​​​​个​​​​​​​端​​​​​​​口​​​​​​​,诸​​​​​​​如​​​​​​​此​​​​​​​类​​​​​​​)。​​​​​​​
 
dom0_mem
这​​​​​​​限​​​​​​​制​​​​​​​了​​​​​​​可​​​​​​​用​​​​​​​于​​​​​​​ domain0 的​​​​​​​内​​​​​​​存​​​​​​​数​​​​​​​量​​​​​​​。​​​​​​​
dom0_max_vcpus
这​​​​​​​限​​​​​​​制​​​​​​​了​​​​​​​ domain0 可​​​​​​​见​​​​​​​的​​​​​​​ CPU 数​​​​​​​量​​​​​​​。​​​​​​​
acpi
这​​​​​​​把​​​​​​​ ACPI hypervisor 切​​​​​​​换​​​​​​​至​​​​​​​ hypervisor 和​​​​​​​ domain0。​​​​​​​ACPI 参​​​​​​​数​​​​​​​的​​​​​​​选​​​​​​​项​​​​​​​包​​​​​​​括​​​​​​​:

/*   ****  Linux config options: propagated to domain0  ****/
/*   "acpi=off":      Disables both ACPI table parsing and interpreter.   */
/*   "acpi=force":    Overrides the disable blacklist.                    */
/*   "acpi=strict":   Disables out-of-spec workarounds.                   */
/*   "acpi=ht":       Limits ACPI from boot-time to enable HT.            */
/*   "acpi=noirq":    Disables ACPI interrupt routing.                    */


noacpi

这​​​​​​​禁​​​​​​​用​​​​​​​了​​​​​​​用​​​​​​​于​​​​​​​ interrupt delivery 的​​​​​​​ ACPI。​​​​​​​
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.