歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Gentoo Linux x86快速安裝指南對Grub引導不成功的補救措

Gentoo Linux x86快速安裝指南對Grub引導不成功的補救措

日期:2017/2/28 15:30:03   编辑:Linux教程

Gentoo Linux x86快速安裝指南

參考文檔如下:
http://www.gentoo.org/doc/zh_cn/gentoo-x86-quickinstall.xml#doc_chap2

1,在mirrors.163.com上下載
install-x86-minimal-20120710.iso設置光盤引導

2,到安裝grub,這塊要做更改,因為哪裡漏掉了initrd這塊沒有寫,所以導致系統重啟時啟動不起來
這時其實數據已經保存在sda硬盤上了,這時我們只需要重啟用光盤引導掛上就好了
livecd ~ # mount /dev/sda3 /mnt/gentoo livecd ~ # mount /dev/sda1 /mnt/gentoo/boot

3,在在mirrors.163.com上下載
livedvd-x86-amd64-32ul-2012.1.iso
在一台機器上引導,我們主要是用這裡的/boot分區下的,kernel和initrd
Gentoo-2012 boot # ls
boot grub initramfs-genkernel-x86-3.3.0-gentoo-r1 kernel-genkernel-x86-3.3.0-gentoo-r1
Gentoo-2012 boot # scp * 192.168.220.153:/mnt/gentoo/boot
The authenticity of host '192.168.220.153 (192.168.220.153)' can't be established.
RSA key fingerprint is 97:34:54:99:66:03:48:2e:6a:a7:41:26:d1:50:ea:28.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.220.153' (RSA) to the list of known hosts.
Password:
boot: not a regular file
grub: not a regular file
initramfs-genkernel-x86-3.3.0-gentoo-r1 100% 9504KB 9.3MB/s 9.3MB/s 00:00
kernel-genkernel-x86-3.3.0-gentoo-r1 100% 5704KB 5.6MB/s 9.3MB/s 00:00
這樣我們就可以利用livedvd裡的內核文件啟動了。

4,安裝系統的那台重啟切換到系統硬盤啟動
進入grub時,按住 c ,進入grub命令行編輯模式
grub> root (hd0,0)

grub> kernel /boot/kernel-genkernel-x86-3.3.0-gentoo-r1 root=/dev/sda3

grub> initrd /boot/initramfs-genkernel-x86-3.3.0-gentoo-r1

grub>boot
5,這樣就可以進入系統,再編輯grub.conf文件

localhost ~ # df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 7.1G 2.5G 4.3G 37% /
udev 10M 0 10M 0% /dev
/dev/sda3 7.1G 2.5G 4.3G 37% /
tmpfs 186M 204K 185M 1% /run
rc-svcdir 1.0M 44K 980K 5% /lib/rc/init.d
cgroup_root 10M 0 10M 0% /sys/fs/cgroup
shm 186M 0 186M 0% /dev/shm
localhost ~ # mount /dev/sda1 /boot
這裡boot分區默認沒有掛載可能是系統保護機制,前面fstab裡面有自動掛載,或者那裡設置有問題
不過這裡沒有問題,只要把grub.conf這個文件更改好就可以了,下次就能自動重啟而不用手動引導啟動了

localhost ~ # vim /boot/grub/grub.conf

這裡的vim也是在前面用emerge安裝的,默認只有nano,這個真不會

# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.
default 0
timeout 10
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Gentoo 12.1
root (hd0,0)
kernel /boot/kernel-genkernel-x86-3.3.0-gentoo-r1 root=/dev/sda3
initrd /boot/initramfs-genkernel-x86-3.3.0-gentoo-r1
# vim:ft=conf:
"/boot/grub/grub.conf" 13L, 598C written

6,重啟成功,然後就可以根據自己的需求用emerge安裝自己需要的軟件了

Copyright © Linux教程網 All Rights Reserved