我和 grub 作斗争
Posted 10 months ago at 11:30 am. 0 comments
dapper beta(2.6.15.23.39) 安装完毕,其实什么也不需要。grub出错,从头再来一次即可。
以下为引用内容:
硬盘安装ubuntu,提示grub不能安装时选择返回,重新安装基本系统,等基本系统安装完后就自动把grub安装上去了的。
装系统最大的痛苦就是,没有工具也看不到资料!dapper beta 装完,再次遇到无法安装 grub 的问题!
反复重启到 xp 上网搜索方法,然后重启去试验,看来只有一台电脑或者不能上网那就死定了…
资料:
title Debian linux
root (hd0,2)
kernel /boot/vmlinuz-2.2.18 root=/dev/hda3 ro
initrd /boot/initrd-2.2.18.gz
其实很简单. fc5默认的内核是vmlinuz-2.6.15-1.2054_FC5.
而且其实是在根目录下.所以将以上引导代码改为:
root (hd1,6)
kernel /vmlinuz-2.6.15-1.2054_FC5
initrd /initrd-2.6.15-1.2054_FC5.img
boot
就可以了…
查找系统中的内核文件的位置:
grub> find /boot/vmlinuz
(hd0,7)
如果你采用了单独的 boot 分区, 那么需要用
grub> find /vmlinuz
来查找。假定找到的结果是
(hd0,6)
再查找系统中有哪些根分区:
grub> find /sbin/init
(hd0,7)
启动内核的命令是:
grub> kernel (hd0,6)/vmlinuz root=/dev/hda8
grub> boot
如果你的 (hd0,7) 不是 /dev/hda8 而是 /dev/hdb8, 你就试试它:
grub> kernel (hd0,6)/vmlinuz root=/dev/hdb8
grub> boot
分区号是准确的, 只有硬盘号可能会有变化. IDE 硬盘只有 4 种变化, hda, hdb, hdc, hdd, 一个一个地试验, 总可以成功. 当然, 如果你的是 SCSI 硬盘, 需要试验的是 sda, sdb, sdc, sdd 等。
-Step 1. 在出现的提示符“grub”后使用命令查找“ /boot/grub/grub.conf ” 在哪个分区 ,在提示符后输入: ” find /boot/grub/gurb.conf “回车 (返回值类似: (hd0,0)) 。
-Step 2. Find命令查询结果为(hd0,0),设置改分区为root:,在提示符后输入 ” root (hd0,0) “回车(返回值类似: Filesystem type is ext2fs, partition type ox83 )。
-Step 3. 使用Setup命令安装Grub到(hd0),即重写(hd0)的主引导扇区(MBR),在提示符后输入: ” setup (hd0) ” 回车。
安装完毕,在提示符后输入:“reboot”回车,重新引导系统,即可看到正确的Grub启动引导界面。
选择linux启动选项从linux系统启动,启动后默认是进入字符模式,输入根用户名root和密码后,输入“startx”命令即可启动到图形界面,我们也可以修改改/etc/inittab里的内容,命令:vi /etc/inittab
在
id:3:initdefault:
那把3改成5即可从自动启动到图形界面!!
To reinstall grub:
1. boot from your Ubuntu InstallationCD
2. type rescue at the boot prompt.
3. select your root partition
(4. mount /usr if it’s on a different partition, like it is in my case)
5. type grub-install
There is the su command ‘grub-install /dev/hdx’ which should work.
Of course this is assuming you’ve already done a ‘apt-get install grub’.
But there is no difference between the commands used to place grub to the MBR in Gentoo and Ubuntu. If you are familiar with this process then you should have no problems, save that there is another issue present which would prevent the proper configuration.
You know the drill:
$ grub
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
$
HOWTO: Restore GRUB (if your MBR is messed up)
Restore GRUB quite simple in Ubuntu, instead going through all the “gain root access” and play with shell commands, you can use the Ubuntu installation CD to restore it without going through all kinds of hassles.
Here are the steps:
1. Boot your computer up with Ubunto CD
2. Go through all the process until you reech “[!!!] Disk Partition”
3. Select Manual Partition
4. Mount your appropriate linux partions
/
/boot
swap
…..
5. DO NOT FORMAT THEM.
6. Finish the manual partition
7. Say “Yes” when it asks you to save the changes
8. It will give you errors saying that “the system couldn’t install …..” after that
9. Ignore them, keep select “continue” until you get back to the Ubuntu installation menu
10. Jump to “Install Grub ….”
11. Once it is finished, just restart your computer
Good luck!.
1. Pop in the Live CD, boot from it until you reach the desktop.
2. Open a terminal window or switch to a tty.
3. Type “grub”
4. Type “root (hd0,6)”, or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sda7, which translates to hd0,6 for grub).
5. Type “setup (hd0)”, ot whatever your harddisk nr is.
6. Quit grub by typing “quit”.
7. Reboot.
I may be missing your point though, if so, please forgive me
Popularity: 6% [?]
Tags: deb, install, linux, shell, tty, ubuntu, viRelated posts
No Replies
Feel free to leave a reply using the form below!