亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

CentOS6.5安裝的UEFI-GPT回退為MBR引導(dǎo)詳解

  發(fā)布時(shí)間:2016-12-19 13:25:28   作者:佚名   我要評(píng)論
今天小編為大家?guī)?lái)的是CentOS6.5安裝的UEFI-GPT回退為MBR引導(dǎo)詳解;希望會(huì)給大家?guī)?lái)幫助,有需要的朋友一起去看看吧

我自己在服務(wù)器上裝了centos 6.5系統(tǒng),默認(rèn)用的就是UEFI,沒有注意可以只用GRUB,接著問題就出現(xiàn)了,我在服務(wù)器內(nèi)安裝了另外一塊帶grub啟動(dòng)系統(tǒng)的硬盤,

這個(gè)硬盤啟動(dòng)系統(tǒng)后,如果去掉此塊硬盤,再重新啟動(dòng),總是識(shí)別不出來(lái)centos 6.5的UEFI,這個(gè)可以通過啟動(dòng)主板的UEFI,然后用UEFI的命令:

mount fs0

fs0:

cd EFI

cd redhat

grub.efi

文件夾名稱可能不準(zhǔn),大概是這樣就可以手動(dòng)啟動(dòng)系統(tǒng)了,另外還可以通過插入系統(tǒng)盤,upgrade一下就可以了,不用每次手動(dòng),也不會(huì)丟失數(shù)據(jù),但是總覺得

這樣不是很好。所以我就有了將UEFI-GPT回退為MBR的想法。

谷歌總是很牛x,所以我得到的結(jié)果是用gdisk,我啟動(dòng)另一個(gè)系統(tǒng),掛載上centos 6.5的硬盤,然后按照google上的步驟:

1

Click "Applications." Point to "Accessories," then click "Terminal." Input the following into Terminal: sudo fdisk -l

2

Press "Enter" to see the disk devices connected to the computer. The device with the asterisk next to it is the boot device. Write down the filename (for example, /dev/sda) assigned to the disk.

3

Input the following into Terminal: sudo apt-get install gdisk. Press "Enter" to install the partitioning tool to Ubuntu.

4

Input "sudo gdisk" into Terminal, then press "Enter" to run gdisk as a superuser. Input the name assigned to the boot device, then press "Enter" again.

5

Press "r," then hit "Enter," to switch to the recovery and transformation options. Press "g," then press "Enter," to select the option to convert GPT to MBR on Linux.

6

Press "w," then press "Enter," to convert GPT to MBR on the primary partitions. Press "y," then "Enter," to finalize and exit.

操作完成后,重啟發(fā)現(xiàn)系統(tǒng)起不來(lái),手動(dòng)引導(dǎo)UEFI也不行了。

人類一思考,上帝就發(fā)笑,可是俺思考后發(fā)現(xiàn)還是能拯救的,

先提前說明,centos 6.5安裝的時(shí)候,是分了三個(gè)區(qū)的,sda1 -- UEFI所在區(qū),是fat32,sda2 -- 在fdisk -l下顯示是NTFS(但實(shí)際上是ext4)的存儲(chǔ)實(shí)際系統(tǒng)和數(shù)據(jù)的分區(qū),

sda3 -- swap 分區(qū)。

我進(jìn)入U(xiǎn)盤啟動(dòng)的系統(tǒng)后,把sda1分區(qū)掛載到mnt目錄內(nèi),發(fā)現(xiàn)在efi->redhat目錄內(nèi),存在一個(gè)文件grub.conf,相比經(jīng)常把玩系統(tǒng)的人都知道這個(gè)是干嘛的。就是有了這個(gè),我才有了希望。

下面就是拯救的具體步驟:

1、mount上sda1,然后拷貝出grub.conf留作后用,切忌!然后umount

2、使用fdisk將sda1修改為83-linux,sda2也修改為83-linux,并且把sda1設(shè)置為啟動(dòng)分區(qū)。

大致命令流程如下: fdisk /dev/sda t 1 83 t 2 83 a 1

3、將sda1做成ext3,因?yàn)樗莊at32

命令:mkfs.ext3 /dev/sda1

4、mount上sda1和sda2,我這里sda1在/mnt,sda2在/sda2 ,給sda1安裝grub,grub-install --root-directory=/mnt /dev/sda,這樣grub就裝好了

5、  把備份的grub.conf拷貝到/mnt/boot/grub目錄下,并且做一個(gè)軟連接,menu.lst指向grub.conf,命令是:ln -s grub.conf menu.lst

6、將/sda2/boot/目錄下在grub.conf內(nèi)用到的文件,一個(gè)是kernel會(huì)用到的,一個(gè)是initrd會(huì)用到的,拷貝到/mnt/boot目錄下

7、修改/mnt/boot/grub/grub.conf,把root (hd0, 1)這個(gè)改為root (hd0,0)

8、保存,sync,umount,卸載硬盤,重新啟動(dòng)就可以了。

相關(guān)文章

最新評(píng)論