NTFS C:\ partition became corrupt when grub was installed onto /dev/sda1

Bug #12032 reported by Nicholas Furgiuele
This bug report is a duplicate of:  Bug #8322: Parted corrupts the partition table. Edit Remove
6
Affects Status Importance Assigned to Milestone
parted (Ubuntu)
Invalid
Medium
Colin Watson

Bug Description

When installing GRUB to my Windows partition, the partition became corrupt.

On my setup I have 3 hard drives, I have 2 x PATA (120GB and 160GB) and 1 SATA
(120GB).
They list in the following order:
#1 - 160GB PATA
#2 - 120GB PATA
#3 - 120GB SATA <- boot drive, sda

The Partition Layout on the SATA drive is as follows:
[1 - NTFS 100GB Windows XP C:\ *active]
[2 - ext3 94MB /boot]
[EXTENDED]
    [5 - ext3 6.52GB /]
    [7 - swap 1012MB]
    [6 - ext3 /home 4.19GB]
[/EXTENDED]

I installed GRUB to my C:\ partition (sda1) and somehow GRUB corrupted my C:\
partition rather then installing to the boot sector of this partition. All files
in this partition became unreadable by both Windows and Linux.

After my Ubuntu installation I got the following error when the system booted:
"Operating System Missing"

I then took the following actions to resolve:

1) I decided to re-install Ubuntu, during the install process I set sda2 as the
boot partition, and installed GRUB to this partition (sda2).

When the system installed and re-booted, I was greeted with the GRUB menu,
Ubuntu booted with no problems (after I edited it's boot entry due to Bug
#12031
). Unfortunatley when I booted the WIndows XP partition I would get a blank
GRUB prompt, as if I had booted into another blank copy of GRUB which has no
menu.lst file.

2) I decided to boot Ubuntu and did the following:
    a) Ran command "fdisk -l" which gave the following output:

root@ubuntu:/home/nic # fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot Start End Blocks Id System
/dev/sda1 1 13054 104856223+ 7 HPFS/NTFS
/dev/sda2 * 13055 13066 96390 83 Linux
/dev/sda3 13067 14593 12265627+ f W95 Ext'd (LBA)
/dev/sda5 13067 13917 6835626 83 Linux
/dev/sda6 14047 14593 4393746 83 Linux
/dev/sda7 13918 14046 1036161 83 Linux

    b) Tried to mount the partition in Linux (after installing NTFS drivers,
creating fstab entries and testing on other NTFS partitions)

root@ubuntu:/home/nic # mount /mnt/TheMatrix/
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
      or too many mounted file systems

    ^ All my other NTFS drives mounted with no problems using similar fdisk entries

3) I rebooted, and ran Windows XP recovery console. The recovery console was
unable to find any Windows XP installation on any hard disc. Hence I was left
with no choice but to reboot.

4) I used my Bart PE disc (Windows Pre Install Environment) which booted to it's
desktop, and listed my Windows XP partition as "E:\ New Disk". When I brought up
the properties of this volume it listed the partition as a 100GB "RAW" type
partition.

5) A Google search put me onto a tool called "Test Disk 5.5", I downloaded the
Windows NT version and ran using the command prompt of the "Windows XP Pre Inst
Env" disc.

* At first Test Disk was unable to read any files off the sda1 partition.

* I was able to use this tool to recover the partition by:
    a) used it to re-write the partition table
    b) changed the Windows XP partition from a PRIMARY to a LOGICAL
    c) changed the partition from LOGICAL back to a PRIMARY again.

The Test Disk program was able to read the files from my sda1 partition.

6) Rebooted into Bart PE again, it listed my Windows XP drive as a 100GB NTFS
partition, and it was also able to read the files on the partition.
I used the Windows XP "diskpart" tool to set the WIndows XP partition to become
the boot partition again.

7) I ran the Windows XP setup CD again and launched recovery console, it
detected my XP install, so I ran the "FIXBOOT" and the "FIXMBR" commands.

8) Restarted the system and Windows XP booted without any problems.

A note: I used the Windows Pre Inst Environment to do a lot of things here, but
the "Test Disk" program is also available in DOS and Linux flavours as well. I'm
sure this could have also been achieved through a combination of Linux and
Windows XP setup disc.

I realise that there probably wasnt much need to outline the steps I took to
solve the problem, but at the least it might be usefull for anybody else who has
encountered a similar problem, judging from a search there seem to be a lot of
people who have experienced this problem or similar problems.

I put the package down ad the grub-installer, but I'm not 100% sure if it was
GRUB's fault or not. Sorry if it is filed in the wrong place.

http://www.neowin.net/forum/index.php?act=ST&f=12&t=273047: http://www.neowin.net/forum/index.php?act=ST&f=12&t=273047

Revision history for this message
Matt Zimmerman (mdz) wrote :

I think this is a duplicate of bug #8322

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks for your report.

I tend to agree with Matt here: the fact that playing with the partition type
helped to resurrect it suggests that Windows was having trouble reading the
partition table, which would be a consequence of #1566. Nicholas, if you can,
please test with the beta CD at
http://cdimage.ubuntu.com/releases/hoary/array-2/ and let us know if that has
the same problem. If it still breaks Windows, feel free to reopen this bug.

This bug has been marked as a duplicate of bug 8322.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.