{"id":484,"date":"2010-07-26T09:21:09","date_gmt":"2010-07-26T09:21:09","guid":{"rendered":""},"modified":"2010-07-26T09:21:09","modified_gmt":"2010-07-26T09:21:09","slug":"484","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=484","title":{"rendered":"ubuntu \u4e4bgrub.cfg\u8be6\u89e3"},"content":{"rendered":"<p>grub.cfg \u9ed8\u8ba4\u4e3a\u53ea\u8bfb\uff0c\u8981\u4fee\u6539\u524d\u5148\u8bbe\u4e3a\u53ef\u5199<br \/>sudo chmod +w \/boot\/grub\/grub.cfg<br \/>set default=0<br \/>#\u9ed8\u8ba4\u4e3a0<br \/>insmod jpeg<br \/>#\u6dfb\u52a0jpg\u652f\u6301\uff0c\u5982\u8981\u4f7f\u7528png\u6216tga\u6587\u4ef6\u505a\u80cc\u666f\uff0c\u52a0\u4e0a insmod png\u6216insmod tga<br \/>insmod ext2<br \/>#\u9664\u4e86\u7528\u4f5c\u542f\u52a8\u7684\u5206\u533a\u5916\uff0c\u5176\u4ed6\u5206\u533a\u683c\u5f0f\u53ef\u5728menu\u5e95\u4e0b\u518d\u6dfb\u52a0<br \/>set root=(hd0,7)<br \/>#\u8bbe\u5b9aroot\u5206\u533a<br \/>search \u2013no-floppy \u2013fs-uuid \u2013set f255285a-5ad4-4eb8-93f5-4f767190d3b3<br \/>#\u8bbe\u5b9auuid=****\u7684\u5206\u533a\u4e3aroot\uff0c\u548c\u4e0a\u53e5\u91cd\u590d\uff0c\u53ef\u5220\u9664<br \/># \u4ee5\u4e0b\u4e3a\u7ec8\u7aef\u914d\u7f6e<br \/>if loadfont \/usr\/share\/grub\/unicode.pf2 ; then<br \/>#\u8bbe\u7f6e\u7ec8\u7aef\u5b57\u4f53\uff0cunicode.pf2\u652f\u6301\u4e2d\u6587\u663e\u793a<br \/>set gfxmode=640\u00d7480<\/p>\n<p>#\u8bbe\u7f6e\u5206\u8fa8\u7387\uff0c\u9ed8\u8ba4\u4e3a 640\u00d7480\uff0c\u53ef\u7528800\u00d7600\uff0c1024\u00d7768\uff0c\u5efa\u8bae\u8ddf\u4f60\u60f3\u8bbe\u5b9a\u7684\u56fe\u7247\u5927\u5c0f\u4e00\u81f4<br \/>insmod gfxterm<br \/>#\u63d2\u5165\u6a21\u5757 gfxterm\uff0c\u652f\u6301\u4e2d\u6587\u663e \u793a\uff0c\u5b83\u8fd8\u652f\u6301 24 \u4f4d\u56fe\u50cf<br \/>insmod vbe<br \/>#\u63d2\u5165 vbe \u6a21\u5757\uff0cGRUB 2 \u5f15\u5165\u5f88\u591a\u6a21\u5757\u7684\u4e1c\u897f\uff0c\u8981\u4f7f\u7528\u5b83\uff0c\u9700\u8981\u5728\u8fd9\u91cc\u52a0\u5165<br \/>if terminal_output gfxterm ; then true ; else<br \/># For backward compatibility with versions of terminal.mod that don\u2019t<br \/># understand terminal_output<br \/>terminal gfxterm<br \/>#\u8bbe\u7f6e GRUB 2 \u7ec8\u7aef\u4e3a gfxterm<br \/>fi<br \/>fi<br \/>set timeout=10<br \/>background_image (hd0,7)\/boot\/images\/1.jpg<br \/>#\u8bbe\u7f6e\u80cc\u666f\u56fe\u7247<br \/>### END \/etc\/grub.d\/00_header ###<br \/>### BEGIN \/etc\/grub.d\/05_debian_theme ###<br \/>set menu_color_normal=white\/black<br \/>set menu_color_highlight=cyan\/black<br \/>#\u8fd9\u4e24\u884c\u4e3a Debian \u4e0b\u7684\u83dc\u5355\u989c\u8272\u8bbe\u7f6e\uff0c\u5982\u679c\u9ed8\u8ba4\u7684\u8bdd\uff0c\u4f60\u4f1a\u53d1\u73b0\u80cc\u666f\u5b8c\u5168\u88ab\u84dd\u8272\u6321\u4f4f\u4e86\uff0c\u4f60\u9700\u8981\u4fee\u6539 blue \u4e3a black\uff0c\u8fd9\u6837\u80cc\u666f\u5c31\u4f1a\u51fa\u73b0 <br \/>### END \/etc\/grub.d\/05_debian_theme ###<br \/># 10_linux \u4e3a\u81ea\u52a8\u6dfb\u52a0\u7684\u5f53\u524droot\u5206\u533alinux\u5f15\u5bfc\u9879<br \/>### BEGIN \/etc\/grub.d\/10_linux ###<br \/>#\u83dc\u5355\u9879\uff0c\u8981\u5305\u62ec menuentry \u53cc\u5f15\u53f7\u201d \u201d \u548c\u5927\u62ec\u53f7 { }\u624d\u5b8c\u6574\uff0c\u5426\u5219\u4e0d\u663e\u793a\u83dc\u5355<br \/>menuentry \u201cUbuntu, Linux 2.6.31-9-386\u2033 {<br \/>insmod ext2<br \/>set root=(hd0,7)<br \/>search \u2013no-floppy \u2013fs-uuid \u2013set f255285a-5ad4-4eb8-93f5-4f767190d3b3<br \/>#\u8fd9\u53e5\u4e0eset root=(hd0,7)\u91cd\u590d\uff0c\u53ef\u5220\u9664<br \/>linux \/boot\/vmlinuz-2.6.31-9-386 root=UUID=f255285a-5ad4-4eb8-93f5-4f767190d3b3 ro quite splash<br \/>#\u4e0d\u559c\u6b22\u770b\u5230\u4e00\u957f\u4e32\u7684\uff0c roo=UUID=***\u53ef\u7528root=\/dev\/sda7\u4ee3\u66ff<br \/>initrd \/boot\/initrd.img-2.6.31-9-386<br \/>}<br \/>### END \/etc\/grub.d\/10_linux ###<br \/>### BEGIN \/etc\/grub.d\/20_memtest86+ ###<br \/>menuentry \u201cMemory test (memtest86+)\u201d {<br \/>linux16 \/boot\/memtest86+.bin<br \/>}<br \/>### END \/etc\/grub.d\/20_memtest86+ ###<br \/># \u81ea\u52a8\u6dfb\u52a0\u5b58\u5728\u4e8e\u5176\u4ed6\u5206\u533a\u7684\u7cfb\u7edf\u5f15\u5bfc\u9879<br \/>### BEGIN \/etc\/grub.d\/30_os-prober ###<br \/>#windows \u542f\u52a8\u83dc\u5355<br \/>menuentry \u201cWindows Vista (loader) (on \/dev\/sda1)\u201d {<br \/>insmod ntfs<br \/>#windows\u683c\u5f0f\u4e3antfs\uff0c\u6216\u4e3afat32\u6539\u4e3a insmod fat <br \/>set root=(hd0,1)<br \/>search \u2013no-floppy \u2013fs-uuid \u2013set ece067d2e067a196<br \/>#\u53ef\u5220\u9664<br \/>#grub2\u6bd4\u8f83\u5148\u8fdb\u7684\u5730\u65b9\u5c31\u662f\u5982\u679c\u53d1\u73b0windows\u542f\u52a8\u662f\u901a\u8fc7 ntldr \u5f15\u5bfc\u7684\uff0c\u5b9a\u4e3a2000\/xp\/2003\uff0c\u4f1a\u5728\u8fd9\u52a0\u4e0a drivemap -s (hd0) ${root} \uff0c\u4f5c\u7528\u76f8\u5f53\u4e8egrub\u7684map\uff0c\u53ef\u6b63\u5e38\u542f\u52a8\u975e\u7b2c\u4e00\u786c\u76d8\u7684xp\/2003\u7cfb\u7edf\u3002<br \/>chainloader +1<br \/>}<br \/># \u67e5\u627e\u5230\u5176\u4ed6\u5206\u533a\u4e0a\u7684linux\u7cfb\u7edf\u5e76\u81ea\u52a8\u6dfb\u52a0 <br \/>menuentry \u201cUbuntu karmic (development branch) (9.10) (on \/dev\/sda3)\u201d {<br \/>insmod ext2<br \/>set root=(hd0,3)<br \/>search \u2013no-floppy \u2013fs-uuid \u2013set 4d893970-0685-44ed-86b3-1de45b2db84a<br \/>linux \/boot\/vmlinuz-2.6.31-9-generic root=\/dev\/sda3<br \/>initrd \/boot\/initrd.img-2.6.31-9-generic<br \/>}<br \/>#\u82e5\u5b58\u5728macos\u4f1a\u81ea\u52a8\u5728\u8fd9\u91cc\u6dfb\u52a0\u3002<br \/>### END \/etc\/grub.d\/30_os-prober ###<br \/># \u4ee5\u4e0b\u4e3a\u624b\u52a8\u6dfb\u52a0\u7684\u83dc\u5355\u9879<br \/>### BEGIN \/etc\/grub.d\/40_custom ###<br \/>menuentry \u201cCDLinux\u201d{<br \/>set root=(hd0,8)<br \/>linux \/CDlinux\/bzImage root=\/dev\/ram0 vga=791 CDL_LANG=zh_CN.UTF-8<br \/>initrd \/CDlinux\/initrd<br \/>}<br \/>### END \/etc\/grub.d\/40_custom ###<br \/># \u624b\u52a8\u6dfb\u52a0\u65f6\uff0c\u786c\u76d8\u7f16\u53f7\u4ece0\u5f00\u59cb(hd0)\uff0c\u4e3b\u5206\u533a\u7f16\u53f7\u4ece1\u5f00\u59cb(hd0,1)\uff0c\u903b\u8f91\u5206\u533a\u4ece5\u5f00\u59cb(hd0,5)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>grub.cfg \u9ed8\u8ba4\u4e3a\u53ea\u8bfb\uff0c\u8981\u4fee\u6539\u524d\u5148\u8bbe\u4e3a\u53ef\u5199sudo chmod&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-484","post","type-post","status-publish","format-standard","hentry","category-Linux"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=484"}],"version-history":[{"count":0,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/484\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}