I discovered after updating and rebooting a centos system that it still shows an old grub menu and the new kernel(s) are not there.
After bootup the links from /etc/grub2.cnf
were broken. I recreated these with
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg
This fixed the links and I can see the grub config files looks good (in my limited experience, I have not tried to validated the content of the files), but the menu was not updated. In other words on the next reboot I am again presented with a very old boot menu with some anient kernel versions, only one of which is even still on the system.
On further googling I discovered that the /boot/efi partition is a thing and it should be mounted. It is listed in the /etc/fstab file:
# grep efi /etc/fstab
UUID=E911-FC5F /boot/efi vfat umask=0077,shortname=winnt,nofail 0 0
I created a directory /mnt/efi and tried to mount it to check the file system but get an error stating that vfat is an unknown file system type
[root@app03 etc]# mount -t vfat /dev/sda1 /mnt/efi
mount: unknown filesystem type 'vfat'
I even tried with the mount options from the fstab file:
[root@app03 etc]# mount -o umask=0077,shortname=winnt,nofail --verbose /dev/sda1 /mnt/efi
mount: unknown filesystem type 'vfat'
I tried to load the vfat module but still get the same error
[root@app03 etc]# blkid /dev/sda1
/dev/sda1: SEC_TYPE="msdos" UUID="E911-FC5F" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="895f6027-a800-4f20-8d36-6b5c2f740d90"
[root@app03 etc]# lsmod |grep vfat
[root@app03 etc]# modprobe vfat
[root@app03 etc]# lsmod |grep vfat
[root@app03 etc]# locate vfat
/usr/lib/modules/3.10.0-1062.18.1.el7.x86_64/kernel/fs/fat/vfat.ko.xz
/usr/lib/modules/3.10.0-1160.53.1.el7.x86_64/kernel/fs/fat/vfat.ko.xz
/usr/lib/modules/3.10.0-1160.76.1.el7.x86_64/kernel/fs/fat/vfat.ko.xz
/usr/lib/modules/3.10.0-1160.88.1.el7.x86_64/kernel/fs/fat/vfat.ko.xz
/usr/lib/modules/3.10.0-862.6.3.el7.x86_64/kernel/fs/fat/vfat.ko.xz
/usr/sbin/fsck.vfat
/usr/sbin/mkfs.vfat
/usr/share/man/man8/fsck.vfat.8.gz
/usr/share/man/man8/mkfs.vfat.8.gz
[root@app03 etc]# mount /dev/sda1 /mnt/efi
mount: unknown filesystem type 'vfat'
[root@app03 etc]# grep vfat /etc/filesystems
vfat
[root@app03 etc]#
Looking at the partitions doesn't help me much:
[root@app03 etc]# fdisk -l /dev/sda
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 479.6 GB, 479559942144 bytes, 936640512 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disk label type: gpt
Disk identifier: BBDE0244-EE22-420F-A32E-DC5CB3CF3540
# Start End Size Type Name
1 2048 411647 200M EFI System EFI System Partition
2 411648 2508799 1G Microsoft basic
3 2508800 936638463 445.4G Linux LVM
I'm stuck at this point. I gather I need to re-install the grub using a command such as grub2-install --efi-directory=/boot/efi /dev/sda
but as long as /boot/efi is not mounted I fear it will only make matters worse.
In this case /dev/sda1 is the EFI system partition and /dev/sda2 is the /boot partition.
Questions:
- Can I re-create the EFI partition? Is this neccesary? Would it even help at all?
- Can I use the /dev/sda2 partition in stead and install it there?
- I have five of these application servers and the problem exists only on one of them - how could this even happen?
In case it helps, on another server where it works as expected I see the following:
[root@app02 ~]# lsmod |grep vfat
vfat 17461 1
fat 65950 1 vfat
[root@app02 ~]# mount -v |grep vfat
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)
[root@app02 ~]# df -h |grep efi
/dev/sda1 200M 12M 189M 6% /boot/efi