{"id":6580,"date":"2020-02-14T12:50:33","date_gmt":"2020-02-14T04:50:33","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=6580"},"modified":"2020-05-23T21:25:49","modified_gmt":"2020-05-23T13:25:49","slug":"grub","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/grub","title":{"rendered":"grub\u547d\u4ee4 – \u591a\u91cd\u5f15\u5bfc\u7a0b\u5e8fgrub\u7684\u547d\u4ee4\u884cshell\u5de5\u5177"},"content":{"rendered":"\n

grub\u547d\u4ee4\u662f\u591a\u91cd\u5f15\u5bfc\u7a0b\u5e8fgrub\u7684\u547d\u4ee4\u884cshell\u5de5\u5177\u3002<\/p>\n\n\n\n

grub\u662f\u4e00\u4e2a\u5f15\u5bfc\u7a0b\u5e8f\u6216\u8005\u662f\u4e00\u4e2a\u7cfb\u7edf\u5f15\u5bfc\u5de5\u5177\uff0c\u901a\u8fc7grub\u547d\u4ee4\u53ef\u4ee5\u5f15\u5bfc\u79cd\u7c7b\u4e30\u5bcc\u7684\u7cfb\u7edf\uff0c\u5982linux\u3001freebsd\u3001windows\u7b49\u3002<\/p>\n\n\n\n

\u8fdb\u5165linux\u64cd\u4f5c\u7cfb\u7edf\u4e4b\u540e\uff0c\u53ef\u4ee5\u8f93\u5165grub\u547d\u4ee4\uff0c\u5c31\u8fdb\u5165\u201cgrub>\u201d\u63d0\u793a\u72b6\u6001\uff0c\u7136\u540e\u53ef\u4ee5\u8fdb\u5165\u64cd\u4f5c\u82e5\u5e72\u547d\u4ee4\u3002grub\u5c31\u662fshell\uff0cbash\u7c7b\u4f3c\u3002\u5e76\u4e14\u63d0\u4f9b\u4e86\u4ea4\u4e92\u6a21\u5f0f\u548c\u975e\u4ea4\u4e92\u4e24\u79cd\u6a21\u5f0f\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>grub [\u53c2\u6570\/\u547d\u4ee4]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

\n
\n
-- -batch<\/td>\u6253\u5f00\u6279\u5904\u7406\u6a21\u5f0f<\/td><\/tr>
-- -boot-drive=<\u9a71\u52a8\u5668><\/td>\u6307\u5b9astage2\u7684\u5f15\u5bfc\u9a71\u52a8\u5668<\/td><\/tr>
-- -config-file<\u914d\u7f6e\u6587\u4ef6><\/td>\u6307\u5b9astage2\u7684\u914d\u7f6e\u6587\u4ef6<\/td><\/tr>
-- -device-map=<\u6587\u4ef6><\/td>\u6307\u5b9a\u8bbe\u5907\u7684\u6620\u5c04\u6587\u4ef6<\/td><\/tr>
-- -help<\/td>\u663e\u793a\u5e2e\u52a9\u4fe1\u606f<\/td><\/tr>
-- -install-partition=<\u5206\u533a><\/td>\u6307\u5b9astage2\u5b89\u88c5\u5206\u533a<\/td><\/tr>
-- -no-config-file<\/td>\u4e0d\u4f7f\u7528\u914d\u7f6e\u6587\u4ef6<\/td><\/tr>
-- -no-pager<\/td>\u4e0d\u4f7f\u7528\u5185\u90e8\u5206\u9875\u5668<\/td><\/tr>
-- -preset-menu<\/td>\u4f7f\u7528\u9884\u8bbe\u83dc\u5355<\/td><\/tr>
-- -probe-second-floppy<\/td>\u68c0\u6d4b\u7b2c\u4e8c\u4e2a\u8f6f\u76d8\u9a71\u52a8\u5668<\/td><\/tr>
-- -read-only<\/td>\u53ea\u8bfb\u6a21\u5f0f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u5e38\u7528\u547d\u4ee4\uff1a<\/strong><\/p>\n\n\n\n

color<\/td>\u8bbe\u5907\u83dc\u5355\u754c\u9762\u7684\u989c\u8272<\/td><\/tr>
device<\/td>\u6307\u5b9a\u8bbe\u5907\u6587\u4ef6\u4f5c\u4e3a\u9a71\u52a8\u5668<\/td><\/tr>
hide<\/td>\u9690\u85cf\u5206\u533a<\/td><\/tr>
pager<\/td>\u6539\u53d8\u5185\u90e8\u9875\u7a0b\u5e8f\u7684\u72b6\u6001<\/td><\/tr>
partnew<\/td>\u521b\u5efa\u4e00\u4e2a\u4e3b\u5206\u533a<\/td><\/tr>
parttype<\/td>\u6539\u53d8\u5206\u533a\u7c7b\u578b<\/td><\/tr>
password<\/td>\u4e3a\u83dc\u5355\u754c\u9762\u8bbe\u5907\u53e3\u4ee4<\/td><\/tr>
serial<\/td>\u8bbe\u7f6e\u4e32\u53e3\u8bbe\u5907<\/td><\/tr>
setkey<\/td>\u8bbe\u7f6e\u952e\u76d8\u6620\u5c04<\/td><\/tr>
splashimage<\/td>\u8bbe\u7f6eGRUB\u542f\u52a8\u7684\u80cc\u666f\u56fe\u5f62\u6587\u4ef6<\/td><\/tr>
terminal<\/td>\u9009\u4e2d\u7ec8\u7aef\u7c7b\u578b<\/td><\/tr>
unhide<\/td>\u8fd8\u539f\u9690\u85cf\u5206\u533a<\/td><\/tr>
clear<\/td>\u6e05\u5c4f<\/td><\/tr>
terminfo<\/td>\u5b9a\u4e49\u7ec8\u7aef\u7684\u529f\u80fd<\/td><\/tr>
blocklist<\/td>\u663e\u793a\u6587\u4ef6\u6240\u5728\u5206\u533a\u4f4d\u7f6e<\/td><\/tr>
boot<\/td>\u542f\u52a8\u7cfb\u7edf<\/td><\/tr>
cat<\/td>\u663e\u793a\u6587\u4ef6\u5185\u5bb9<\/td><\/tr>
chainloader<\/td>\u628a\u542f\u52a8\u63a7\u5236\u6743\u8f6f\u4ea4\u7ed9\u5176\u4ed6\u7684\u5f15\u5bfc\u88c5\u8f7d\u7a0b\u5e8f<\/td><\/tr>
cmp<\/td>\u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6<\/td><\/tr>
configfile<\/td>\u52a0\u8f7d\u5df2\u7ecf\u5b58\u5728\u7684GRUB\u914d\u7f6e\u6587\u4ef6<\/td><\/tr>
debug<\/td>\u5f00\u542f\/\u5173\u95eddebug\u6a21\u5f0f<\/td><\/tr>
displayapm<\/td>\u663e\u793aAPM BIOS\u4fe1\u606f<\/td><\/tr>
displaymem<\/td>\u663e\u793a\u5185\u5b58\u914d\u7f6e<\/td><\/tr>
embed<\/td>\u5d4c\u5165STAGE1_5\u8bbe\u5907<\/td><\/tr>
find<\/td>\u67e5\u627e\u5305\u62ec\u6587\u4ef6\u7684\u6240\u6709\u8bbe\u5907<\/td><\/tr>
fstest<\/td>\u5207\u6362\u6587\u4ef6\u7cfb\u7edf\u6d4b\u8bd5\u6a21\u5f0f<\/td><\/tr>
geometry<\/td>\u663e\u793a\u9a71\u52a8\u5668\u7684\u7269\u7406\u4fe1\u606f<\/td><\/tr>
halt<\/td>\u5173\u95ed\u7cfb\u7edf<\/td><\/tr>
help<\/td>\u663e\u793aGRUB\u547d\u4ee4\u5e2e\u52a9\u4fe1\u606f<\/td><\/tr>
impsprobe<\/td>\u67e5\u8be2SMP\u4fe1\u606f<\/td><\/tr>
initrd<\/td>\u52a0\u8f7dinitrd\/initramfs\u6587\u4ef6<\/td><\/tr>
install<\/td>\u5b89\u88c5GRUB<\/td><\/tr>
ioprobe<\/td>\u67e5\u8be2\u9a71\u52a8\u5668\u7684I\/O\u7aef\u53e3<\/td><\/tr>
kernel<\/td>\u5f15\u5bfc\u7cfb\u7edf\u5185\u6838<\/td><\/tr>
lock<\/td>\u9501\u5b9aGRUB\u5f15\u5bfc\u83dc\u5355\u9879\uff0c\u53ea\u6709\u8f93\u5165\u5bc6\u7801\u540e\u624d\u80fd\u542f\u52a8<\/td><\/tr>
makeactive<\/td>\u6fc0\u6d3b\u4e3b\u5206\u533a<\/td><\/tr>
map<\/td>\u865a\u62df\u6620\u5c04\u9a71\u52a8\u5668<\/td><\/tr>
md5crypt<\/td>\u4f7f\u7528MD5\u7b97\u6cd5\u52a0\u5bc6\u53e3\u4ee4<\/td><\/tr>
module<\/td>\u52a0\u8f7d\u6a21\u5757<\/td><\/tr>
modulenounzip<\/td>\u52a0\u8f7d\u6a21\u5757\u4f46\u4e0d\u8fdb\u884c\u89e3\u538b<\/td><\/tr>
pause<\/td>\u6682\u505c\u5e76\u7b49\u5f85\u6309\u952e<\/td><\/tr>
quit<\/td>\u9000\u51faGRUB\u547d\u4ee4\u884c\u754c\u9762<\/td><\/tr>
reboot<\/td>\u91cd\u542f\u7cfb\u7edf<\/td><\/tr>
read<\/td>\u8bfb\u53d6\u5185\u5b58\u4e2d\u7684\u5185\u5bb9<\/td><\/tr>
root<\/td>\u8bbe\u7f6eGRUB\u7684root\u8bbe\u5907<\/td><\/tr>
rootnoverify<\/td>\u8bbe\u7f6eGRUB\u7684root\u8bbe\u5907\u4f46\u4e0d\u88c5\u8f7d\u6587\u4ef6\u7cfb\u7edf<\/td><\/tr>
savedefault<\/td>\u4fdd\u5b58\u5f53\u524d\u7684\u542f\u52a8\u83dc\u5355\u9879\u4e3a\u9ed8\u8ba4\u542f\u52a8<\/td><\/tr>
setup<\/td>\u81ea\u52a8\u5b89\u88c5GRUB<\/td><\/tr>
testload<\/td>\u4ece\u6587\u4ef6\u7cfb\u7edf\u4e2d\u6d4b\u8bd5\u8bfb\u53d6\u6587\u4ef6<\/td><\/tr>
testvbe<\/td>\u6d4b\u8bd5VESA BIOS  EXTENSION<\/td><\/tr>
uppermem<\/td>\u5f3a\u5236\u8bbe\u5907\u8ba1\u7b97\u673a\u4e0a\u4f4d\u5185\u5b58\u5927\u5c0f<\/td><\/tr>
vbeprobe<\/td>\u67e5\u8be2VESA BIOS  EXTENSION\u4fe1\u606f<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

grub\u4fe1\u606f\u635f\u574f\uff0c\u4f7f\u7528\u547d\u4ee4\u542f\u52a8\u7cfb\u7edf\uff1a<\/p>\n\n\n\n

grub>root (hd0,1)   \/* \u5047\u8bbe \/dev\/hda2 \u662f\u4f60\u7684 \/boot \u6240\u5728\u7684\u5206\u533a *\/ \ngrub>kernel \/boot\/vmlinuz-2.6.15-26-386 ro dev=\/dev\/hda3    \/* \u5047\u8bbe \/dev\/hda3 \u662f\u4f60\u7684 \/ \u6240\u5728\u7684\u5206\u533a *\/ \ngrub>initrd \/boot\/initrd.img-2.6.15-26-386 \ngrub>boot <\/pre>\n\n\n\n

\u5728\u5206\u533a\u8bbe\u5907\u4e0a\u5b89\u88c5grub\uff1a<\/p>\n\n\n\n

grub>setup (hd0)<\/pre>\n\n\n\n

\u6307\u5b9a\u521d\u59cb\u5316\u6587\u4ef6\uff1a<\/p>\n\n\n\n

grub> initrd \/boot\/initrd-2.6.11-1.1369_FC4.img \n[Linux-initrd @ 0x2e1000, 0x10e685 bytes]<\/pre>\n","protected":false},"excerpt":{"rendered":"

grub\u547d\u4ee4\u662f\u591a\u91cd\u5f15\u5bfc\u7a0b\u5e8fgrub\u7684\u547d\u4ee4\u884cshell\u5de5\u5177\u3002 grub\u662f\u4e00\u4e2a\u5f15\u5bfc\u7a0b\u5e8f\u6216\u8005\u662f\u4e00\u4e2a\u7cfb\u7edf\u5f15\u5bfc\u5de5\u5177\uff0c\u901a\u8fc7 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6580"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=6580"}],"version-history":[{"count":12,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6580\/revisions"}],"predecessor-version":[{"id":7765,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6580\/revisions\/7765"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=6580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=6580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=6580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}