溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

CentOS GRUB負(fù)責(zé)怎樣管理啟動Linux

發(fā)布時間:2021-09-28 17:36:31 來源:億速云 閱讀:133 作者:柒染 欄目:系統(tǒng)運維

CentOS GRUB負(fù)責(zé)怎樣管理啟動Linux,相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。

CentOS GRUB負(fù)責(zé)是CentOS用戶必須學(xué)習(xí)使用的,由于CentOS GRUB還有很多人不會應(yīng)用所以由我來簡述說明下,至于管用否就看人品了.如何修改CentOS GRUB的開機選項? (OS) (Linux) (Ubuntu) (CentOS) 。CentOS Linux的使用者也不會遇到任何的版權(quán)問題。CentOS面向那些需要企業(yè)級操作系統(tǒng)穩(wěn)定性的人們,而且并不存在認(rèn)證和支持方面的開銷。

Abstract CentOS GRUB負(fù)責(zé)管理啟動Linux還是Windows,該如何修改GRUB開機選項呢?
Introduction
為什么需要更改CentOS GRUB呢?
1.當(dāng)Ubuntu更新新的kernel后,GRUB會自動加上新的kernel開機選項,導(dǎo)致開機選項越來越多,想將不必要的開機選項刪除.
2.CentOS GRUB預(yù)設(shè)開機為Ubuntu,你可以想將預(yù)設(shè)開機改成Windows.
3.修改預(yù)設(shè)CentOS GRUB等待時間.
4.預(yù)設(shè)不顯示GRUB menu,直接進(jìn)入Windows.
假如你有以上需求,就得手動修改GRUB開機選項.
Solution

開啟CentOS GRUB開機選項檔sudo gedit /boot/grub/menu.lst

Q1.當(dāng)Ubuntu更新新的kernel后,CentOS GRUB會自動加上新的kernel開機選項,導(dǎo)致開機選項越來越多,想將不必要的開機選項刪除.
A1.以下為我所要的開機選項,不需要者可自行刪除之## ## End Default Options ##
title        Ubuntu, kernel 2.6.20-16-generic
root        (hd0,6)
kernel        /boot/vmlinuz-2.6.20-16-generic root=UUID=b923ef76-3246-411c-8095-7bca666b13a5 ro quiet splash
initrd        /boot/initrd.img-2.6.20-16-generic
quiet
savedefault
title        Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root        (hd0,6)
kernel        /boot/vmlinuz-2.6.20-16-generic root=UUID=b923ef76-3246-411c-8095-7bca666b13a5 ro single
initrd        /boot/initrd.img-2.6.20-16-generic

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Microsoft Windows XP Professional
root        (hd0,0)
savedefault
makeactive
chainloader    +1

Q2.CentOS GRUB預(yù)設(shè)開機為Ubuntu,你可以想將預(yù)設(shè)開機改成Windows.
A2.修改
## default num
# 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.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# 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.
default        2
預(yù)設(shè)default為 0,表示開機用Ubuntu開機,因為在我的電腦Windows為第三個選項,故default為2

Q3.修改預(yù)設(shè)CentOS GRUB等待時間.
A3.修改
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout        3
預(yù)設(shè)為10秒鐘,我改成等待3秒鐘

Q4.預(yù)設(shè)不顯示CentOS GRUB menu,直接進(jìn)入Windows.
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu
預(yù)設(shè)會顯示GRUB menu,若你不想顯示menu,要當(dāng)按下ESC才顯示,請將hiddenmenu前的#拿掉

看完上述內(nèi)容,你們掌握CentOS GRUB負(fù)責(zé)怎樣管理啟動Linux的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI