我想在新的 SSD (480 GB) 中安裝 Windows 10 和 Linux(ubuntu 21 或 debian 11)。但我有一些問題,首先我安裝了Windows 10,它創建了一些分割區:sda1(100 MB - > EFI系統),sda2(16 MB - > Microsoft保留),sda3(194,7 GB - > Microsoft基本數據) )和 sda4(518 MB -> Windows 復原環境)。然後我安裝了ubuntu 21,在安裝時不識別windows安裝。
當我啟動時,進入 Windows SO,當我在 BIOS 中選擇 ubuntu 時,出現關於 /boot/vmlinuz 的錯誤。
現在我從一個live ubuntu開始,這是fdisk的訊息:
kubuntu@kubuntu:~$ sudo fdisk -l
Disk /dev/loop0: 2,03 GiB, 2181812224 bytes, 4261352 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 447,13 GiB, 480103981056 bytes, 937703088 sectors
Disk model: KINGSTON SA400S3
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: C3887667-AC2B-42B3-9E9E-39558477EDA8
Device Start End Sectors Size Type
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 206848 239615 32768 16M Microsoft reserved
/dev/sda3 239616 408535333 408295718 194,7G Microsoft basic data
/dev/sda4 408537088 409597951 1060864 518M Windows recovery environment
/dev/sda5 409597952 761942015 352344064 168G Linux filesystem
/dev/sda6 761942016 927956991 166014976 79,2G Linux filesystem
/dev/sda7 927956992 937701375 9744384 4,6G Linux swap
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
當我想恢復 grub 時:
sudo mount /dev/sda5 /mnt
sudo mount /dev/sda1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sda
答案是:
Installing for i386-pc platform. grub2-install: warning: this GPT
partition label contains no BIOS Boot Partition; embedding won't be
possible. grub2-install: warning: Embedding is not possible. GRUB can
only be installed in this setup by using blocklists. However,
blocklists are UNRELIABLE and their use is discouraged..
grub2-install: error: will not proceed with blocklists.
我從BIOS配置中嘗試了多種方法(Asus Maximus VII Hero)。識別安裝USB時遇到一些問題,所以我不得不使用DVD。
答案1
一般來說,您不需要 GRUB 來識別 Windows – 您可以直接從韌體啟動選單中選擇「Windows Boot Manager」。這兩個開機載入程式可以在 UEFI 中共存。 (不透過 GRUB 啟動 Windows 對於 BitLocker 也有好處。)
Installing for i386-pc platform. grub2-install: warning: this GPT
這表示您正在嘗試安裝 grub2 的 BIOS 版本,而不是 UEFI 版本。嘗試明確指定 UEFI,以及手動指定檔案系統路徑:
grub-install --target=x86_64-efi --efi-directory=/mnt/boot/efi --boot-directory=/mnt/boot
(對於 UEFI,引導程式安裝到已安裝的檔案系統,而不是磁碟,因此您不需要指定“/dev/sda2”。)
您的即時 Kubuntu 系統可能安裝了錯誤的「grub2」軟體包。在 Debian 和 Ubuntu 中,不同的 GRUB「目標系統」檔案(i386-pc
用於 BIOS、x86_64-efi
UEFI)被分成單獨的套件,而不是同時提供所有檔案。如果需要,請嘗試:
apt install grub-efi-amd64{,-bin,-signed}
注意:如果您在 BIOS 模式下啟動 Kubuntu live 系統,它將無法建立指向新安裝的 grub2 的 UEFI NVRAM 項目。檢查是否/sys/firmware/efi/efivars
存在;如果沒有 - 重新啟動並仔細選擇主機板啟動選單中的「UEFI:」選項。
(如果這沒有幫助,有時您可以透過安裝 grub2 兩次並--removable
在第二次嘗試時新增選項來解決該問題。)