ubuntu can't start up--fix grub using ubuntu live cd

Ubuntu could't start up and it stoped at the ui just after VMWare logo.

before this issue happened, i modified /etc/default/grub. so it should be caused by this modification.

fix this problem/fix grub using ubuntu live cd.

1. vm--setting--cd/dvd

using iso image, select ubuntu iso image ubuntu-12.04.5-desktop-amd64.iso.

2. modify ubuntu.vmx in vmware dir

add a line:

bios.forceSetupOnce = "TRUE"

on start up Ubuntu, it will enter BISO.

set booting from cd/dvd, save and exit.

after this time, bios.forceSetupOnce to be set as "FALSE" automaticly.

3. mount ubuntu rootfs to /mnt

sudo su

fdisk -l// determine ubuntu rootfs is located on which device.

mount /dev/sda5 /mnt// mine is /dev/sda5. swap can't be mounted.

mount --bind /proc /mnt/proc

mount --bind /dev /mnt/dev

mount --bind /sys /mnt/sys

chroot /mnt // after it, /mnt is root dir.

4. intall and update new grub

grub-install --root-directory=/mnt /dev/sda5

grub-mkconfig -o /boot/grub/grub.cfg

5. exit chroot and unmounting

exit // exit chroot

umount /mnt/proc

umount /mnt/dev

umount /mnt/sys

umount /mnt

power off and set booting from hard disk in BIOS.

6. configure routes of ubuntu kernel and initrd(rootfs)

it entered grub command line:

grub>

entering the below command to set the route of kernel and initrd(rootfs):

grub>linux /boot/vmlinuz-2.6.31.14 root=/dev/sda5// kernel and rootfs device. my ubuntu rootfs is on dev/sda5 

grub>initrd /boot/initrd.img-2.6.31.14// initrd(rootfs)

grub>boot// boot this designated ubuntu(on my vmware, two ubuntu total).

it booted successful!

saved this dying ubuntu successful!


references:

http://www.xitongzhijia.net/xtjc/20141208/32106.html

http://www.2cto.com/os/201501/370983.html


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值