The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 33,477     Votes:  2 
Tags: linux   grub   uuid  
Link: 🔍 See Original Answer on Super User ⧉ 🔗

URL: https://superuser.com/q/1318288
Title: how do I fix a wrong UUID in grub.cfg?
ID: /2018/04/29/how-do-I-fix-a-wrong-UUID-in-grub.cfg_
Created: April 29, 2018
Upload: September 15, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


When you run update-grub from sda5 it reads the /boot/grub/grub.cfg from sda9 which was copied from sda5. First boot into sda5 which is your primary OS. Then use these commands to fix:

SourceUUID=cc3bca0d-aee4-4b9c-95c2-57212cc36d4d
TargetUUID=64662470-0e58-4dfd-90ac-43227d773556
sudo mkdir /mnt/clone
sudo mount -t auto -v /dev/sda9 /mnt/clone
sudo sed -i "s/$SourceUUID/$TargetUUID/g" /mnt/clone/boot/grub/grub.cfg
sudo update-grub
sudo umount /mnt/clone -l

I based this answer on a Ubuntu 16.04 LTS clone to new partition script.

⇧ How to securely upgrade Ubuntu from 16.04 to 18.04 Why am I not getting the Ubuntu 18.04 upgrade?  ⇩