LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1338|回复: 6

update-grub将vga=791 resume=/dev/sda9清除了

[复制链接]
发表于 2008-4-9 17:03:50 | 显示全部楼层 |阅读模式
原来我配置好了menu.lst
其中有

122 title       Debian GNU/Linux, kernel 2.6.24-686
123 root        (hd0,7)
124 kernel      /vmlinuz-2.6.24-686 root=/dev/sda10 ro vga=791 resume=/dev/sda9
125 initrd      /initrd.img-2.6.24-686
126
127 title       Debian GNU/Linux, kernel 2.6.24-686 (single-user mode)
128 root        (hd0,7)
129 kernel      /vmlinuz-2.6.24-686 root=/dev/sda10 ro single
130 initrd      /initrd.img-2.6.24-686
131

但是当运行了update-grub之后,vga=791 resume=/dev/sda9就不见了。

即使我设置了defoptions=vga=791 resume=/dev/sda9也不行,只要一运行update-grub就清除了

有没有办法保留这个字段呢?
发表于 2008-4-9 21:26:01 | 显示全部楼层
Debian 的更新脚本很愚蠢,更新内核前最好将原来的 menu.lst 备份,更新後再手功加回来

另一个不正常的蠢 bug 就是如果 /boot 是独立分区,那麽更新内核後其路径必然是错的!

不要过份依赖发行版的更新脚本,靠自己吧。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-9 22:11:37 | 显示全部楼层
问题是每次安装内核或升级内核之后都需要更新grub的,sigh
回复 支持 反对

使用道具 举报

发表于 2008-4-9 22:30:39 | 显示全部楼层
非也,不是要更新 grub,是要更新 menu.lst
回复 支持 反对

使用道具 举报

发表于 2008-4-14 21:47:29 | 显示全部楼层

其实。。。可以处理的

下面的就是我的menu.lst文件,可没小看文件里的注释,在“## ## Start Default Options ##”后面直到“## ## End Default Options ##”处的“##”才表示注释,面单个的“#”对grub是注释,对update-grub是配置文件!
  1. # menu.lst - See: grub(8), info grub, update-grub(8)
  2. #            grub-install(8), grub-floppy(8),
  3. #            grub-md5-crypt, /usr/share/doc/grub
  4. #            and /usr/share/doc/grub-doc/.
  5. ## default num
  6. # Set the default entry to the entry number NUM. Numbering starts from 0, and
  7. # the entry number 0 is the default if the command is not used.
  8. #
  9. # You can specify 'saved' instead of a number. In this case, the default entry
  10. # is the entry saved with the command 'savedefault'.
  11. # WARNING: If you are using dmraid do not change this entry to 'saved' or your
  12. # array will desync and will not let you boot your system.
  13. default         1
  14. ## timeout sec
  15. # Set a timeout, in SEC seconds, before automatically booting the default entry
  16. # (normally the first entry defined).
  17. timeout                3
  18. # Pretty colours
  19. color cyan/blue white/blue
  20. ## password ['--md5'] passwd
  21. # If used in the first section of a menu file, disable all interactive editing
  22. # control (menu entry editor and command-line)  and entries protected by the
  23. # command 'lock'
  24. # e.g. password topsecret
  25. #      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
  26. # password topsecret
  27. #
  28. # examples
  29. #
  30. # title                Windows 95/98/NT/2000
  31. # root                (hd0,0)
  32. # makeactive
  33. # chainloader        +1
  34. #
  35. # title                Linux
  36. # root                (hd0,1)
  37. # kernel        /vmlinuz root=/dev/hda2 ro
  38. #
  39. #
  40. # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
  41. ### BEGIN AUTOMAGIC KERNELS LIST
  42. ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
  43. ## by the debian update-grub script except for the default options below
  44. ## DO NOT UNCOMMENT THEM, Just edit them to your needs
  45. ## ## Start Default Options ##
  46. ## default kernel options
  47. ## default kernel options for automagic boot options
  48. ## If you want special options for specific kernels use kopt_x_y_z
  49. ## where x.y.z is kernel version. Minor versions can be omitted.
  50. ## e.g. kopt=root=/dev/hda1 ro
  51. ##      kopt_2_6_8=root=/dev/hdc1 ro
  52. ##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
  53. # kopt=root=/dev/sda4 ro
  54. ## default grub root device
  55. ## e.g. groot=(hd0,0)
  56. # groot=(hd0,6)
  57. ## should update-grub create alternative automagic boot options
  58. ## e.g. alternative=true
  59. ##      alternative=false
  60. # alternative=false
  61. ## should update-grub lock alternative automagic boot options
  62. ## e.g. lockalternative=true
  63. ##      lockalternative=false
  64. # lockalternative=false
  65. ## additional options to use with the default boot option, but not with the
  66. ## alternatives
  67. ## e.g. defoptions=vga=791 resume=/dev/hda5
  68. # defoptions=resume=/dev/sda9
  69. ## should update-grub lock old automagic boot options
  70. ## e.g. lockold=false
  71. ##      lockold=true
  72. # lockold=false
  73. ## Xen hypervisor options to use with the default Xen boot option
  74. # xenhopt=
  75. ## Xen Linux kernel options to use with the default Xen boot option
  76. # xenkopt=console=tty0
  77. ## altoption boot targets option
  78. ## multiple altoptions lines are allowed
  79. ## e.g. altoptions=(extra menu suffix) extra boot options
  80. ##      altoptions=(single-user) single
  81. # altoptions=(single-user mode) single
  82. ## controls how many kernels should be put into the menu.lst
  83. ## only counts the first occurence of a kernel, not the
  84. ## alternative kernel options
  85. ## e.g. howmany=all
  86. ##      howmany=7
  87. # howmany=all
  88. ## should update-grub create memtest86 boot option
  89. ## e.g. memtest86=true
  90. ##      memtest86=false
  91. # memtest86=true
  92. ## should update-grub adjust the value of the default booted system
  93. ## can be true or false
  94. # updatedefaultentry=true
  95. ## should update-grub add savedefault to the default options
  96. ## can be true or false
  97. # savedefault=false
  98. ## ## End Default Options ##
  99. title                Debian GNU/Linux, kernel 2.6.24.build52
  100. root                (hd0,6)
  101. kernel                /vmlinuz-2.6.24.build52 root=/dev/sda4 ro resume=/dev/sda9
  102. initrd                /initrd.img-2.6.24.build52
  103. title                Debian GNU/Linux, kernel 2.6.24-1-686
  104. root                (hd0,6)
  105. kernel                /vmlinuz-2.6.24-1-686 root=/dev/sda4 ro resume=/dev/sda9
  106. initrd                /initrd.img-2.6.24-1-686
  107. title                Debian GNU/Linux, kernel 2.6.23.1.build51
  108. root                (hd0,6)
  109. kernel                /vmlinuz-2.6.23.1.build51 root=/dev/sda4 ro resume=/dev/sda9
  110. initrd                /initrd.img-2.6.23.1.build51
  111. ### END DEBIAN AUTOMAGIC KERNELS LIST
  112. # This is a divider, added to separate the menu items below from the Debian
  113. # ones.
  114. title                Other operating systems:
  115. root
  116. # This entry automatically added by the Debian installer for a non-linux OS
  117. # on /dev/sda1
  118. title                Microsoft Windows XP Professional
  119. root                (hd0,0)
  120. savedefault
  121. makeactive
  122. chainloader        +1
  123. # This entry automatically added by the Debian installer for an existing
  124. # linux installation on /dev/sda3.
  125. title                fedora 8
  126. root                (hd0,2)
  127. kernel                /boot/vmlinuz root=/dev/sda3 ro
  128. initrd                /boot/initrd
  129. savedefault
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-15 10:06:34 | 显示全部楼层
哦,谢谢啊,果然如此
太ft了,居然两个#....
回复 支持 反对

使用道具 举报

发表于 2008-4-21 20:12:40 | 显示全部楼层
居然有这种事,俺一直手动,长见识了,呵呵。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表