您的位置:首页 > 其它

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

2016-01-17 21:10 288 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: