多系统笔记本迁移硬盘后Win7无法通过Grub启动的修复求助
Hey there, let's work through getting your Windows 7 booting again via Grub. The core issue here is almost certainly that Windows' own boot loader configuration got messed up during the partition restore process—Grub can only hand off to Windows' boot system, so if that's broken, Grub can't fix it alone. Here's a step-by-step plan:
Step 1: Verify Your Partitions & Refresh Grub's System Detection
First, let's make sure Grub is actually seeing Windows correctly from your Ubuntu/MX Linux environment:
- Open a terminal (Ctrl+Alt+T) and run this to list all your partitions:
Look forsudo fdisk -l/dev/sda2—it should be marked as an NTFS partition, and you'll see a note that it's the Windows system partition. - Install (if missing) the tool Grub uses to detect other operating systems:
sudo apt install os-prober - Run
os-proberto force it to scan for Windows:
If it outputs a line likesudo os-prober/dev/sda2:Windows 7 (loader):Windows:chain, that means it found Windows. - Update Grub to rebuild its menu with the correct Windows entry:
Reboot and try selecting the new Windows entry—if this works, you're done! If not, move to the next step.sudo update-grub
Step 2: Manually Boot Windows via Grub Command Line
If Grub's auto-detected entry still fails, let's try manually pointing Grub to Windows' boot loader:
- When the Grub menu appears, press
cto enter the command line. - List all your partitions to find the right one for Windows:
You'll see entries likels(hd0,msdos1)and(hd0,msdos2). Test each with:
Look for als (hd0,msdos2)/Windowsfolder—this confirms it's your system partition (sda2corresponds tomsdos2here). - Set Grub's root to this partition and load the NTFS module:
set root=(hd0,msdos2) insmod ntfs - Chainload Windows' boot loader:
If Windows boots successfully, great! Now we need to fix its internal boot configuration so Grub can reliably boot it in the future.chainloader +1 boot
Step 3: Fix Windows' Internal Boot Configuration (If Manual Boot Worked)
Once you're in Windows:
- Open Command Prompt as Administrator (right-click Start > Command Prompt (Admin)).
- Run these commands one by one to repair the boot records:
Whenbootrec /fixmbr bootrec /fixboot bootrec /rebuildbcdrebuildbcdasks if you want to add the detected Windows installation, typeYand press Enter. - Reboot your laptop—Grub should now have a working Windows entry.
Step 4: Repair Partition Table or Boot Files (If Manual Boot Fails)
If even manual Grub commands don't boot Windows, your partition table or Windows boot files might be corrupted. Try this with the testdisk tool:
- From Ubuntu/MX Linux, install testdisk:
sudo apt install testdisk - Run it with sudo:
sudo testdisk - Follow these prompts:
- Select your new drive (usually
/dev/sda) and press Enter. - Choose
[Intel]as the partition table type (most laptops use this) and press Enter. - Select
[Analyze]>[Quick Search]and wait for it to scan the drive. - When it lists your partitions, make sure
/dev/sda2is marked asPrimaryorLogicalwithNTFSandWindowsin the description. - Select
[Write]to save the corrected partition table, then pressYto confirm.
- Select your new drive (usually
- Reboot and try the earlier steps again.
Why This Happened
When you restored the old partitions to the new drive, Windows' boot configuration (BCD) was still pointing to the old drive's partition UUIDs or sizes. Since the new drive's partitions are larger, this breaks the boot chain—Grub can find the partition, but Windows can't find its own boot files correctly.
备注:内容来源于stack exchange,提问作者The MAJOR

