Wie bekomme ich Windows 7 zu Grub2 zurück?

370
Mohsen Fazaeli

Ich hatte eine Festplatte mit Windows 7. Dann habe ich 2ed HDD hinzugefügt, um centos7 zu installieren. Während des Installationsvorgangs habe ich die automatische Partitionierung von Cent OS gewählt, die Größe jedoch ziemlich geändert. Nach der Installation von cent OS 7 wurden meine Fenster nicht erkannt. Durch das Hinzufügen des NTFS-Pakets sehe ich alle Daten meiner alten Festplatte, sodass die Daten noch vorhanden sind.

Ich habe versucht, es manuell hinzuzufügen, hatte aber keinen Fortschritt.

hier ist mein Befehl fdisk

[root@localhost ~]# fdisk -l  Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk label type: dos Disk identifier: 0x10e2c68d  Device Boot Start End Blocks Id System /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT /dev/sda2 206848 276482047 138137600 7 HPFS/NTFS/exFAT /dev/sda3 276482048 604162047 163840000 7 HPFS/NTFS/exFAT /dev/sda4 604162048 976771071 186304512 7 HPFS/NTFS/exFAT WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.  Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk label type: gpt Disk identifier: 2141811A-B878-4910-9CE8-D3B24515F231   # Start End Size Type Name 1 2048 411647 200M EFI System EFI System Partition 2 411648 2508799 1G Microsoft basic  3 2508800 1086736383 517G Linux LVM   Disk /dev/mapper/centos-root: 214.7 GB, 214748364800 bytes, 419430400 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes   Disk /dev/mapper/centos-swap: 18.2 GB, 18249416704 bytes, 35643392 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes   Disk /dev/mapper/centos-home: 322.1 GB, 322122547200 bytes, 629145600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes 

und dann meine grub2-mkconfig:

[root@localhost ~]# grub2-mkconfig > /dev/null Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-862.11.6.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-862.11.6.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-ff50ccad6fff414e8bebeeb436a02b3d Found initrd image: /boot/initramfs-0-rescue-ff50ccad6fff414e8bebeeb436a02b3d.img done 

während ich 40_custom so setze:

#!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry "Windows 7" { insmod ntfs set root='(hd0,2)' chainloader +1 } 

Ich weiß, dass es vielleicht einfach ist, aber ich weiß nichts über die Datenträgerverwaltung in Cent-Betriebssystemen und habe keine Dokumentation über Menüeinträge gefunden.

Vielen Dank!

0
Ich hatte das gegenteilige Problem, dass `update-grub` eine Windows-Installation fand, die nicht booten konnte. Ich fand, dass [Grub Customizer] (https://www.dedoimedo.com/computers/grub-customizer.html) mir erlaubte, den Eintrag bei jeder Neuerstellung zu entfernen. Ich weiß nicht, ob es dabei helfen wird, ein fehlendes Betriebssystem zu finden. In meinem Fall (Windows 10 EFI-Start) muss ich den Eintrag ** System Setup ** durchgehen, der die UEFI-Startoptionen aufruft. Ich gehe davon aus, dass es etwas mit UEFI oder Secure Boot zu tun hat, aber ich kann damit leben, da ich nicht oft in Windows gehe. Wenn Sie diesen Eintrag haben, müssen Sie diesen verwenden. AFH vor 5 Jahren 0

0 Antworten auf die Frage