1

Topic: NTFS partition problem after resizing

Hello
I know there is several posts very similar to this one but i just dont feel confident enough to implement solutions in other posts to my particular problems (im just afraid i will mess it up  even more)
So i have winXPpro computer with one drive 160gb and 2 partitions, i run out of space on C (was 30gb) and wanted to resize it so i used partition magic 8.0, everything went fine but after restart system wont boot up, i tried few solutions but there was no way for me to fix it. So i connected this hdd to my other computer with win7, now system takes forever to boot (~30min) and corrupted hdd is not visible in the windows7, so looking for solutions i come across parted magic bootable cd/all the tool and this forum. I have to say i love this project and im very impressed with the whole package im using right now, still i couldnt fix my problem on my own, so here i have some details:
When checking with gparted i got this:

"GParted 0.7.0

Libparted 2.3

Check and repair file system (ntfs) on /dev/sdb1  00:00:00    ( ERROR )
       
calibrate /dev/sdb1  00:00:00    ( SUCCESS )
       
path: /dev/sdb1
start: 63
end: 61432559
size: 61432497 (29.29 GiB)
check file system on /dev/sdb1 for errors and (if possible) fix them  00:00:00    ( ERROR )
       
ntfsresize -P -i -f -v /dev/sdb1
       
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sdb1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 104855835136 bytes (104856 MB)
Current device size: 31453438464 bytes (31454 MB)
ERROR: Current NTFS volume size is bigger than the device size!
Corrupt partition table or incorrect device partitioning?"

So i kind of see where is the problem still no idea how to fix it
2nd partition on this drive shows as unallocated

results from the fdisk -l -u  (i removed info for 3 other disks just to make it clearer):

"fdisk -l -u


Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x092e092e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63    61432559    30716248+   7  HPFS/NTFS
/dev/sdb2        61432560   312560639   125564040    f  W95 Ext'd (LBA)


parted s print command:

"parted /dev/sdb unit s print
Model: ATA WDC WD1600JD-55H (scsi)
Disk /dev/sdb: 312581808s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start      End         Size        Type      File system  Flags
1      63s        61432559s   61432497s   primary   ntfs         boot
2      61432560s  312560639s  251128080s  extended               lba"

I would greatly appreciated any help with this problem and of course i would like to get my data from the hdd.
Thanks

2

Re: NTFS partition problem after resizing

Based on the information you have provided, only the first partition (sda1) is seen as having a recognizable file system.  The second partition (sda2) is marked as an extended partition.  Extended partitions can contain logical partitions.  The logical partitions are the partitions that would contain the actual file system.  Unfortunately no logical partitions are shown in your partition table output.

There are at least two ways that your situation can be approached.

Did you have data on your second partition that you would like to try to recover?

If yes, then you might want to try running the testdisk program from a terminal window.  The testdisk program will search your disk drive for any recognizable file systems and then suggest a new partition table, which you can instruct to overwrite your existing partition table.

If no (you do not have any data on the second partition worth recovering), then let me know and we can proceed to fix the problem on the first partition table.

3

Re: NTFS partition problem after resizing

Thanks a lot for advice
I would like to try to recover data from both partitions
I will try to run testdisk overnight (i tried that once but after 2 hours of no results i stop the process).

4

Re: NTFS partition problem after resizing

Since testdisk must scan every sector on the disk drive it does take quite a long time to complete, especially on large disk drives.

5

Re: NTFS partition problem after resizing

9 hours later testdisk is still running (using 50% of my processor)  but i have to stop it again (im leaving for work).
Should i try to run it longer than that? or maybe we can try another method to get the drive back?, i was thinking about doing whatever have to be done and then recovering pictures with photorec (pictures are mainly files i would like to recover from this hdd)
Thanks

gedakc wrote:

Since testdisk must scan every sector on the disk drive it does take quite a long time to complete, especially on large disk drives.

6

Re: NTFS partition problem after resizing

cciszew wrote:

9 hours later testdisk is still running (using 50% of my processor)  but i have to stop it again (im leaving for work).
Should i try to run it longer than that? or maybe we can try another method to get the drive back?, i was thinking about doing whatever have to be done and then recovering pictures with photorec (pictures are mainly files i would like to recover from this hdd)

Photorec will also need to scan the whole disk to find all recoverable files.  I think your best bett is to use testdisk to try to recover the partition table.  If that does not work, then try photorec since this will likely take you more time to sort out the various files recovered.

7

Re: NTFS partition problem after resizing

Ok i will try again for longer time but will have to use another computer (thats slower) so who knows maybe a week later i will report my progress smile

gedakc wrote:
cciszew wrote:

9 hours later testdisk is still running (using 50% of my processor)  but i have to stop it again (im leaving for work).
Should i try to run it longer than that? or maybe we can try another method to get the drive back?, i was thinking about doing whatever have to be done and then recovering pictures with photorec (pictures are mainly files i would like to recover from this hdd)

Photorec will also need to scan the whole disk to find all recoverable files.  I think your best bett is to use testdisk to try to recover the partition table.  If that does not work, then try photorec since this will likely take you more time to sort out the various files recovered.

8

Re: NTFS partition problem after resizing

Ok testdisk is running for 48 hours already, i will give it one more night but i would like to try something different tomorrow, i will appreciated new suggestions.
Thanks

9

Re: NTFS partition problem after resizing

That is a long time for a 160 GB disk drive, unless the drive is attached by a USB cable, which I doubt is your situation.

We can manually repair the first partition.  With the second partition you might try using photorec to see if it can recover any files.

To fix the problem with the first partition we will need copies of the Master Boot Record and the NTFS Partition Boot Record.

You can capture the Master Boot Record in a file with the following command:

NOTE:  Be extra careful to type this command in properly, otherwise loss of data could result.

dd if=/dev/sda of=sda-cciszew.mbr bs=512 count=1

where sda-cciszew.mbr is the name of the file that will need to be uploaded.


You can capture the NTFS Partition Boot Record in a file with the following command:

NOTE:  Be extra careful to type this command in properly, otherwise loss of data could result.

dd if=/dev/sda of=sda1-cciszew.pbr bs=512 count=1 skip=63

where sda1-cciszew.pbr is the name of the file that will need to be uploaded.


Then upload these files to a media sharing site, such as mediafire or filefactory, and post the link to these files in this forum post.

10

Re: NTFS partition problem after resizing

Ok I got both files up:

http://www.mediafire.com/file/d814omblu … ciszew.mbr

http://www.mediafire.com/file/ll7og5yg7 … ciszew.pbr

This drive is in original computer now (only one hdd there), if fixing it will work im planing on moving it again to 2nd computer with multiple hdd and copy data/run photorec there.
PS drive is on sata cable.
Thanks a lot for help with this
 

gedakc wrote:

That is a long time for a 160 GB disk drive, unless the drive is attached by a USB cable, which I doubt is your situation.

We can manually repair the first partition.  With the second partition you might try using photorec to see if it can recover any files.

To fix the problem with the first partition we will need copies of the Master Boot Record and the NTFS Partition Boot Record.

You can capture the Master Boot Record in a file with the following command:

NOTE:  Be extra careful to type this command in properly, otherwise loss of data could result.

dd if=/dev/sda of=sda-cciszew.mbr bs=512 count=1

where sda-cciszew.mbr is the name of the file that will need to be uploaded.


You can capture the NTFS Partition Boot Record in a file with the following command:

NOTE:  Be extra careful to type this command in properly, otherwise loss of data could result.

dd if=/dev/sda of=sda1-cciszew.pbr bs=512 count=1 skip=63

where sda1-cciszew.pbr is the name of the file that will need to be uploaded.


Then upload these files to a media sharing site, such as mediafire or filefactory, and post the link to these files in this forum post.

11

Re: NTFS partition problem after resizing

To fix the first partition we will decrease the NTFS volume size to fit within the partition.

The change I have made to the file is from a length of 204,796,556 sectors:
00000020   00 00 00 00  80 00 80 00  8C F2 34 0C  00 00 00 00
To a new length of 61,432,496 sectors:
00000020   00 00 00 00  80 00 80 00  B0 62 A9 03  00 00 00 00

Note:  The NTFS volume size is always 1 sector less than the total number of sectors in the partition table entry because the NTFS backup sector is not considered part of the NTFS volume.

To apply this change:

1) Download the new NTFS PBR: sda1-cciszew_new.pbr

2) Load the new NTFS PBR on your hard disk.
NOTE:  Be extra careful when entering the commands.  Data loss could result otherwise.

dd if=sda1-cciszew_new.pbr of=/dev/sda bs=512 count=1 seek=63

3) Reboot the computer

4) Check that the file system is recognized in GParted

5) If all seems fine then I would advise booting into Windows and running "chkdsk /f /r" multiple times, until there are no more faults.

12

Re: NTFS partition problem after resizing

It worked partially. I can get to first partition under pmagic and i was able to copy data this way but im not able to get to the windows on this disk (trying to load for 20-30min then restarts) and when logged to win7 with this hdd in the computer (take like 40min to get win7 running when this disk is connected) i can see one partition but its inaccessible and cant repair with chhdsk. I tried to boot from win cd and repair but setup doesnt find win system to repair on this disk. Should i reinstall win xp on this drive? Regarding 2nd partition on this disk it shows as extended/ unallocated and i can not format it but can resize. What would be the best way to deal with this one if want to run photorec after that?
When analyse first partition with gparted i got this info:
check file system on /dev/sdb1 for errors and (if possible) fix them  00:00:05    ( ERROR )
       
ntfsresize -P -i -f -v /dev/sdb1
       
ntfsresize v2.0.0 (libntfs 10:0:0)
Device name : /dev/sdb1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 31453438464 bytes (31454 MB)
Current device size: 31453438464 bytes (31454 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
Accounting clusters ...
Cluster accounting failed at 7679062 (0x752c56): missing cluster in $Bitmap
Cluster accounting failed at 7679063 (0x752c57): missing cluster in $Bitmap
Filesystem check failed! Totally 2 cluster accounting mismatches.
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.

13

Re: NTFS partition problem after resizing

To fix problems with the first partition you will need to run Windows "chkdsk /f /r" on the partition (drive letter).

I believe that photorec does not require a partition table to try to recover lost files.

14

Re: NTFS partition problem after resizing

Well im not able to do it, windows doesnt see this disk

gedakc wrote:

To fix problems with the first partition you will need to run Windows "chkdsk /f /r" on the partition (drive letter).

I believe that photorec does not require a partition table to try to recover lost files.

15

Re: NTFS partition problem after resizing

cciszew wrote:

Well im not able to do it, windows doesn't see this disk

Thanks not good news.  Windows is needed to fix any inconsistencies in the NTFS file system.