Skip to content

Instantly share code, notes, and snippets.

@johnnyfreeman
Last active January 1, 2016 22:39
Show Gist options
  • Save johnnyfreeman/8211662 to your computer and use it in GitHub Desktop.
Save johnnyfreeman/8211662 to your computer and use it in GitHub Desktop.
Fix for this Grub issue (https://bugs.archlinux.org/task/37904). Run as root.
#!/bin/bash
# get correct UUID
NUUID=$(lsblk -no UUID /dev/sda1)
# get wrong UUID
OUUID=$(grep -om 1 '[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}' /boot/grub/grub.cfg)
# replace all wrong UUIDs with the correct UUID in the grub config file
sed -i "s/$OUUID/$NUUID/g" /boot/grub/grub.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment