ubuntu 12.04 修复grub2方法

ubuntu 12.04 修复grub2方法  

2012-04-28 02:18:38|  分类: ubuntu 软件安装 |字号 订阅
可以采用LiveCD 启动Ubuntu,之后就在Ubuntu下操作。
打开终端:
切换到root权限
ubuntu@ubuntu-laptop:~$ sudo -i
#找你ubuntu10.04所在分区
root@ubuntu-laptop:~# fdisk -l
看到的信息(我的,:-)):
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units sectors of 512 512 bytes
Sector size (logical/physical): 512 bytes 4096 bytes
I/O size (minimum/optimal): 4096 bytes 4096 bytes
Disk identifier: 0x191f4f73

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    27265023    13631488   27  Hidden NTFS WinRE
/dev/sda2      27265024    27469823      102400     HPFS/NTFS/exFAT
/dev/sda3        27469824   237185023   104857600     HPFS/NTFS/exFAT
/dev/sda4       237187070   976771071   369792001     Extended
Partition does not start on physical sector boundary.
/dev/sda5       237187072   446902271   104857600     HPFS/NTFS/exFAT
/dev/sda6       446904320   806904319   180000000     HPFS/NTFS/exFAT
/dev/sda7       910905344   976771071    32932864   83  Linux
/dev/sda8       810905600   910899199    49996800   83  Linux
/dev/sda9       806905856   808904703      999424   82  Linux swap Solaris
/dev/sda10      808906752   810897407      995328   83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 8472 MB, 8472494080 bytes
255 heads, 63 sectors/track, 1030 cylinders, total 16547840 sectors
Units sectors of 512 512 bytes
Sector size (logical/physical): 512 bytes 512 bytes
I/O size (minimum/optimal): 512 bytes 512 bytes
Disk identifier: 0x000a0d74

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb4           252    16547587     8273668     W95 FAT32

   2:把 /boot(linux启动的根目录)所在partition 先mount起來
   3:執行 sudo grub-install --root-directory=/media/0d104aff-ec8c-44c8-b811-92b993823444 /dev/sda
(0d104aff-ec8c-44c8-b811-92b993823444 就是有 /boot 那個硬碟的 UUID, /dev/sda ,只有一個硬碟的情況,一般都是sda,,可以進Gparted 看看。。)
在终端输入如下命令:

sudo update-grub

按照提示输入密码,如果顺利的话,会出现如下类似语句,那就表示成功了。

grub.cfg ...

Found Debian background: moreblue-orbit-grub.png

Found linux image: /boot/vmlinuz-2.6.31-15-generic

Found initrd image: /boot/initrd.img-2.6.31-15-generic

Found memtest86+ image: /boot/memtest86+.bin

Found Windows (loader) on /dev/sda1

done
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值