Friday 15 March 2013

Fixing a faulty NTFS Windows Partition

The customer has a dual boot system with a broken NTFS filesystem on her windows partition. The other partition was loaded with Ubuntu on the same disc and it worked perfectly.

Because Ubuntu worked fine I suspected that the problem may only be with the NTFS partition and not any disc hardware issue.
The procedure is to fix this problem is as follows:
  • Boot Linux on the system (Bit Defender Rescue CD)
  • Make sure you have the ntfsprogs loaded
sudo apt-get install ntfs-3g
sudo apt-get install ntfsprogs

  • Check to see which disc device is the NTFS windows partition
% sfdisk -l /dev/hdc
Disk /dev/hdc: 16 heads, 63 sectors, 2045 cylinders
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from
0
   Device Boot Start     End   #cyls   #blocks   Id  System
/dev/hdc1          0+    406     407-   205096+  83  Linux native
/dev/hdc2        407     813     407    205128   83  Linux native
/dev/hdc3        814    2044    1231    620424   83  Linux native
/dev/hdc4          0       -       0         0    0  Empty
%
  • Make sure the disk is unmounted
sudo umount /dev/<device name>
  • Fix he NTFS partition using ntfsfix
eg:
sudo ntfsfix /dev/<device name>

  • Reboot the system now and boot the Windows partition. The NTFS filesystem will perform its own checks on booting and (hopefully) your problems are gone!
The ntfsprogs Linux man page states that ntfsprogs is a suite of tools for doing neat things with NTFS

mkntfsCreate an NTFS filesystem.
ntfscatDump a file's content to the standard output.
ntfscloneEfficiently clone, backup, restore or rescue NTFS.
ntfsclusterLocate the files which use the given sectors or clusters.
ntfscmpCompare two NTFS filesystems and tell the differences.
ntfscpCopy a file to an NTFS volume.
ntfsfixCheck and fix some common errors, clear the LogFile and make Windows perform a thorough check next time it boots.
ntfsinfoShow information about NTFS or one of the files or directories within it.
ntfslabelShow, or set, an NTFS filesystem's volume label.
ntfslsList information about files in a directory residing on an NTFS.
ntfsresizeResize NTFS without losing data.
ntfsundeleteRecover deleted files from NTFS.

No comments:

Post a Comment