0

On my Windows 7 PC I booted Browser Linux from USB, ran GParted to create a new partition in order to install Linux. GRUB is also installed and offers:

  1. Windows 7 /dev/sda1
  2. Browser Linux /dev/sda2

Linux boots but Win7 won't.

The boot selection failed because a required device is inacessible (0xc0000225)

Everything I've read suggests using the Win7 CD to repair -> not an option currently. Surely there is a way from inside Linux to fix the partition table. Since this is Browser Linux (Puppy Linux - not Ubuntu) I have no apt-get and precious few tools installed.

Running ntfsfix /dev/sda2 did nothing to help.

Here is the fdisk output indicate something that is wrong - apparently "does not end on a cylinder" is moot:

#fdisk -l
Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       14539   116779288+   7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2           14540       15566     8249377+  83  Linux

How can I fix it so Win7 boots again? I am wary about reconstructing the table by hand.

2
  • 1
    Why is using the Windows 7 CD not an option? The boot partition is messed up for Windows. Probably you have confused it by resizing the partition, I'm not sure it supports that I think its quite sensitive to those sorts of changes. Can you confirm you are using the Windows boot loader? Feb 24, 2013 at 9:04
  • Gparted messed it up and I have a running Linux, I would like to fix it from Linux if possible. The alternative of downloading and burnning a windows recovery disk seems an unnecessarily difficult option esp since I don't know how to do that. My boot loader is GRUB as far as I can tell.
    – Marc
    Feb 24, 2013 at 9:17

3 Answers 3

0

You need to use dd to take a snapshot of the MBR after partition editing but before installing GRUB to the MBR:

dd if=/dev/sda bs=512 count=1 of=/boot/win7.mbr

Then make a Grub menu item for Windows 7 that will load this as a boot sector image. Windows 7 contains some code in the Win7 MBR that Win7 looks for the results of, and that may be the source of your trouble.

Edit: I also noticed that you have your Linux installation listed as /dev/sda2 which seems incorrect for a Windows 7 installation. Windows 7 sets up a boot partition /dev/sda1 and a system partition /dev/sda2 by default. You need to set up Linux as /dev/sda3 to avoid re-ordering the partition table and causing Windows 7 to freak out when it looks for itself on partition 2 and it's not there. Additionally, you seem to be using fdisk in cylinder-head-sector compatibility mode and that's a big no-no for Vista/7. Use the u command in fdisk to switch to sector units instead of cylinder units.

When you use ntfsresize to shrink partition 2, you need to make sure that the replacement partition table entry starts on the exact same sector of the drive or Windows won't boot.

0

Try Using dd to create a windows recovery disc (pendrive).

Boot into the recovery disc. select 'Repair My Pc'. then Auto Startup Repair.

If it fails, open command prompt, and type in:

bootrec /fixmbr

bootrec /fixboot

bootrec/rebuildbcd

-1

Solved using a Windows 7 recovery disk. Trying to make a Windows 7 boot disk from Linux proved impossible for mere mortals.

3
  • I think you will find its easier and safer to have Windows be the boot loader, that is how I have set it up in the past. Windows seems to like this way better. Feb 25, 2013 at 10:40
  • 1
    WinUSB might help in future.
    – Karan
    Feb 25, 2013 at 16:05
  • Which is what was suggested in the first place. May 26, 2023 at 8:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .