孔志奎

孔志奎的博客

他的个人主页  他的博客

修改Linux内核启动参数

孔志奎  2012年03月28日 星期三 11:52 | 1968次浏览 | 0条评论

内核启动参数一般保存在   /boot/grub/menu.lst  (对应"kernel"开头的行) 或者  /boot/grub/grub.cfg (对应linux开头的行)文件中, 系统启动时由grub引导并传递给内核.  

    以下是/boot/grub/menu.lst文件中的示例片段:

        title Fedora Core (2.6.18-1.2798.fc6)
            root (hd0,0)
            kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/1 rhgb vga=791
            initrd /boot/initrd-2.6.18-1.2798.fc6.img

    以下是/boot/grub/grub.cfg文件中的示例片段:

        menuentry 'Ubuntu, with Linux 2.6.32.56+drm33.22' --class ubuntu --class gnu-linux --class gnu --class os {
            recordfail
            insmod ext2
            set root='(hd0,1)'
            search --no-floppy --fs-uuid --set 03bef7d5-3d2a-4ddd-8f62-cdeb92fc34f9
            linux    /boot/vmlinuz-2.6.32.56+drm33.22 root=UUID=03bef7d5-3d2a-4ddd-8f62-cdeb92fc34f9 ro vga=791 quiet splash
            initrd    /boot/initrd.img-2.6.32.56+drm33.22
        }

可直接修改该文件(需要root权限), 但要注意备份原有内核启动项, 以避免出错而导致系统无法引导.

对于在内核源码目录下使用"make modules_install && make install"命令新安装的内核, 也可通过update-grub命令更新该文件以增加新内核的启动引导项.

update-grub命令无法满足更细致的内核参数修改需求, 所以如果要增加一些特别内核引导参数, 只能手动修改/boot/grub/menu.lst 或 /boot/grub/grub.cfg文件.

 

博客同步发布于CSDN: http://blog.csdn.net/kevin1078/article/details/7400860

评论

我的评论:

发表评论

请 登录 后发表评论。还没有在Zeuux哲思注册吗?现在 注册 !

暂时没有评论

Zeuux © 2024

京ICP备05028076号