Question Summary:
1> What is GRUB?
2> What's its position when Linux start up?
GRUB is BootLoader in Linux, its main focus is load Kernel.
1. GRUB configuration
1) The GRUB config file stores in "/boot/grub/grub.conf"
Also it has a soft link "/etc/grub.conf"
2) "/boot" directory stores the file needed for system start up.
ls /boot config-2.6.18-194.el5 lost+found System.map-2.6.18.el5 grub message vmlinuz-2.6.18-194.el5 initrd-2.6.18-194.el5.img symvers-2.6.18-194.el5-gz
3) What stores in "/boot/grub/grub.conf"?
#grub.conf generated by anaconda #... #boot=/dev/sda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-194.el5) root(hd0,0) kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-194.el5.img
1) default: the default start up os, in real server env, we will not install multiple os.
2) timeout: the default waiting time(second)
3) splashimage: GRUB GUI image. (hd0,0) --> hd(Hard Disk). hd0 the first hard disk. hd(0, 0) the first segment on the first hard disk.
Here, (hd0,0) represents the hardware position of folder "/boot".
So we can find splash.xpm.gz in /boot/grub directory.
4) hiddenmenu: If we comment this, then we can get the information of GRUB procession.
5) kernel: point out the position of kernel. ro means readonly.
6) initrd: load image file
2. Single user mode
1) Why should we use single user mode?
We may forget the password for root.
There may be file system chaos after a sudden power off.
Single user mode enable us login system as root and don't have to input password.
Single user mode disabled X-Window
2) How can we shift to single user mode?
e: edit current start menu c: enter GRUB command line b: start current selected start menu item d: delete current line Esc: return to GRUB start up GUI and cancel all the modification for current menu item.
1. Step into GRUB GUI when start up.
2. Press e into edit line mode
3. Move highlight to kernel row, and press e again into edit mode.
4. Add 1 or s to the end of this line like this: kernel /vmlinuz-2.6.18-194.el ro root=LABEL=/ rhgb quiet 1
5. Press b to boot the system with single user mode as root.
3. Setup password for GRUB
1) Why should we set password for GRUB?
To prevent other people change the password or damage system when entering single user mode by using GRUB.
2) How should we set password for GRUB?
Just have to add line before title.
#grub.conf generated by anaconda #... #boot=/dev/sda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu password --md5 ********************** title CentOS (2.6.18-194.el5) root(hd0,0) kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-194.el5.img
4. Recover GRUB
1) After startup and get into GRUB GUI, there is no menu displayed, only grub> prompt:
That may results from a damaged row in grub.conf file.
As convention, we should backup /boot directory for emergency use.
press c to enter grub command line.
grub> cat /boot/grub/grub.conf (look up the params)
grub> root (hd0,0) --> set root path as the /boot directory
grub> kernel (hd0,0)/vmlinuz-2.4.18-14 ro root=LABEL=/ --> set kernel file as ...
grub> initrd (hd0,0)/initrd-2.4.18-14.img --> set initrd
grub> boot
2) What if we cannot even get into GRUB GUI?
We have to use linux installation cd to recover the system.
相关推荐
关于对2022.1.1以后VHLS不能生成IP核的解决补丁
Error #541: 'NordicSemiconductor::Device:Startup:8.27.0' component is missing (previously found in pack 'NordicSemiconductor.nRF_DeviceFamilyPack_NordicLicense')
Startup Pitch Perfect - 初创公司的。 Startup Pitch Perfect 会根据“X 换 Y”的比喻自动生成一个随机的启动和标准推介平台(例如市场、产品、战略、团队)的所有幻灯片,向您的朋友推介。 现在轮到你了! 本...
load-on-startup节点的试验代码,详情请参考博文:http://blog.csdn.net/daochuwenziyao/article/details/53026185
startup-Bytedrops-2021
2)....Fixed: Range check error in processes information for x64 machines (affects startup of any EurekaLog-enabled module) 3)....Fixed: Auto-detect personality by project extension if --el_mode switch...
2010-8-11 18:24:13 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 984 ms 2010-8-11 18:24:13 org.apache.catalina.core.StandardService start 信息: Starting service Catalina ...
C51启动文件--STARTUp.A51--详细注释.docx
最新发布的 StartIT主题!Premium 70美金。内含300+中demo文件可导入 完全合适于公司广告和商店。
启动:R软件包:startup-友好的R启动配置
弹簧启动分析仪 该项目被设计为一个模块,您可以通过Maven引入,它会生成类似于下... <artifactId>spring-startup-analysis <version>1.1.0 将以下基本软件包添加到您的组件中: com.github.lwaddicor.springstartu
安卓架构小工具app startup的使用-------让初始化代码更简单(csdn)————程序
Applies to: Oracle Server - Enterprise Edition - Version: 10.2.0.4 to 11.1.0.6 ...NOTE:419871.1 - Failures due to "skgxpvfymmtu: process failed because of a resource problem in the OS" on 32-bit Linux
0.83.5.820 +---------------------------------------------------------------------------------------- - 0000796: DBGrid: Render bug when Column color is clWindow and project is created with 0.82 ...
Part II Programming Chapter 4 Basics of Assembly Programming Chapter 5 Data Processing Instructions Chapter 6 Memory Access Instructions Chapter 7 Branch and Control Instructions Part III Interfacing...
建立文件夹uCOS-II-Port/Library/CM3/startup 建立文件夹uCOS-II-Port/Library/STM32_Lib :存放标准外设函数库文件 建立文件夹uCOS-II-Port/OS-uCOSII 建立文件夹uCOS-II-Port/OS-uCOSII/core :存放...
Startup: -V, --version display the version of Wget and exit. -b, --background go to background after startup. -e, --execute=COMMAND execute a `.wgetrc' command. Logging and input file: -o, ...
StartupNews内容过滤器,可以根据用户、网站以及关键字等条件对原网页内容进行过滤和重排 ------ 更新日志:2014-8-2 ------bugfix:当新闻条目是第一条时,有可能无法先隐藏后删除的问题(直观上的感觉是有延迟)...
启动流程 my.ini 文件修改 basedir=E:\\mysql-8.0.20-winx64 # 切记此处一定要用双斜杠\\,单斜杠我这里会出错,不过看别人的教程,有的是单斜杠。自己尝试吧 修改成自己的路径 ...startup.bat 帐号密码 root x5