1

I'm a new Ubuntu user.

I have UEFI system and after few tries I succeeded to install (via usb), the latest version of ubuntu.

Now when I'm trying to boot from grub i get this message:

an error occurred while mounting /boot/efi

what can i do?

green
  • 14,306
eerez
  • 11

2 Answers2

2

Type the following commands:

grep efi /etc/fstab
sudo blkid | grep fat

The first command will return information on the EFI System Partition (ESP), as recorded in your /etc/fstab file, which controls automatically-mounted partitions. The second command returns information on all FAT partitions on your computer. The ESP is supposed to be a FAT partition, so you should see some correlations. For instance, here's what I get when I issue these commands on one of my systems:

$ grep efi /etc/fstab
# /boot/efi was on /dev/sda2 during installation
UUID=502D-EB63  /boot/efi       vfat    defaults        0       1
$ sudo blkid | grep fat
/dev/sda2: SEC_TYPE="msdos" LABEL="ESP_FAT16" UUID="502D-EB63" TYPE="vfat"

Note that some systems might return information on two or more FAT partitions from blkid. In such cases, you'll need to figure out which one is your ESP by examining the partition table with gdisk, parted, GParted, or some other partitioning tool. There may be other complications, too, on some systems.

From here, you can look for problems. Pay particular attention to the UUID= values in both outputs. If they don't match, that's the source of the problem. If this is the case, editing /etc/fstab so that it refers to the ESP by its correct filesystem "UUID" (really just a serial number for FAT) should get things working.

Another possible problem won't show up as a discrepancy in the analysis you've just performed, since it's a matter of a filesystem needing repair. You can do this with the dosfsck utility:

sudo dosfsck /dev/sda2

You must pass it the device filename associated with the ESP -- /dev/sda2 in this example, as revealed by the blkid output. After making this repair, the problem should go away, with the caveat that very serious filesystem damage may require more drastic measures, such as backing up the ESP, creating a fresh FAT filesystem on the partition, restoring the data, and adjusting /etc/fstab to use the new "UUID" value.

One more point along these lines: If you're dual-booting with Windows 8, it includes a "fast startup" feature that is basically just a suspend-to-disk feature. Sharing partitions between Windows and Linux with this feature active is almost certain to lead to problems, and I've heard of the ESP being affected by this. Thus, if you're dual-booting with Windows 8, you should disable the fast startup feature. This page describes how to do this in detail.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • i will try this, but another problem is that the windows boot manager via bios is not able to boot. – eerez Apr 19 '13 at 00:20
  • I got this in terminal: ubuntu@ubuntu:~$ grep efi /etc/fstab

    ubuntu@ubuntu:~$ sudo blkid | grep fat

    /dev/sdb1: LABEL="SYSTEM" UUID="88B2-C68B" TYPE="vfat"

    ubuntu@ubuntu:~$ sudo dosfsck /dev/sda2

    dosfsck 3.0.14, 23 Jan 2023, FAT32, LFN

    open: No such file or directory

    – eerez Apr 19 '13 at 00:37
  • As stated in my response, you must run dosfsck on your ESP. /dev/sda2 was my ESP. Yours is /dev/sdb1, so you need to type sudo dosfsck /dev/sdb1. If your grep efi /etc/fstab command returned nothing, then it looks like you have no /etc/fstab entry for your ESP -- but that contradicts the error message, so I suspect you've omitted the output or there's some other strange problem. – Rod Smith Apr 19 '13 at 03:55
  • ubuntu@ubuntu:~$ sudo dosfsck /dev/sdb1 dosfsck 3.0.14, 23 Jan 2023, FAT32, LFN Logical sector size is zero what that's mean? – eerez Apr 19 '13 at 07:43
  • You're getting into pretty hard-core recovery territory, then. I recommend doing a low-level backup of the partition before proceeding. You might then try another OS's recovery tools; or Googling on dosfsck "logical sector size is zero" will return a number of suggestions for fixes involving dd or other utilities. I've never done any of these things, so I can't offer further help on the matter. If you have a backup, it may be easier to create a fresh filesystem and restore the backup. (Keeping a backup of your ESP is wise.) – Rod Smith Apr 19 '13 at 17:10
-3

I was completely lazy and booted a Ubuntu live disk..... once the disk loaded up a desktop, I ran gparted.. I saw that my boot partition /dev/sda1 ext4 with a mount point / had a uuid that looked like a hardware uuid 5465465406546506540d546sd54f66 something like that. (that was a clue to me that.. this was the damaged portion when i had to hard boot when my machine locked up).. I right clicked on said partition made sure it was unmounted and selected check.... thus gparted checked and repaired the partition..... restarted and everything loaded up great... I'm sure it wont work for all cases but it worked for me

  • Your answer is very hard to understand. Please explain more precisely, which changes you performed where and how. When you do so, give me ping by commenting to @DavidFoerste and I'll vote for your answer. – David Foerster Apr 16 '15 at 09:25
  • Aaron, please [edit] your answer and improve the quality as otherwise the system here might delete it automatically because of "Low Quality" If you drop me a note @Fabby after your edit, I'll come back and upvote if there was substantial improvement. – Fabby Apr 16 '15 at 12:57