GRUB2 Some Useful Commands

本文详细介绍了GRUB2中的关键命令,包括如何加载背景图像、显示文件内容、初始化系统等核心操作,对于GRUB2配置与使用提供了深入的指导。

1.background_image

Load an existing background image. Use tab completion to help complete filename entries!background_image(hd0,1)/usr/share/images/grub/then tab to display a list of all images. Useful command when initially testing splash images.


2.cat

Use to display the current file contents.cat/boot/grub/grub.cfg,cat/etc/fstab


3.help

View all available commands. Typehelpxto get a list of commands beginning with the letter x.helpxxxfor information about the xxx command. This command should be preceded by running "set pager=1", which acts like the terminal's "| more" command, to prevent scrolling past the top of the screen.


4.ls

Used alone, lists all devices known to GRUB 2, such as(hd0) (hd0,1), etc. View available partitions withls. View /boot and /grub directory contents with `ls /boot, ls /boot/grub



5.initrd

Load aninitrd.


6. linux

Load alinuxkernel.


7.loopback

Mount a file as a device. `loopback loop (hd0,2)/iso/my.iso


8.lsmod

Display loaded modules



9.reboot

Reboot the machine



10.rescue

Enter the rescue mode



11.set

Show environmental variables in place. Combined with others, set variables such assetgfxmode=640x480,setcolor_normal=cyan/blackUse the latter command in command line mode to test various menu font colors.



12. vbeinfo

Display available monitor resolutions.


13.load the configuration file

configfile (hdX,Y)/boot/grub/grub.cfg

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值