2

There are a lot of answers and tutorials how to fix this but I was not able to apply any of the solutions in my case.

Here is my situation:

  • I have perfectly working Ubuntu 12.04
  • I have installed Ubuntu 14.04
  • the error occurred when I am trying to boot 14.04 (the 12.04 is working fine)

I have usb stick with 14.04 and working 12.04 so I am able to apply fixes or debug further.

Running sudo grub-update gives me:

> Generating grub.cfg ... Found linux image:
> /boot/vmlinuz-3.5.0-52-generic Found initrd image:
> /boot/initrd.img-3.5.0-52-generic Found linux image:
> /boot/vmlinuz-3.5.0-46-generic Found initrd image:
> /boot/initrd.img-3.5.0-46-generic Found linux image:
> /boot/vmlinuz-3.5.0-45-generic Found initrd image:
> /boot/initrd.img-3.5.0-45-generic Found linux image:
> /boot/vmlinuz-3.5.0-23-generic Found initrd image:
> /boot/initrd.img-3.5.0-23-generic Found memtest86+ image:
> /boot/memtest86+.bin Found Ubuntu 14.04 LTS (14.04) on /dev/sda6 
> done

One of the solution I have try was to press e on the grub menu and replace the ID with /dev/sda6, but nothing change.

What is causing the issue and is there an easy way to fix the grub using the 12.04?


enter image description here

enter image description here


enter image description here enter image description here

    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 0970394e-13f2-47c9-979e-c93cb6eef06d
    linux   /boot/vmlinuz-3.5.0-52-generic root=UUID=0970394e-13f2-47c9-979e-c93cb6eef06d ro   quiet splash $vt_handoff
    initrd  /boot/initrd.img-3.5.0-52-generic
}
--
    search --no-floppy --fs-uuid --set=root 0970394e-13f2-47c9-979e-c93cb6eef06d
    echo    'Loading Linux 3.5.0-52-generic ...'
    linux   /boot/vmlinuz-3.5.0-52-generic root=UUID=0970394e-13f2-47c9-979e-c93cb6eef06d ro recovery nomodeset 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.5.0-52-generic
--
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 0970394e-13f2-47c9-979e-c93cb6eef06d
    linux   /boot/vmlinuz-3.5.0-46-generic root=UUID=0970394e-13f2-47c9-979e-c93cb6eef06d ro   quiet splash $vt_handoff
    initrd  /boot/initrd.img-3.5.0-46-generic
}
--
    search --no-floppy --fs-uuid --set=root 0970394e-13f2-47c9-979e-c93cb6eef06d
    echo    'Loading Linux 3.5.0-46-generic ...'
    linux   /boot/vmlinuz-3.5.0-46-generic root=UUID=0970394e-13f2-47c9-979e-c93cb6eef06d ro recovery nomodeset 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.5.0-46-generic
--
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 0970394e-13f2-47c9-979e-c93cb6eef06d
    linux   /boot/vmlinuz-3.5.0-45-generic root=UUID=0970394e-13f2-47c9-979e-c93cb6eef06d ro   quiet splash $vt_handoff
    initrd  /boot/initrd.img-3.5.0-45-generic
}
--
    search --no-floppy --fs-uuid --set=root 0970394e-13f2-47c9-979e-c93cb6eef06d
    echo    'Loading Linux 3.5.0-45-generic ...'
    linux   /boot/vmlinuz-3.5.0-45-generic root=UUID=0970394e-13f2-47c9-979e-c93cb6eef06d ro recovery nomodeset 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.5.0-45-generic
--
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 0970394e-13f2-47c9-979e-c93cb6eef06d
    linux   /boot/vmlinuz-3.5.0-23-generic root=UUID=0970394e-13f2-47c9-979e-c93cb6eef06d ro   quiet splash $vt_handoff
    initrd  /boot/initrd.img-3.5.0-23-generic
}
--
    search --no-floppy --fs-uuid --set=root 0970394e-13f2-47c9-979e-c93cb6eef06d
    echo    'Loading Linux 3.5.0-23-generic ...'
    linux   /boot/vmlinuz-3.5.0-23-generic root=UUID=0970394e-13f2-47c9-979e-c93cb6eef06d ro recovery nomodeset 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.5.0-23-generic
--
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set=root ee707b14-31a7-4f86-a6e5-1b9aa38bdd68
    linux /boot/vmlinuz-3.13.0-30-generic root=UUID=ee707b14-31a7-4f86-a6e5-1b9aa38bdd68 ro nomodeset quiet splash $vt_handoff
    initrd /boot/initrd.img-3.13.0-30-generic
}
--
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set=root ee707b14-31a7-4f86-a6e5-1b9aa38bdd68
    linux /boot/vmlinuz-3.13.0-30-generic root=UUID=ee707b14-31a7-4f86-a6e5-1b9aa38bdd68 ro nomodeset quiet splash $vt_handoff
    initrd /boot/initrd.img-3.13.0-30-generic
}
--
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set=root ee707b14-31a7-4f86-a6e5-1b9aa38bdd68
    linux /boot/vmlinuz-3.13.0-30-generic root=UUID=ee707b14-31a7-4f86-a6e5-1b9aa38bdd68 ro recovery nomodeset nomodeset
    initrd /boot/initrd.img-3.13.0-30-generic
}
--
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set=root ee707b14-31a7-4f86-a6e5-1b9aa38bdd68
    linux /boot/vmlinuz-3.13.0-24-generic root=UUID=ee707b14-31a7-4f86-a6e5-1b9aa38bdd68 ro nomodeset quiet splash $vt_handoff
    initrd /boot/initrd.img-3.13.0-24-generic
}
--
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set=root ee707b14-31a7-4f86-a6e5-1b9aa38bdd68
    linux /boot/vmlinuz-3.13.0-24-generic root=UUID=ee707b14-31a7-4f86-a6e5-1b9aa38bdd68 ro recovery nomodeset nomodeset
    initrd /boot/initrd.img-3.13.0-24-generic
}
  • What error? Add error message to your question. – enedil Jul 15 '14 at 22:40
  • The error is in the title "Gave up waiting for root device" or you need the whole text :? – gotqn Jul 16 '14 at 6:04
  • I guess 14.04 boot partition is on /dev/sda6 while 12.04 is somewhere else. Can you check with mount where 12.04 boot partition resides? Also tell where the root devices for 12.04 and 14.04 are since it appears grub is not able to correctly point to the latter one. – sumwale Jul 16 '14 at 7:55
  • @sumwale I have not got good linux knowledge. Could you tell me what commands I need to execute and I will paste the output here? – gotqn Jul 16 '14 at 9:04
  • Once you have booted into 12.04, we need to confirm where 14.04 was installed. Paste the output of mount, sudo fdisk -l /dev/sda (or sudo gdisk -l /dev/sda for EFI system). – sumwale Jul 16 '14 at 19:59
4

Two possible causes for the above error are (assuming install is not completely broken):

a) Grub is not loading the correct root for booting of 14.04

b) The entry for root in 14.04 install's fstab and/or initrd is broken.

Given the comments in question, it looks unlikely that a) would be the cause. Reason being that replacing with root=/dev/sda6 in grub did not help. The 12.04 grub entries look correct, but it is likely that the actual grub install is currently is from 14.04 (can be checked from entries shown in front grub boot page would be of 14.04 and 12.04 will be in alternative screen). So replacing with 12.04 grub can be tried first though, as mentioned, it is likely not the problem. From working 12.04 environment:

sudo grub-install /dev/sda

Do confirm that grub has some timeout set to enable selecting an option: sudo gedit /etc/default/grub , both GRUB_HIDDEN_TIMEOUT and GRUB_TIMEOUT should be non-zero say 10 (for 10secs timeout), and then run sudo update-grub. Reboot will now show 12.04 in the front boot screen while 14.04 will be in the alternative screen. If 14.04 now works then we are done and can just install 14.04's grub by running sudo grub-install /dev/sda from 14.04 environment. Otherwise we will try to fix b) as mentioned next.

There are two ways to go about b). One is to boot from live CD, mount existing install and then fix it. Other is to fix from the working 12.04 install. I will elaborate on 2nd, though 1st option will be fairly similar with the only difference being booting into live CD instead of existing 12.04 install.

After booting into 12.04, first drop into root shell to avoid repeated sudo invocations: sudo -i.

Now we will mount the 14.04 install somewhere (say /mnt/trusty) and chroot into it which will make the 14.04 install as the new root for that shell (and effectively make the shell as 14.04 one). In the old Linux days this was mostly sufficient to operate in a 14.04 environment from a shell, but in newer kernels most of the device files in /dev have become dynamic and replaced by the udev daemon, so it requires manual creation of many things first. However, for our purposes of fixing the fstab/initrd it should be fine as is. Still we will have to do a couple of things to avoid warnings/errors -- copy current mtab and mount proc.

mkdir /mnt/trusty
mount /dev/sda6 /mnt/trusty
cp /etc/mtab /mnt/trusty/etc/mtab

At this point we are ready to check and fix fstab, before chrooting, then regenerate 14.04 kernel's initrd image. So open it: gedit /mnt/trusty/etc/fstab and check that the first uncommented line has the correct UUID for mount point of root (/). In this case we have seen that UUID of 14.04's root /dev/sda6 is ee707b14-31a7-4f86-a6e5-1b9aa38bdd68, so check that fstab also says the same else correct the UUID, save fstab and close. Now we can regenerate the initrd:

chroot /mnt/trusty
mount -t proc proc /proc
update-initramfs -k all -c

This should end without errors. Then unmount /proc, logout from chroot environment and unmount 14.04:

umount /proc
exit
umount /mnt/trusty

Now reboot and try starting 14.04. If it now starts fine, then replace with 14.04's grub as mentioned before: sudo grub-install /dev/sda from 14.04 environment. Also will be a good idea to regenerate initrd from within 14.04 environment just in case the chrooted environment had some differences: sudo update-initramfs -k all -c.

|improve this answer|||||
  • thanks for the detailed answer but I was not able to start the 14.04 again. I guess there might be something wrong with the updates I have performed after the installation itself. I think I should install it again. – gotqn Jul 19 '14 at 15:40
  • I had a similar problem and solved thanks to you... I wish that somebody buys you a beer/coffee/icecream/kombucha/whatever pretty soon! – Marco Bolis Dec 3 '14 at 21:20
1

I got the same error message and nothing helped. In my case, the error turned out to be corruptions the file system. It was failing to read from the disk.

I fixed it by running fsck on my linux drives (/dev/sdaN) with the -f option. That way I forced fsck to check the drive for errors (and not just read the flag from the last check) and manually corrected the errors it found.

Once the errors were fixed, my system was back online after a reboot. I hope this helps.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.