1 (edited by JohnGa1 2010-05-05 13:04:16)

Topic: [SOLVED] Problem with ntfs XP primary partition

I'm a new user of gparted (0.5.1 via Knoppix 6.2) and want to resize an ntfs partition containing Windows XP. The problem is gparted will not touch the partition until it is repaired but I don't know in what way it is broken because XP works fine and whilst chkdsk reports a problem it refuses to fix it. I don't know if this is related to the problem but recently I accidentally knocked the PC whilst it was booting, and this caused a "boot loop". This is described in what follows (lifted from my query to another forum):

...........This is what happens:

1) switch on PC
2) Hear the fan working (loud)
3) Hear a single click
4) Intel Inside logo is displayed on screen
5) fan slows (goes quiet)
6) DOS screen with "Start Windows Normally" highlighted is diplayed
7) lots of fast clicking noises heard
8) WinXP startup screen displayed
9) Fan speeds up (loud again)
10) screen goes blank and the Intel inside logo is displayed again and steps 4-10 are repeated ad infinitum..........

And this was my solution, which worked as far as XP was concerned (again lifted from the same forum):

..........I downloaded an ISO of a (32 bit) Vista recovery disk from this website: http://neosmart.net/blog/2008/download- … ery-disc/. I burned it onto a CD and then booted the PC from this CD. On booting I was given option to Install or repair Vista. Neither of these were useful as I'm running XP on the machine, so I closed the window. A message then displayed saying the PC would be rebooted. So I let it reboot from the hard drive just to see if it would work. And it did!? It ran chkdsk and found three corruptions and fixed them (two were to do with orphaned files, don't really understand what it's doing). It then rebooted again and now works fine..............

Running the check and repair option of gparted gives the following:

GParted 0.5.1

Libparted 1.8.8.git-dirty

Check and repair file system (ntfs) on /dev/sda1  00:00:24    ( ERROR ) 
     calibrate /dev/sda1  00:00:01    ( SUCCESS ) 
     path: /dev/sda1
start: 63
end: 77834924
size: 77834862 (37.11 GiB) 

check file system on /dev/sda1 for errors and (if possible) fix them  00:00:23    ( ERROR ) 
     ntfsresize -P -i -f -v /dev/sda1 
     ntfsresize v2.0.0 (libntfs 10:0:0)
pread: Input/output error
Failed to calculate number of free clusters: Input/output error.
ERROR(5): Opening '/dev/sda1' as NTFS failed: Input/output error
NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.

On attempting to mount the partition I get the following (I have one hard drive and I am sure I am not running RAID, Belarc Advisor reports this about the hard drive: "ST380011AS [Hard drive] (80.02 GB) -- drive 0, SMART Status: Healthy:")

knoppix@Microknoppix:~$ mkdir cdrive
knoppix@Microknoppix:~$ su root
root@Microknoppix:/home/knoppix# mount -t ntfs /dev/sda1 cdrive
ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Failed to read NTFS $Bitmap: Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.

fdisk gives the following (the other partitions seem OK):

root@Microknoppix:/home/knoppix# fdisk -lu

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xf04df04d
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    77834924    38917431    7  HPFS/NTFS
/dev/sda2        77834925   156296384    39230730    f  W95 Ext'd (LBA)
/dev/sda5        77834988   145420379    33792696    7  HPFS/NTFS
/dev/sda6       145420443   156296384     5437971    b  W95 FAT32

parted gives:

root@Microknoppix:/home/knoppix# parted /dev/sda1 print

Model: Unknown (unknown)
Disk /dev/sda1: 39.9GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number  Start  End     Size    File system  Flags
1      0.00B  39.9GB  39.9GB  ntfs

Running ntfsfix I get:

root@Microknoppix:/home/knoppix#
knoppix@Microknoppix:~$ ntfsfix /dev/sda1
Mounting volume... pread: Input/output error
Failed to calculate number of free clusters: Input/output error.
FAILED
Attempting to correct errors...
Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
pread: Input/output error
Failed to calculate number of free clusters: Input/output error.
Remount failed: Input/output error.

Meanwhile in XP no amount of chkdsk, chkdsk /f, chkdsk /f /r, chkdsk /f /x and double rebooting makes any difference. Chkdsk outputs the following:

C:\Documents and Settings\Daddy>chkdsk
The type of the file system is NTFS.
Volume label is BOOT.

WARNING!  F parameter not specified.
Running CHKDSK in read-only mode.

CHKDSK is verifying files (stage 1 of 3)...
File verification completed.
CHKDSK is verifying indexes (stage 2 of 3)...
Index verification completed.
CHKDSK is verifying security descriptors (stage 3 of 3)...
Security descriptor verification completed.
CHKDSK is verifying Usn Journal...
Usn Journal verification completed.
Correcting errors in the master file table's (MFT) BITMAP attribute.
Correcting errors in the Volume Bitmap.
Windows found problems with the file system.
Run CHKDSK with the /F (fix) option to correct these.

  38917430 KB total disk space.
  24117256 KB in 81611 files.
     32572 KB in 9692 indexes.
         4 KB in bad sectors.
    330698 KB in use by the system.
     65536 KB occupied by the log file.
  14436900 KB available on disk.

      4096 bytes in each allocation unit.
   9729357 total allocation units on disk.
   3609225 allocation units available on disk.

fsutil gives:

C:\Documents and Settings\Daddy>fsutil dirty query c:
Volume - c: is NOT Dirty

Any help or pointers to further investigation are gratefully appreciated, as my (many days) of investigation have more or less run out of steam.

2

Re: [SOLVED] Problem with ntfs XP primary partition

I just downloaded the latest gparted iso (0.5.2-1) and tried that. No difference.

3

Re: [SOLVED] Problem with ntfs XP primary partition

Your best bet is to use tools from Microsoft to repair NTFS file systems.

Since NTFS and Windows are proprietary and since Microsoft does not share this code with the open source community, Microsoft has the best understanding of the NTFS file system structure.  After all Microsoft designed NTFS so they would be best prepared to understand how to fix it.

4

Re: [SOLVED] Problem with ntfs XP primary partition

Thankyou for the pointer. I've managed to resolve the problem as far as I believe is possible. I ended up fixing a bad block on the HDD using the manufacturers disk utility (SeaTools for DOS in this case) and have fixed NTFS to Windows' satisfaction by running chkdsk /f /r from a bootable CD-ROM (BART-PE). gparted now reports corruptions on the HDD and advises backing up data and resizing using ntfsresize which is the option I will take.