1

Topic: [SOLVED] NTFS resize error + copy sector error

Using Sysrescue Live CD 1.3.2 X86 version,
i ran into some problems.

Setup:
3 partitions:
- sda1 ntfs
- sda3 ext3
- sda2 swap

1. In short (ext3 file system)

Move /dev/sda3 to the left and grow it from 70.50 GiB to 266.11 GiB  00:52:02    ( ERROR ) 
move file system to the left  00:47:12    ( ERROR )
         
using internal algorithm
copy 147846195 sectors
finding optimal blocksize    ( ERROR ) 
optimal blocksize is 65536 sectors (32.00 MiB)
copy 147125299 sectors using a blocksize of 65536 sectors  00:46:53    ( ERROR )
         
137229363 of 147125299 copied
Error while reading block at sector 958438004

So a rollback happened and now:

libparted messages    ( INFO )
         
Input/output error during read on /dev/sda

while there has never been an error (ubuntu, 1 check per 30 mounts)

2. The partition table now looks like

root@sysresccd /root % fdisk -luS /dev/sda

Disk /dev/sda: 500.1 GB, 500106780160 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976771055 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa1f8a1f8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   410251904   205125921    7  HPFS/NTFS
/dev/sda2       968333940   976768064     4217062+  82  Linux swap / Solaris
/dev/sda3       820487745   968333939    73923097+  83  Linux

While

root@sysresccd /root % mmls /dev/sda
DOS Partition Table
                   Offset Sector: 0
                                   Units are in 512-byte sectors

                                                                     Slot    Start        End          Length       Description
00:  -----   0000000000   0000000000   0000000001   Primary Table (#0)
01:  -----   0000000001   0000000062   0000000062   Unallocated
02:  00:00   0000000063   0410251904   0410251842   NTFS (0x07)
03:  -----   0410251905   0820487744   0410235840   Unallocated
04:  00:02   0820487745   0968333939   0147846195   Linux (0x83)
05:  00:01   0968333940   0976768064   0008434125   Linux Swap / Solaris x86 (0x82)
06:  -----   0976768065   0976771054   0000002990   Unallocated

3. Now when i start gparted again i get the following warning:

ntfsresize v2.0.0 (libntfs 10.0.0)
Device name : /dev/sda1
NTFS volume version: 3.1
Cluster size: 4096 bytes
Current volume size : 420089688576 bytes (420090 MB)
Current device size : 210048943104 bytes (210049 MB)
Error: Current NTFS Volume size is bigger than the device size!
Corrupt partition table or incorrect device partition?

Unable to read the contents of this file system!
Because of this some operations may be unavailable.

So what can i do?

Also, very disturbing is the fact that Gparted shows the sda1 ntfs-partition as being empty now!

i have not rebooted yet, nor started ubuntu or winXP (which is on the first partition),
still running the live CD

Help is much appreciated

I have included the following files (as i found in another topic):

- MBR

root@sysresccd /root % dd if=/dev/sda of=sda.mbr count=1 bs=512

on
http://www.filefactory.com/file/a2b38cg/n/sda_MBR

-  PBR

dd if=/dev/sda of=/root/sda1.PBR bs=512 skip=16065 count=100

http://www.filefactory.com/file/a1b7e73/n/sda1_PBR

-  GPARTED Details
Download gparted_details.htm from FileFactory.com

Suggestions?

2

Re: [SOLVED] NTFS resize error + copy sector error

Hi gonzales_speedy.  It looks like there are a few different things going on here:

1)  The move of the ext3 file system on sda3 failed when a bad sector was encountered.

2)  The NTFS file system on sda1 is suffering from a condition indicated in the message "Error: Current NTFS Volume size is bigger than the device size!"

The second problem is one I have dealt with frequently in the past week.  The first problem involves uncertain territory due to the bad sector found on the disk.

I will need some time to think about the recovery options in this situation.

EDIT:
Your NTFS Partition Boot Record begins at sector 63 as seen in the partition table.

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-speedy.pbr bs=512 count=1 skip=63

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

3 (edited by gonzales_speedy 2009-11-16 20:36:22)

Re: [SOLVED] NTFS resize error + copy sector error

1)  The move of the ext3 file system on sda3 failed when a bad sector was encountered.

So the previous ntfs partition had a bad sector,
can i check this without harming the system?

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

U need only one blok?
i have putted it here:
Download sda1-speedy.pbr from FileFactory.com

I looked at the sda1-speedy.pbr
with hexedit,

there is some 'dutch' in it
saying:

Schijfleesf
00000190   6F 75 74 00  0D 0A 4E 54  4C 44 52 20  6F 6E 74 62  72 65 65 6B  74 00 0D 0A  4E 54 4C 44  52 20 69 73  20 67 65 63  6F 6D 70 72  out...NTLDR ontbreekt...NTLDR is gecompr
000001B8   69 6D 65 65  72 64 00 0D  0A 44 72 75  6B 20 43 54  52 4C 2B 41  4C 54 2B 44  45 4C 20 6F  6D 20 6F 70  6E 69 65 75  77 20 74 65  imeerd...Druk CTRL+ALT+DEL om opnieuw te
000001E0   20 73 74 61  72 74 65 6E  0D 0A 00 00  00 00 00 00  00 00 00 00  00 00 00 00  83 94 A6 BF  00 00 55 AA                             starten......................U.

meaning:

ReadWriteError.. NTLDR is missing .. NTLDR is compressed..Press C+A+Del to reboot..U.

Thank u already for the quick reply

4

Re: [SOLVED] NTFS resize error + copy sector error

gonzales_speedy wrote:
1)  The move of the ext3 file system on sda3 failed when a bad sector was encountered.

So the previous ntfs partition had a bad sector,
can i check this without harming the system?

The bad sector was discovered at offset 958,438,004.
The previous NTFS partition started at sector 63, and ended at sector 820,487,744.
Hence the bad block was not within the NTFS file system, but instead part of the ext3 file system.

You could try reading some blocks before and after this block (sector) with a command such as the following:

dd if=/dev/sda of=readblocks.bin bs=512 count=10 skip=958438000

Now onto restoring the data...

From the GParted details log I can see that the NTFS partition was shrunk, and then grew back to the original size (due to a bug we are tracking).  Then GParted began moving the data from the ext3 file system on top of the latter part of the NTFS partition.

Fortunately, the data in the NTFS partition should already have been migrated below sector 410,251,905 and hence should still be on the drive.

With the ext3 data, the copy of the data was written to an area larger than the source.  Hence it should not have overwritten the data where the original ext3 partition started at sector 820,487,745.  Hence this data should also still be present, though with at least one bad sector at offset 958,438,004.


First, let's work on restoring the NTFS file system.  In this case we have two options.

1)  Extend the partition to encompass the entire NTFS file system, knowing that part of the file system was overwritten with ext3 data.

2)  Tell the NTFS file system that it is actually shorter than it really is.  This will effectively chop off the section that was overwritten with ext3 data.

Of these two options I think that option 2 is the better way to proceed.  Following are the instructions for restoring the NTFS file system using option 2.

The change I have made to the file is from a length of 820,487,672 sectors:
00000020   00 00 00 00  80 00 80 00  F8 A5 E7 30  00 00 00 00
To a new length of 410,251,841 sectors:
00000020   00 00 00 00  80 00 80 00  41 F2 73 18  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-speedy_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-speedy_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.


Recognition of the ext3 file system may sort itself out after the computer is rebooted.  Of course the bad sector might still be there.


NOTE:  We are tracking a problem with GParted resizing file systems.  See post:
WARNING! Problem Resizing File Systems with GParted
In the meantime we recommend using GParted Live 0.4.6-1.

5

Re: [SOLVED] NTFS resize error + copy sector error

Bad block?

dd sees no bad blocks in this area (also tried with count=1000)

root@sysresccd /root % dd if=/dev/sda of=readblocks.bin bs=512 count=10 skip=958438000
10+0 records in
10+0 records out
5120 bytes (5.1 kB) copied, 0.000191533 s, 26.7 MB/s

i'll reboot now,
tnx for the help

if u need more info for debugging, let me know

6

Re: [SOLVED] NTFS resize error + copy sector error

gonzales_speedy wrote:

Bad block?

As hard drives fail, often the data can be read on one pass but not on another.  With time the failure rate increases until eventually the data cannot be read at all.

7

Re: [SOLVED] NTFS resize error + copy sector error

Did the steps in post #4 fix the problem with NTFS?

8

Re: [SOLVED] NTFS resize error + copy sector error

gedakc wrote:

Did the steps in post #4 fix the problem with NTFS?

Yes, it did, the system is operational again.

Thank u very much for the help,
i'ill have another go with the new version 0.4.8-6
http://sourceforge.net/projects/gparted … ve-stable/

9

Re: [SOLVED] NTFS resize error + copy sector error

Thanks for reporting back.

I will edit the title of the first post and prefix it with "SOLVED".  This can help other users searching this forum to know which posts have been solved and which might not have been fixed.