# Ubuntu System Configuration
This is my personal note for the Linux system configuration for Ubuntu.
## Change Root from Live USB
First of all, mount your root partition and the EFI partition.
```bash=
sudo mount /dev/<root_part> /mnt
sudo mount /dev/<EFI_part> /mnt/boot/efi
```
Then, you have to mount all devices mentioned by the [stackexchange](https://unix.stackexchange.com/questions/91620/efi-variables-are-not-supported-on-this-system). Here is the following command:
```bash=
for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do
sudo mount -B $i /mnt$i;
done
```
After doing these, you can then `chroot` to the root partition.
```bash=
sudo chroot /mnt
```
## Re-install the EFI GRUB Bootloader
First of all, make sure you have done the steps of [Change Root from Live USB](#Change-Root-from-Live-USB), especially the **bind mount** for all devices.
After `chroot`, use the `grub-install` same as that in the [Arch Wiki](https://wiki.archlinux.org/title/GRUB#Installation)
```bash=
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id="<The Name You Prefer>" --recheck
```
Finally, update the grub configuration. The command is
```bash=
update-grub
```
in Ubuntu.
Exit `chroot` mode and type `efibootmgr` to check if there is an entry for the Linux.
If these steps still can't solve this problem. See https://unix.stackexchange.com/questions/473157/grub-disappeared-from-boot-menu-after-uefi-bios-upgrade-on-thinkpad-x1-carbon