特殊:Badtitle/NS100:GrubHowto/ChangeDefaultOS:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示2个用户的8个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/GrubHowto/ChangeDefaultOS}} | {{From|https://help.ubuntu.com/community/GrubHowto/ChangeDefaultOS}} | ||
{{Languages|UbuntuHelp:GrubHowto/ChangeDefaultOS}} | {{Languages|UbuntuHelp:GrubHowto/ChangeDefaultOS}} | ||
== Changing Default OS == | == Changing Default OS == | ||
Use this guide if you have multiple partitions and operating systems on your computer and want to change the default operating system that will boot up when you turn on your computer. | Use this guide if you have multiple partitions and operating systems on your computer and want to change the default operating system that will boot up when you turn on your computer. | ||
== Back Up Grub Settings == | == Back Up Grub Settings == | ||
Copy this line into [[UbuntuHelp:UsingTheTerminal#head-2fa31364ee2acb07982a2fd5f52c983130565f8f|the|terminal]] and press enter, it will back up your menu.lst and you can use the backup to restore your default settings. | |||
Copy this line into the terminal and press enter, it will back up your menu.lst and you can use the backup to restore your default settings. | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup | sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup | ||
</nowiki></pre> | </nowiki></pre> | ||
== Open in a Text Editor == | == Open in a Text Editor == | ||
Edit the menu.lst file with one of the following commands (depending on what version of Ubuntu you're using): | Edit the menu.lst file with one of the following commands (depending on what version of Ubuntu you're using): | ||
'''Ubuntu''' | '''Ubuntu''' | ||
<pre><nowiki> | <pre><nowiki> | ||
gksudo gedit /boot/grub/menu.lst | gksudo gedit /boot/grub/menu.lst | ||
</nowiki></pre> | </nowiki></pre> | ||
'''Kubuntu''' | '''Kubuntu''' | ||
<pre><nowiki> | <pre><nowiki> | ||
kdesu kate /boot/grub/menu.lst | kdesu kate /boot/grub/menu.lst | ||
</nowiki></pre> | </nowiki></pre> | ||
'''Xubuntu''' | '''Xubuntu''' | ||
<pre><nowiki> | <pre><nowiki> | ||
gksudo mousepad /boot/grub/menu.lst | gksudo mousepad /boot/grub/menu.lst | ||
</nowiki></pre> | </nowiki></pre> | ||
== Finding the Line == | == Finding the Line == | ||
* Find this line in the document that was just opened, it will read like this: | * Find this line in the document that was just opened, it will read like this: | ||
<pre><nowiki> | |||
# Set the default entry to the entry number NUM. Numbering starts from 0, and | # Set the default entry to the entry number NUM. Numbering starts from 0, and | ||
# the entry number 0 is the default if the command is not used. | # the entry number 0 is the default if the command is not used. | ||
第41行: | 第30行: | ||
default 0 | default 0 | ||
... | ... | ||
</nowiki></pre> | |||
* Replace the 0 with the number on the startup list corresponding to the option you want, counting from 0. For example, if you have a list like this one and want to change to Windows XP Home: | * Replace the 0 with the number on the startup list corresponding to the option you want, counting from 0. For example, if you have a list like this one and want to change to Windows XP Home: | ||
<pre><nowiki> | <pre><nowiki> | ||
Ubuntu, kernel 2.6.15-27-amd64-generic | title Ubuntu, kernel 2.6.15-27-amd64-generic | ||
Ubuntu, memtest86+ | ... | ||
title Ubuntu, memtest86+ | |||
Microsoft Windows XP Home | ... | ||
title Other operating systems: | |||
... | |||
title Microsoft Windows XP Home | |||
</nowiki></pre> | </nowiki></pre> | ||
...you would change the number to 3. It is important to note that each lines such as "Other Operating Systems" should be counted as well. | ...you would change the number to 3. It is important to note that each lines such as "Other Operating Systems" should be counted as well. | ||
* Alternatively you can replace the number with the word 'saved' which will make the default whichever entry was last used. Each entry that should be remembered must have the 'savedefault' keyword, this is the case for the normal Ubuntu entries, but not the recovery alternatives. '''WARNING: If you are using dmraid do not change this entry to 'saved' or your array will desync and will not let you boot your system.''' | |||
* Alternatively you can replace the number with the word 'saved' which will make the default whichever entry was last used. Each entry that should be remembered must have the 'savedefault' keyword, this is the case for the normal Ubuntu entries, but not the recovery alternatives. '' WARNING: If you are using dmraid do not change this entry to 'saved' or your array will desync and will not let you boot your system.'' | |||
* Save the edited file | * Save the edited file | ||
== Comments == | == Comments == | ||
* Warbo: How does this handle Ubuntu's adding of new kernels to the list? If I remember correctly any new kernels get added to the top of the list, so this would change the order of the entries and make any "default X" line point to the wrong entry. I have always told people to put the non-Ubuntu OS which they would prefer to be default (eg. Windows, Fedora, whatever) above the "Automagic kernels" comment, thus making any of Ubuntu's automatic changes take place below the prefered entry, meaning it is always at the top so is always entry 0. Also, I know there are GRUB lines which can be added which make the last selected OS the default, but I have forgotten them :) | * Warbo: How does this handle Ubuntu's adding of new kernels to the list? If I remember correctly any new kernels get added to the top of the list, so this would change the order of the entries and make any "default X" line point to the wrong entry. I have always told people to put the non-Ubuntu OS which they would prefer to be default (eg. Windows, Fedora, whatever) above the "Automagic kernels" comment, thus making any of Ubuntu's automatic changes take place below the prefered entry, meaning it is always at the top so is always entry 0. Also, I know there are GRUB lines which can be added which make the last selected OS the default, but I have forgotten them :) | ||
* PatrickSchulz: Warbo, Ubuntu / update-grub adds the new kernel entries at the top of the lines between <pre><nowiki> | |||
* PatrickSchulz: Warbo, Ubuntu / update-grub adds the new kernel entries at the top of the lines between<pre><nowiki> | |||
... | ... | ||
... | ... | ||
第68行: | 第55行: | ||
# | # | ||
# Put static boot stanzas before and/or after AUTOMATIC KERNEL LIST | # Put static boot stanzas before and/or after AUTOMATIC KERNEL LIST | ||
... exactly here ... | ... exactly here ... | ||
</nowiki></pre> | </nowiki></pre> | ||
...and leave the default parameter at | ...and leave the default parameter at | ||
第77行: | 第64行: | ||
</nowiki></pre> | </nowiki></pre> | ||
That's it. | That's it. | ||
Warbo: Yes, that's what I have been telling people to do ("put the non-Ubuntu OS which they would prefer to be default... above the "Automagic kernels" comment"). This is not something I do myself, because I only run Ubuntu and don't apply kernel updates (if you want to see how messed up my boot setup is then look at [[UbuntuHelp:BootFromUSB|BootFromUSB]] :) ) | |||
Warbo: Yes, that's what I have been telling people to do ("put the non-Ubuntu OS which they would prefer to be default... above the "Automagic kernels" comment"). This is not something I do myself, because I only run Ubuntu and don't apply kernel updates (if you want to see how messed up my boot setup is then look at [[UbuntuHelp:BootFromUSB]] :) ) | |||
PatrickSchulz: Ooops! I just read the "...selected OS the default, but I have forgotten them :)". Sorry mea culpa... Next time I drop the tomatoes from my eyes before posting ;-) | PatrickSchulz: Ooops! I just read the "...selected OS the default, but I have forgotten them :)". Sorry mea culpa... Next time I drop the tomatoes from my eyes before posting ;-) | ||
Ateo: My menu.lst has the comment | |||
Ateo: My menu. | |||
<pre><nowiki> | <pre><nowiki> | ||
### BEGIN AUTOMAGIC KERNELS LIST | ### BEGIN AUTOMAGIC KERNELS LIST | ||
</nowiki></pre> | </nowiki></pre> | ||
and not | and not | ||
<pre><nowiki> | <pre><nowiki> | ||
### BEGIN AUTOMATIC KERNELS LIST | ### BEGIN AUTOMATIC KERNELS LIST | ||
</nowiki></pre> | </nowiki></pre> | ||
A very subtle type that had me searching for about 10 minutes. | A very subtle type that had me searching for about 10 minutes. | ||
[https://launchpad.net/~kejava Kevin Valentine]: I was just forwarding this link to a grub newbie because he wants to make Windows his default boot entry. It's normally the last entry. Instead of having him cut and paste large chunks of text around, I told to additionally set updatedefaultentry=true. The default value is automagically updated when new kernels are added. | |||
---- | ---- | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年5月12日 (二) 17:01的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/GrubHowto/ChangeDefaultOS }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/af | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|Afrikaans| [[::GrubHowto/ChangeDefaultOS/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/ar | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|العربية| [[::GrubHowto/ChangeDefaultOS/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/az | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|azərbaycanca| [[::GrubHowto/ChangeDefaultOS/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/bcc | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|جهلسری بلوچی| [[::GrubHowto/ChangeDefaultOS/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/bg | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|български| [[::GrubHowto/ChangeDefaultOS/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/br | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|brezhoneg| [[::GrubHowto/ChangeDefaultOS/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/ca | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|català| [[::GrubHowto/ChangeDefaultOS/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/cs | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|čeština| [[::GrubHowto/ChangeDefaultOS/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/de | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|Deutsch| [[::GrubHowto/ChangeDefaultOS/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/el | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|Ελληνικά| [[::GrubHowto/ChangeDefaultOS/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/es | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|español| [[::GrubHowto/ChangeDefaultOS/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/fa | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|فارسی| [[::GrubHowto/ChangeDefaultOS/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/fi | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|suomi| [[::GrubHowto/ChangeDefaultOS/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/fr | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|français| [[::GrubHowto/ChangeDefaultOS/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/gu | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|ગુજરાતી| [[::GrubHowto/ChangeDefaultOS/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/he | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|עברית| [[::GrubHowto/ChangeDefaultOS/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/hu | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|magyar| [[::GrubHowto/ChangeDefaultOS/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/id | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|Bahasa Indonesia| [[::GrubHowto/ChangeDefaultOS/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/it | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|italiano| [[::GrubHowto/ChangeDefaultOS/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/ja | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|日本語| [[::GrubHowto/ChangeDefaultOS/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/ko | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|한국어| [[::GrubHowto/ChangeDefaultOS/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/ksh | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|Ripoarisch| [[::GrubHowto/ChangeDefaultOS/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/mr | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|मराठी| [[::GrubHowto/ChangeDefaultOS/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/ms | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|Bahasa Melayu| [[::GrubHowto/ChangeDefaultOS/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/nl | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|Nederlands| [[::GrubHowto/ChangeDefaultOS/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/no | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|norsk| [[::GrubHowto/ChangeDefaultOS/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/oc | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|occitan| [[::GrubHowto/ChangeDefaultOS/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/pl | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|polski| [[::GrubHowto/ChangeDefaultOS/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/pt | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|português| [[::GrubHowto/ChangeDefaultOS/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/ro | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|română| [[::GrubHowto/ChangeDefaultOS/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/ru | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|русский| [[::GrubHowto/ChangeDefaultOS/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/si | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|සිංහල| [[::GrubHowto/ChangeDefaultOS/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/sq | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|shqip| [[::GrubHowto/ChangeDefaultOS/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/sr | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|српски / srpski| [[::GrubHowto/ChangeDefaultOS/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/sv | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|svenska| [[::GrubHowto/ChangeDefaultOS/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/th | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|ไทย| [[::GrubHowto/ChangeDefaultOS/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/tr | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|Türkçe| [[::GrubHowto/ChangeDefaultOS/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/vi | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|Tiếng Việt| [[::GrubHowto/ChangeDefaultOS/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/yue | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|粵語| [[::GrubHowto/ChangeDefaultOS/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/zh | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|中文| [[::GrubHowto/ChangeDefaultOS/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/zh-hans | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|中文(简体)| [[::GrubHowto/ChangeDefaultOS/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS | UbuntuHelp:GrubHowto/ChangeDefaultOS | {{#if: | :}}GrubHowto/ChangeDefaultOS}}/zh-hant | • {{#if: UbuntuHelp:GrubHowto/ChangeDefaultOS|中文(繁體)| [[::GrubHowto/ChangeDefaultOS/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:GrubHowto/ChangeDefaultOS|:GrubHowto/ChangeDefaultOS|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :GrubHowto/ChangeDefaultOS/zh | | {{#ifexist: GrubHowto/ChangeDefaultOS/zh | | {{#ifeq: {{#titleparts:GrubHowto/ChangeDefaultOS|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:GrubHowto/ChangeDefaultOS|1|-1|}} | zh | | }}
Changing Default OS
Use this guide if you have multiple partitions and operating systems on your computer and want to change the default operating system that will boot up when you turn on your computer.
Back Up Grub Settings
Copy this line into the|terminal and press enter, it will back up your menu.lst and you can use the backup to restore your default settings.
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
Open in a Text Editor
Edit the menu.lst file with one of the following commands (depending on what version of Ubuntu you're using): Ubuntu
gksudo gedit /boot/grub/menu.lst
Kubuntu
kdesu kate /boot/grub/menu.lst
Xubuntu
gksudo mousepad /boot/grub/menu.lst
Finding the Line
- Find this line in the document that was just opened, it will read like this:
# Set the default entry to the entry number NUM. Numbering starts from 0, and # the entry number 0 is the default if the command is not used. ... default 0 ...
- Replace the 0 with the number on the startup list corresponding to the option you want, counting from 0. For example, if you have a list like this one and want to change to Windows XP Home:
title Ubuntu, kernel 2.6.15-27-amd64-generic ... title Ubuntu, memtest86+ ... title Other operating systems: ... title Microsoft Windows XP Home
...you would change the number to 3. It is important to note that each lines such as "Other Operating Systems" should be counted as well.
- Alternatively you can replace the number with the word 'saved' which will make the default whichever entry was last used. Each entry that should be remembered must have the 'savedefault' keyword, this is the case for the normal Ubuntu entries, but not the recovery alternatives. WARNING: If you are using dmraid do not change this entry to 'saved' or your array will desync and will not let you boot your system.
- Save the edited file
Comments
- Warbo: How does this handle Ubuntu's adding of new kernels to the list? If I remember correctly any new kernels get added to the top of the list, so this would change the order of the entries and make any "default X" line point to the wrong entry. I have always told people to put the non-Ubuntu OS which they would prefer to be default (eg. Windows, Fedora, whatever) above the "Automagic kernels" comment, thus making any of Ubuntu's automatic changes take place below the prefered entry, meaning it is always at the top so is always entry 0. Also, I know there are GRUB lines which can be added which make the last selected OS the default, but I have forgotten them :)
- PatrickSchulz: Warbo, Ubuntu / update-grub adds the new kernel entries at the top of the lines between
... ... ...
Just put the entry for your preferred OS between these lines...
# # Put static boot stanzas before and/or after AUTOMATIC KERNEL LIST ... exactly here ...
...and leave the default parameter at
... default 0 ...
That's it. Warbo: Yes, that's what I have been telling people to do ("put the non-Ubuntu OS which they would prefer to be default... above the "Automagic kernels" comment"). This is not something I do myself, because I only run Ubuntu and don't apply kernel updates (if you want to see how messed up my boot setup is then look at BootFromUSB :) ) PatrickSchulz: Ooops! I just read the "...selected OS the default, but I have forgotten them :)". Sorry mea culpa... Next time I drop the tomatoes from my eyes before posting ;-) Ateo: My menu.lst has the comment
### BEGIN AUTOMAGIC KERNELS LIST
and not
### BEGIN AUTOMATIC KERNELS LIST
A very subtle type that had me searching for about 10 minutes. Kevin Valentine: I was just forwarding this link to a grub newbie because he wants to make Windows his default boot entry. It's normally the last entry. Instead of having him cut and paste large chunks of text around, I told to additionally set updatedefaultentry=true. The default value is automagically updated when new kernels are added.