Disaster Recovery

ALERT! /dev/disk/by-uuid/....does not exist

Introduction

If you have ever had this message below whilst booting (colour is used to highlight only), it seems there is little you can do but start again from scratch, well that's not quite true there are several things you can do, and should do before accepting defeat.
ALERT! /dev/disk/by-uuid/..... does not exist. dropping to a shell. (initramfs)
It probably will not matter how many times you reboot chances are it will go no further until some steps are taken to correct the problem. It is also fair to say that there is more than one way to correct this problem so by no means accept that this is the best or final solution.

What is causing the failure

Hmm! not sure myself but I suspect what is happening is that the Uuid code has changed on the partition that you are, or that you are trying to mount during boot. This should not occur during the lifetime of your computer but in reality your computer(s) suffer knocks and additionally the disk(s) that it uses, be it IDE, Sata or Sata SSD, all these drives degrade over time, this is normal by the way. If a significant change occurs it is possible the Uuid of the disk can also change, then the Uuid the drive originally established with, will not compare to the Uuid the disk or partition now thinks it is.

Recovering a lost drive or partition

  1. Using a spare but recent Ubuntu Live CD or USB Drive start a live session and open a new terminal
  2. #> sudo fdisk -l ("#>" denotes prompt you do not type this)

    [sudo] password for user: Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00026c35 Device Boot Start End Blocks Id System /dev/sda1 * 1 262 2104483+ 83 Linux /dev/sda2 263 394 1060290 82 Linux swap / Solaris /dev/sda3 395 1700 10490445 83 Linux /dev/sda4 1701 38913 298913422+ 83 Linux
    You may get something like this but it is also possible you will have only two entries one for boot and the other swap so bear in mind there are variations. The command "fdisk -l" will tell you the device you need to use a new command "fsck".
  3. #> fsck /dev/sda1

    Now repeat this for the other partitions or drives but NOT the swap partition it does not need or use fsck to check it.
  4. #> fsck /dev/sda3

  5. #> fsck /dev/sda4

    Reply "y" to any errors flagged No I haven't forgotten about /dev/sda2 this you will remember is a swap partition so is not checked.
  6. Reboot now your PC, Laptop or system without the Live CD - booting instead from the hard disk, if the problem persists you will need to follow these remaining steps.
  7. Assuming you are using the later version of Ubuntu to boot from, you would have probably noticed that you are unable to access the boot loader menu when the "esc" key is pressed. Well this time during the boot process at the beginning of your startup sequence press and hold down the "Shift" key located on the left of your keyboard
  8. You will be presented with a kernel selection menu and may look something like this (ignore the highlight colour)
    Ubuntu, with Linux 2.6.32-24-generic Ubuntu, with Linux 2.6.32-24-generic (recovery mode) Memory test (memtest86+)
    You may have others but it's exact composition is not relevant, select using the up and down arrows on your keyboard the first entry at the top of the menu list. WITHOUT pressing your enter key press the "e" for edit key. You may get something like th following:
    recordfail insmod ext2 set root='(hd0,1)' search --no-floppy --fs-uuid --set 581bf36b-51bf-4020-9bd9-2accad2e1\cdb linux /vmlinuz-2.6.32-24-generic root=uuid=72477423-211c-4af9-bb1d-9\97ed95c93b9 ro quite splash initrd /initrd.img-2.6.32.-24-generic
    You can ignore most of the above but the part that says root=uuid=nnnnnnn is the line that needs to be edited so it looks like the following depending in your drive characteristics of course. (Note all Uuid numbers will be different the above is an example) linux /vmlinuz-2.6.32-24-generic root=/dev/sda3 ro quite splash
  9. When your edit is finished Press the Ctrl key and "x" together
  10. Your system will now boot into your desktop temporarily and I do stress temporarily we need to make this fix permanent to do this open a terminal once logged in.

    sudo grub-install /dev/sda (Note we do not specify the partition number)

You should now be able to boot normally - I do hope this explanation goes some way to help you gain confidence with Linux and to use it more and more often.

Summary

Drives are accessed via /dev/hdaN and /dev/sdaN depending on type the "hda" refers to an old style IDE drive the "a" denotes that it is the first drive if it was a "b" this would indicate a second drive as in "hdb". In use now days is "sda" notation again the "a" or "b" helps us identify the drive we are dealing with. The capital "N" I have used as notation and would indicate a number for it to be replaced by 1, 2, 3 etc and would denote the partition value of the drive it is labelled to. Most of the time a simple fsck is good enough to correct errors through booting but, if all else fails then this might get you out of trouble feel free to let me know if this helps you recover you drive or give us your comments to the article below.

Comments

Disaster Recovery Boot Failure in ubuntu 10.10

Thanks for this. I had exactly the issue listed above and nothing I tried fixed it. Until i read this. I did not need to do the 1st part (would not let me do it anyway without root access). I was getting the grub loader but not getting any further. I edited as described above and worked like a charm. I had tried a fix provided by someone else that I think got me to the grub loader, but did not fix the issue fully. They got me to mount drive whilst under cd booted version of ubuntu and then ran update/upgrade and dist-upgrade from command line, this probably covered the 1st part of your fix. But good advice from yourself. Cheers (New User to Linux, 3 days experience lol )