0

I've been using Ubuntu 16 and yesterday it was taking too much time to boot. So I forced restart it by pressing and holding the power button. Later when I tried to boot it,it's "Unable to mount root fs on unknown-block(0,0) How can I fix this without losing my data?

enter image description here

Videonauth
  • 33,355
  • 17
  • 105
  • 120

1 Answers1

1

Start with a live USB/CD, choose 'Try Ubuntu' and open a terminal (Ctrl+Alt+T):

  1. List your partitions with sudo fdisk -l and choose the right one to mount:

    sudo mount /dev/sdaX /mnt
    

    Where sdX is your Ubuntu installation on your HDD. If you have an EFI boot system you need to mount your EFI partition as well.

    sudo mount /dev/sdY /mnt/boot/efi
    

    Where sdY is your EFI partition.

  2. Now mount the following and chroot into your install

    # in case you need to reinstall the kernel (you will need LAN connection for this)
    sudo cp /mnt/etc/hosts /mnt/etc/hosts.old
    sudo cp /etc/hosts /mnt/etc/hosts
    sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
    
    # the below is always needed
    sudo mount -o bind /dev /mnt/dev
    sudo mount -o bind /dev/pts /mnt/dev/pts
    sudo mount -t sysfs /sys /mnt/sys
    sudo mount -t proc /proc /mnt/proc
    sudo chroot /mnt
    
  3. Create a update-initramfs and update-grub. Make sure you put the right version number into the next line, you can find this by dpkg --list | grep linux-image.

    update-initramfs -u -k 4.4.0-101-generic
    update-grub
    

    If that step fails for whatever reason you might want to reinstall that kernel with:

     apt install --reinstall linux-image-4.4.0-101-generic linux-image-extra-4.4.0-101-generic linux-firmware
    
  4. Unmount and reboot your system.

    exit
    sudo umount /mnt/dev/pts
    sudo umount /dev /mnt/dev
    sudo umount /mnt/sys
    sudo umount /mnt/proc
    sudo umount /mnt/boot/efi
    sudo umount /mnt
    reboot
    
Videonauth
  • 33,355
  • 17
  • 105
  • 120