Ubuntu recovery mode with LVM drives

Had a client who had to restart a few of his Ubuntu servers due to a power outage and after restart one of them gave error messages and refused to boot. Error messages given were:

mountall: fsck /boot [397] terminated with status 1
init: ureadahead-other main process (1751) terminated with status 4
mount.nfs: mounting failed, reason given by server: No such file or directory
mountall: mount /usr/data/server_files [1283] terminated with status 32

I also discovered that a second server (a Qnap file server) had lost its raid configuration (!) during the restart and was non-responsive. This was also the server having the nfs volumes the earlier messages failed to find. After some googeling I found someone mentioning a bug in Ubuntu connecting crashed reboots with failure to mount nfs volumes at boot.
To try that theory out I did the following steps:

  1. Reboot server with Ubuntu installation cd and select rescue mode. Click through the whole process.
  2. Select to not mount /dev/sda1 (or what it’s called) as root. It’ll then be mounted in /target instead.
  3. If you’re not using LVM you can use fdisk to find what partitions you can mount.
  4. If you have LVM you can use the following steps to find and mount the correct volume:
    1. Find volume groups available:
    2. # lvm vgscan –v
    3. Activate the volume groups
    4. # lvm vgchange –a y
    5. Show the logical volumes
    6. # lvm lvs –all
    7. Mount the logical volume you need access to
    8. # mount /dev/{volume group}/{logical volume} /{mountpoint}

  5. Open your fstab file using nano or another editor (vi or vim seems to be non available). Remove the line mounting the NFS volume. Save with CTRL+X.
  6. Reboot the system.

This worked well for my client and his server started without any problems. The dead Qnap is another story though…