1 (edited by lcp 2011-08-30 01:00:36)

Topic: [SOLVED]ntfs again

I have read all the posts and tried to solve my problem but no luck.
I was reducing the size of an ntfs volume in an extended partition and got error message.
No log , sorry.

Error mounting: mount exited with exit code 12: Failed to read last sector (76499416): Invalid argument


sudo  fdisk -l -u

Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders, total 195371568 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: 0x3b499b03

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    92968154    46484046    7  HPFS/NTFS
/dev/sda2        92968216   195366464    51199124+   f  W95 Ext'd (LBA)
/dev/sda5        92968218   154408959    30720371    7  HPFS/NTFS
/dev/sda6       185133123   195366464     5116671    b  W95 FAT32
/dev/sda7       183302144   185133055      915456   82  Linux swap / Solaris
/dev/sda8       154411008   181469183    13529088   83  Linux
/dev/sda9       181471232   183300095      914432   82  Linux swap / Solaris


sudo parted /dev/sda unit s print
Model: ATA ST9100823A (scsi)
Disk /dev/sda: 195371568s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End         Size        Type      File system     Flags
1      63s         92968154s   92968092s   primary   ntfs            boot
2      92968216s   195366464s  102398249s  extended                  lba
5      92968218s   154408959s  61440742s   logical   ntfs
8      154411008s  181469183s  27058176s   logical   ext4
9      181471232s  183300095s  1828864s    logical   linux-swap(v1)
7      183302144s  185133055s  1830912s    logical
6      185133123s  195366464s  10233342s   logical   fat32

smart monitor gives a warning  on reallocated sectors and current pending sector count.

gparted reports volume size of 39167701504 and device size 31457659904

have run dd if=/dev/sda of=lcp-gl.mbr bs=512 count=1
and posted to http://www.sindie1.plus.com/lcp-gl.mbr


Please help Thank you.

2

Re: [SOLVED]ntfs again

Next we will need copies of the Master Boot Record (you did this above) and the NTFS Partition Boot Record.

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=sda5-lcp.pbr bs=512 count=1 skip=92968218

where sda5-lcp.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.

3

Re: [SOLVED]ntfs again

Thanks gedakc

I have performed
dd if=/dev/sda of=sda5-lcp.pbr bs=512 count=1 skip=92968218

and uploaded to http://www.sindie1.plus.com/sda5-lcp.pbr

is that OK?



gedakc wrote:

Next we will need copies of the Master Boot Record (you did this above) and the NTFS Partition Boot Record.

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=sda5-lcp.pbr bs=512 count=1 skip=92968218

where sda5-lcp.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.

4

Re: [SOLVED]ntfs again

Since you were trying to shrink the 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 76,499,416 sectors:
00000020   00 00 00 00  80 00 80 00  D8 49 8F 04  00 00 00 00
To a new length of 61,440,741 sectors:
00000020   00 00 00 00  80 00 80 00  E5 82 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: sda5-lcp_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=sda5-lcp_new.pbr of=/dev/sda bs=512 count=1 seek=92968218

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.

5

Re: [SOLVED]ntfs again

Fantastic. Worked a treat. Thank you very much.
Can you tell me why when I open the pbr file 00000020 appears as 00000022?

6

Re: [SOLVED]ntfs again

What tool are you using to view the pbr file?

I use "hexdump -C -v <filename>".

7

Re: [SOLVED]ntfs again

I was using ghex but when I changed the view/group data as to words it comes out as you describe it.
Thanks again I think we can say both issues are [SOLVED]

8

Re: [SOLVED]ntfs again

To mark a post as SOLVED, simply edit the initial post and prefix SOLVED in front of the title.  smile