# checking an ntfs partition? [SOLVED]

## thecooptoo

daughters laptop wont boot into winXP  *Quote:*   

> fielsystem type unkown,partition type 0x7
> 
> chainloader +1
> 
> a disk read error occured

 

and I get this

```
abc-304-smc78 windows # ls -la /mnt/windows

ls: cannot access /mnt/windows/RECYCLER: Input/output error

ls: cannot access /mnt/windows/rfstool: Input/output error

ls: cannot access /mnt/windows/sqmdata00.sqm: Input/output error

ls: reading directory /mnt/windows: Input/output error

total 802764

dr-x------ 1 root root 12288 Feb 3 05:37 .

drwxr-xr-x 5 root root 144 Sep 3 2006 ..

dr-x------ 1 root root 0 Apr 29 2004 ALIENWARE

-r-------- 1 root root 0 Mar 8 2004 AUTOEXEC.BAT

-r-------- 2 root root 7578 Mar 8 2004 AlienFactoryStatus.ini

-r-------- 2 root root 781 Mar 8 2004 AlienSetupLauncherStatus.ini

dr-x------ 1 root root 4096 Nov 17 11:41 BlueJ

-r-------- 1 root root 0 Mar 8 2004 CONFIG.SYS

dr-x------ 1 root root 0 Jul 28 2006 Crestron

dr-x------ 1 root root 4096 Jan 5 10:21 Documents and Settings

dr-x------ 1 root root 4096 Dec 24 10:52 Games

-r-------- 1 root root 0 Mar 8 2004 IO.SYS

-r-------- 1 root root 0 Mar 8 2004 MSDOS.SYS

-r-------- 1 root root 47564 Oct 2 2004 NTDETECT.COM

dr-x------ 1 root root 0 Apr 21 2005 NVIDIA

dr-x------ 1 root root 16384 Jan 26 13:30 Program Files

dr-x------ 1 root root 16384 Jan 26 13:30 Program Files

d????????? ? ? ? ? ? RECYCLER

-r-------- 1 root root 1070 Aug 14 2006 amy.txt

-r-------- 1 root root 211 Oct 2 2004 boot.ini

dr-x------ 1 root root 4096 Mar 3 2006 delta

dr-x------ 1 root root 4096 Aug 3 2006 mplayer

-r-------- 1 root root 250032 Oct 2 2004 ntldr

-r-------- 1 root root 805306368 Feb 3 02:36 pagefile.sys

dr-x------ 1 root root 36864 Aug 18 2006 photos

d????????? ? ? ? ? ? rfstool

-????????? ? ? ? ? ? sqmdata00.sqm

abc-304-smc78 windows #

```

trying to delete anything gives me  a read-only file system message in spite of 

```
abc-304-smc78 windows # mount  |grep windows

/dev/hda1 on /mnt/windows type ntfs (rw)
```

the (legit) windows boot CD gets as far as 'checking your hardware' and then hangs . google indicates that its related to the computer being dual boot

ive run badblocks on the hda1 partition

```
abc-304-smc78 simon # badblocks -sv /dev/hda1

Checking blocks 0 to 26306406

Checking for bad blocks (read-only test): done

Pass completed, 0 bad blocks found.
```

.

ive emerged ntfsprogs but there isnt a fsck for ntfs  

Anything else to try before wiping the whole thing and starting again ?

----------

## Simba7

Ugh.. Alienware.. Good luck with support when the warranty expires..

Have you tried Bart's PE to recover the data? It's basically a Minimal Windows XP install on a CD.

----------

## thecooptoo

not mine - sons old machine, currently borrowed by daughter. 

Agree with comments about alienware though . 

recovergin data isnt reallya problem - its getting the thing going in windows thats the issue, withou reformatting and reinstalling everything

----------

## Hu

When you try the access using the Linux NTFS driver, are there any diagnostics printed in the kernel log?  Use dmesg to see kernel messages.  I suspect that the hardware is dying, so reinstalling Windows on it would not help.

If you have the drive space for it, I suggest making a copy of all the data immediately, preferably using /bin/dd (sys-apps/coreutils) or ddrescue (sys-fs/ddrescue).  If you can salvage enough of the drive, you might be able to load the image intact onto a new system, which would avoid needing to format and reinstall all the software.  The ntfsclone tool from sys-fs/ntfsprogs might also be helpful, but I do not know if it will work reliably with a drive that is reporting read errors.

----------

## Simba7

I agree with Hu.. Get the data off the drive ASAP before you lose everything..

I found this out awhile ago with my laptop and the HDD died a week later. I ended up losing a bunch of pictures when my drive died completely.

----------

## thecooptoo

heres whats ion dmesg when i mount the windows partition

```
NTFS driver 2.1.27 [Flags: R/O MODULE].

NTFS volume version 3.1.

NTFS-fs error (device hda1): ntfs_lookup_inode_by_name(): Directory index record with vcn 0x2 is corrupt.  Corrupt inode 0x5.  Run chkdsk.

NTFS-fs error (device hda1): ntfs_lookup(): ntfs_lookup_ino_by_name() failed with error code 5.

NTFS-fs error (device hda1): ntfs_lookup_inode_by_name(): Directory index record with vcn 0x2 is corrupt.  Corrupt inode 0x5.  Run chkdsk.

NTFS-fs error (device hda1): ntfs_lookup(): ntfs_lookup_ino_by_name() failed with error code 5.

NTFS-fs error (device hda1): ntfs_lookup_inode_by_name(): Directory index record with vcn 0x2 is corrupt.  Corrupt inode 0x5.  Run chkdsk.

NTFS-fs error (device hda1): ntfs_lookup(): ntfs_lookup_ino_by_name() failed with error code 5.

NTFS-fs error (device hda1): ntfs_readdir(): Directory index record with vcn 0x2 is corrupt.  Corrupt inode 0x5.  Run chkdsk.

smc simon #       
```

so i need to run chkdsk when i cant get access to the partiition or boot from a recovery CD !

----------

## Simba7

Did you create a Bart's PE Disc and try to look at the drive through it?

----------

## thecooptoo

i can look at the drive from the linux partition , or a number of live CDs. What I cant do is fix the errors.

Gparted scanned the  partition , reported the errors and told  me to run chkdsk from windows

----------

## Simba7

That's NOT what I'm saying..

Build yourself a Bart's PE disk if you can get to a Windows box. http://www.nu2.nu/pebuilder/

From there, you might be able to fix the problem.

Don't try to fix a Windows problem in Linux.. Almost as bad as trying to fix a Linux problem in Windows.

----------

## pappy_mcfae

There is a way you might be able to get to Windoze up and running again, but it will involve wiping GRUB out of your Master Boot Rrecord (MBR). No, it's not as bad as it sounds. Please, read on.

You will need a DOS boot disk, or an old Windows 98 CD, or perhaps Hiren's Boot CD. Boot off said disk, when you get to the DOS command prompt, type in fdisk/mbr. This will reestablish an MBR which will allow Windoze to boot. It shouldn't disturb your Linux install. It didn't the time I had to do it because I a power outage messed up the MBR, and one of the NTFS drives. 

Once you have your NTFS problems fixed, you can use a Minimal Install disk to allow you to chroot to put GRUB back into the MBR.

I need to let you know that this should be fairly easy. However, anytime you mess with the MBR, you invite the possibility of trouble. With that said, from my reading of your problem, you might be headed on your way to a dead hard drive. This is even truer if you have noticed a distinct slow-down in system performance.

In other words, this is a risky, final option sort of solution. I have done it successfully once, but I did so knowing it might have bad consequences. But, if the drive is going bad, you're losing data...and may have totally lost some already. Now would be the time to get it back running so you can save the undamaged data.

Good luck.

Blessed be!

Pappy

----------

## MostAwesomeDude

The program ntfsfix from ntfsprogs can be used to mark an NTFS partition as dirty, but the only way to repair it is with chkdsk, which is a Windows utility.

----------

## thecooptoo

came back to this after a bit - PEbuiler didnt work - same problem as with rescue disk - it says its inspecting hardware and then just sits there.

Win 98 Disk next

----------

