Ubuntu 管理心得

搜尋此網誌

2020年6月29日 星期一

update grub efi from grub pc for gpt uefi


  1. make a fat32 partition of size 10M, e.g. /dev/sda1
  2. sudo mkdir /boot/efi
  3. put this line into /etc/fstab
    UUID=4CA9-C727  /boot/efi       vfat    umask=0077      0       1
  4. sudo mount -a
  5. purge old grub-pc, e.g.
  6. install grub-efi. e.g.  apt install grub-efi
  7. sudo update-grub
  8. sudo grub-install
  9. Done.

Using ubuntu live CD and suppose /mnt/2 contains all the old operation system, say ubuntu 18.04.
cd /mnt/2
mount -B /dev dev
mount -B /dev/pts dev/pts
mount -B /proc proc
mount -B /sys sys
mount -B /run run

cd /
chroot /mnt/2
vim /etc/hosts, add this line:
140.110.240.80 tw.archive.ubuntu.com 
 
To find where efi, say sda2, then
mount /dev/sda2 /boot/efi
apt purge grub-pc
apt update
apt install grub-efi

update-grub
grub-install
exit

umount /mnt/2/dev/pts
umount /mnt/2/dev
umount /mnt/2/proc
umount /mnt/2/sys
umount /mnt/2/run








沒有留言:

張貼留言

網誌存檔