grub.cfg文件如何修改。

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
dp033
帖子: 101
注册时间: 2009-05-03 8:57

grub.cfg文件如何修改。

#1

帖子 dp033 » 2009-10-31 22:05

刚装完ubuntu 9.10想修改一下grub的设置,可是我用sudo gedit改完保存的时候提示磁盘只读无法保存。请问有什么修改这个文件的方法吗?
头像
huabinwu
帖子: 68
注册时间: 2008-08-15 14:38

Re: grub.cfg文件如何修改。

#2

帖子 huabinwu » 2009-11-01 0:21

代码: 全选

sudo chmod 744 /boot/grub/grub.cfg
头像
wangdu2002
帖子: 13284
注册时间: 2008-12-13 19:39
来自: 物华天宝人杰地灵

Re: grub.cfg文件如何修改。

#3

帖子 wangdu2002 » 2009-11-01 0:22

行到水穷处,坐看云起时。
海内生明月,天涯共此夕。
--------------------吾本独!
dp033
帖子: 101
注册时间: 2009-05-03 8:57

Re: grub.cfg文件如何修改。

#4

帖子 dp033 » 2009-11-01 11:05

感谢各位。知道了 :em02
头像
真爱唯依
帖子: 44
注册时间: 2009-09-19 17:41
来自: 中國廣州
联系:

Re: grub.cfg文件如何修改。

#5

帖子 真爱唯依 » 2009-11-01 13:05

這個我知道,我前天硬盤安裝了就修改了GRUB。
終端輸入:

代码: 全选

sudo chmod -w /boot/grub/grub.cfg
配置文件默認是只讀的,這樣過後就可以修改了。
望君搞定!~
:em01 :em11
因為我的健忘,我才愛❤上
又因我的遗忘,我要离开你。
這輩子,命中注定是個悲劇

viewtopic.php?f=77&t=236877
头像
jiachaorui
帖子: 187
注册时间: 2007-05-16 22:30

Re: grub.cfg文件如何修改。

#6

帖子 jiachaorui » 2009-11-01 13:08

grub.cf默认是只读的,在属性中改为读写就OK了!
*IdeaPad Y450A TSI/T6600/PM45/1TB/GT 130M/2G DDR3/14' LED@1366X768 (2009-05)
xubuntu/Windows 7 32bit
wv1124
帖子: 10
注册时间: 2009-05-11 22:40

Re: grub.cfg文件如何修改。

#7

帖子 wv1124 » 2009-11-08 18:51

我执行这句也没报错sudo chmod 744 /boot/grub/grub.cfg
但是第次打,还是只读的,不能保存,谁知道为什么?
头像
速腾1994
论坛版主
帖子: 17379
注册时间: 2008-11-01 20:43
系统: Arch+gnome

Re: grub.cfg文件如何修改。

#8

帖子 速腾1994 » 2009-11-08 18:54

代码: 全选

sudo chmod -w /boot/grub/grub.cfg
头像
bbeikke
帖子: 880
注册时间: 2008-10-14 21:54

Re: grub.cfg文件如何修改。

#9

帖子 bbeikke » 2009-11-08 18:58

最好不要修改grub.cfg,改了后升级内核或者sudo update-grub还是会变回原来的。
按照smallapple的教程修改相应文件才是王道。
地狱可以想象,天堂却无法描述。
Ulinux-Future
帖子: 50
注册时间: 2009-11-23 11:53
来自: 中国江苏省
联系:

Re: grub.cfg文件如何修改。

#10

帖子 Ulinux-Future » 2009-11-28 17:05

受用。
头像
peteryeh64
论坛版主
帖子: 9377
注册时间: 2008-12-20 15:43
系统: 家kubuntu20.04
来自: 心靈深處

Re: grub.cfg文件如何修改。

#11

帖子 peteryeh64 » 2009-11-28 17:12

[论坛版主行为规定]+[PITIVI簡易教程]+[CAD裝draftsight2018sp3]+[网易云音乐]+[ubuntu裝迅雷]
[releases.ubuntu.com]+[cdimage.ubuntu.com]+[old-releases.ubuntu.com]
[學ubuntu必須拜讀懶蝸牛"笨兔兔的故事"=viewtopic.php?f=112&t=162040][Linux明日的希望在中國]
lee.wjsy
帖子: 2
注册时间: 2010-12-26 20:36

Re: grub.cfg文件如何修改。

#12

帖子 lee.wjsy » 2011-02-05 21:28

偶滴grub.cfg重刷了一遍,这样的,怎么改
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set 064c922c-d3ba-41ba-994d-e9cfca67f41e
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set 064c922c-d3ba-41ba-994d-e9cfca67f41e
set locale_dir=($root)/boot/grub/locale
set lang=zh
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set 064c922c-d3ba-41ba-994d-e9cfca67f41e
linux /boot/vmlinuz-2.6.35-24-generic root=UUID=064c922c-d3ba-41ba-994d-e9cfca67f41e ro quiet splash
initrd /boot/initrd.img-2.6.35-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set 064c922c-d3ba-41ba-994d-e9cfca67f41e
echo 'Loading Linux 2.6.35-24-generic ...'
linux /boot/vmlinuz-2.6.35-24-generic root=UUID=064c922c-d3ba-41ba-994d-e9cfca67f41e ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set 064c922c-d3ba-41ba-994d-e9cfca67f41e
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=064c922c-d3ba-41ba-994d-e9cfca67f41e ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set 064c922c-d3ba-41ba-994d-e9cfca67f41e
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=064c922c-d3ba-41ba-994d-e9cfca67f41e ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set 064c922c-d3ba-41ba-994d-e9cfca67f41e
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set 064c922c-d3ba-41ba-994d-e9cfca67f41e
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set c42c44592c44491e
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
回复