- transfer a fully-functional copy of Ubuntu (i.e., with all software packages such as Wine, MS-Office, WeChat/QQ/WhatsApp installed) onto another computer
- the fully-function copy of Ubuntu is in legacy mode, but the target computer requires booting in UEFI mode
- during installation, the computer is booted in legacy mode (by default, installing UEFI Ubuntu requires booting Ubuntu install CD/thumb-drive/etc in UEFI mode)
The steps are as follows:
- Resize existing partitions and create new partitions for the new Ubuntu OS.
- Boot into {a copy of Ubuntu system} or {Ubuntu installer} in either legacy or UEFI mode.
- Copy the pre-installed Ubuntu system folders recursively onto the target partition (e.g., /target) (use "cp -rfa", exclude /dev, /proc, /sys, /mnt, /run, but create these folders on the target partition and use the mount command to bind them, also bind /dev/pts)
- Mount the EFI partition to /target/boot/efi
- chroot into /target, "
sudo chroot /target
", inside the fake root environment: - install grub-efi, "sudo apt-get install grub-efi"
- link up EFI partition, "
grub-install --target=x86_64-efi /dev/sdX
", ignore any errors - copy
grubx64.efi
(check /target/boot/EFI/ubuntu folder) into/target/boot/efi/EFI/BOOT/bootx64.efi and /target/boot/efi/EFI/ubuntu/grubx64.efi
copy grub.cfg (check /target/boot/grub/grub.cfg) into
/target/boot/efi/EFI/ubuntu/grub.cfg
edit /target/etc/fstab and /target/boot/efi/EFI/ubuntu/grub.cfg to make sure all partitions are correct
(
If Secure Boot is active, it gets more complex; you must copy shimx64.efi
to EFI/BOOT/bootx64.efi
and copy grubx64.efi
to EFI/BOOT/grubx64.efi
.)
No comments:
Post a Comment