Skip to content

Instantly share code, notes, and snippets.

@nhthai2005
Last active April 22, 2022 20:34
Show Gist options
  • Save nhthai2005/3f910069dc917da8574c52b0e0bec67c to your computer and use it in GitHub Desktop.
Save nhthai2005/3f910069dc917da8574c52b0e0bec67c to your computer and use it in GitHub Desktop.
How do I run update-grub from a LiveCD

Howto update-grub from LiveCD

1. List partitions to know which partition is root (/) and mount it

lsblk
sudo mount /dev/sda5 /mnt
Then mount a few more directories that are needed:
sudo mount --bind /dev /mnt/dev
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
Also, if you have a separate Ubuntu boot partition (pretty uncommon these days, but it may be the case):

sudo mount /dev/sdaX /mnt/boot

Start using the mounted directory as the root partition:

sudo chroot /mnt

2. Edit grub

sudo vi /etc/default/grub

3. Update grub

sudo update-grub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment