1 (edited by Blakeyo 2010-09-02 01:10:03)

Topic: [SOLVED] NTFS size bug/trouble with the tutorial

Ok I am super n00b yikes when it comes to Linux so bare with me. Had previously set up 2 ntfs partitions. Got rid of some space on my C:/(sda1) so I wanted to give some space to my other drive (sda2), it only had about 5 gigs. Sda1 has Win7 and sda2 has XP (it's working fine) Tried sending 40 or so gigs to sda2 and now have the error.



Device Boot      Start         End                 Blocks            Id             System
/dev/sda1   *     1             24655          198041256        7        HPFS/NTFS
/dev/sda2          24656     30401          46154745          7        HPFS/NTFS


           First sector     Last sector     Total sectors
Sda1   64                  396082574     396082512


396082512 - 1=396082511

179BBD4F
reversed
F4 DB B9 17

Assuming thats all right, I'm pretty much stuck. What is the path for the PBR file? Am I creating one or is on already somewhere on my comp?

I'm using Gparted 0.5.2 I'm pretty sure with the live CD so I have to shut down and restart to try anything I read. I feel like Im forgetting alot of info but I know so little I just write all those details down on paper and typed them back in here.

Any help greatly appreciated!

2

Re: [SOLVED] NTFS size bug/trouble with the tutorial

Blakeyo wrote:

What is the path for the PBR file? Am I creating one or is on already somewhere on my comp?

The NTFS Partition Boot Record is stored at the start of the partition for each NTFS file system.

If you need more help then we will need more information.

1)  Which partition shows the "ERROR: Current NTFS volume size is bigger than the device size!" message?

2)  Would you be able to provide the output from the following two commands?

fdisk -l -u

where one of the options is a lower case "L" and not the number one.

parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/sda.

3

Re: [SOLVED] NTFS size bug/trouble with the tutorial

gedakc wrote:

1)  Which partition shows the "ERROR: Current NTFS volume size is bigger than the device size!" message?

Its the bigger partition, sda1. It shrank to make the other one bigger.

gedakc wrote:

2)  Would you be able to provide the output from the following two commands?

fdisk -l -u

where one of the options is a lower case "L" and not the number one.

parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/sda.

After I type those commands, how do I export the text from terminal?

4

Re: [SOLVED] NTFS size bug/trouble with the tutorial

Ok I did both of the commands and just wrote them down, here's what I got. I hope it's all right.

Disk /dev/sda: 250.1 GB 250059350010 bytes
255 heads, 63 sectors/tracks, 30401 cylindars, total 488397168 sectors
Units-sectors of 1*512=512 bytes
Disk Identifier: 0xaa78454f
Device       Boot      Start              End                 Blocks            Id             System
/dev/sda1   *          64                  396082574     198041256     7        HPFS/NTFS
/dev/sda2               396082575     488392064     46154745       7        HPFS/NTFS

Model:ATA WDC WD2500bevs-2 (SCSI)
Disk /Dev/Sda: 488397168s
Sector size (logical/physical): 512b/512b
Partition Table: MSDOS
Number     Start               End                 Size                  Type       File System       Flags
1                63s               396082574s    396082512s    Primary       NTFS                 Boot
2                396082575s  488392064s    9230940s        Primary       NTFS

5

Re: [SOLVED] NTFS size bug/trouble with the tutorial

Next 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-blakeyo.mbr bs=512 count=1

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

where sda1-blakeyo.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, and post the link to these files in this forum post.

Please note that I will be very busy this weekend so I might not get a chance to look at this until Tuesday.

6

Re: [SOLVED] NTFS size bug/trouble with the tutorial

I typed in both commands and it gave an a-ok files copied with the size and how long it took, now I can't find them anywhere after booting back into XP

7

Re: [SOLVED] NTFS size bug/trouble with the tutorial

The GParted Live image and file system run in your computer's RAM memory.  You will need to copy these files to more permanent storage, such as a USB flash drive, in order to upload the files.

See SAVING DETAILS FOR BUG REPORTS for tips on how to mount USB flash drives.

8

Re: [SOLVED] NTFS size bug/trouble with the tutorial

Whew ok Im stuck. I got a usb stick mount, got through all the steps but when I went to copy it keeps saying something along the line of

"cannot stat sda-blakeyo.mbr no such directory exists"

I tried using the instructions to make a directory on the working hard drive partitions as well and it's still the same. When I try to go through the instructions again, it says they already exist?!? I put gparted on my usb stick, made it bootable, tried copying it to the stick or any of the HD partitions and keep getting the same error.

I can pull up the file utility (the one with the blue screen) and the sda-blakeyo.mbr is there but no combination of making/copying temp directories is working. I know obviously I can't save to the CD but since I can boot from usb, is there alternative strings to

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

that I could use to save directly to the stick?:o:o

(sorry I took so long to respond, I had to move across state to college, all settled in now)

9

Re: [SOLVED] NTFS size bug/trouble with the tutorial

If you booted from the USB stick, then the GParted Live image and file system are run in your computers memory.  It is best if you boot from the CD, then when GParted Live is up and running insert your USB stick and mount it.  Then you can make the files using dd and copy these files to the USB stick.

10

Re: [SOLVED] NTFS size bug/trouble with the tutorial

Ok booted in with the Live CD, inserted the USB stick. Typed in

fdisk -l|grep sd

It pulled up my 2 partitions and my usb stick which is /dev/sdc
I then typed in

mkdir /tmp/usb
mount /dev/sdc /tmp/usb/

After that I get an error along the lines of "You must specify a file system type"

The USB stick is FAT32 if that helps.

11

Re: [SOLVED] NTFS size bug/trouble with the tutorial

Blakeyo wrote:

mount /dev/sdc /tmp/usb/

You're almost there.  You need to mount a partition (e.g., /dev/sdc1), not the device (e.g., /dev/sdc).

Hence try:

mount /dev/sdc1 /tmp/usb/

12

Re: [SOLVED] NTFS size bug/trouble with the tutorial

By golly that worked. Here's the links!

Pbr
http://www.mediafire.com/?dtb4bzkmwp8e854

Mbr
http://www.mediafire.com/?pawxpaaicmsw770

13

Re: [SOLVED] NTFS size bug/trouble with the tutorial

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 477,995,888 sectors:
00000020   00 00 00 00  80 00 80 00  70 A3 7D 1C  00 00 00 00
To a new length of 396,082,511 sectors:
00000020   00 00 00 00  80 00 80 00  4F BD 9B 17  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-blakeyo_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-blakeyo_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.

14

Re: [SOLVED] NTFS size bug/trouble with the tutorial

Couldn't figure out how to get the file switched for a second. Ended up booting from the usb stick again with new pbr in the top directory. Went into the file explorer, navigated up the folders until I found the new pbr, highlighted the file and typed in the string

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

Seemed to work, rebooted, Gparted still said it was messed up but the error looked different, said there was 7 errors or something like that.

Rebooted into my windows boot screen, selected Win7. Win7 then said there were errors and that it would scan to fix them. Went through that all ok, said it would reboot and fix errors again if there were any.
Must not of been any because Win7 started up just fine.

Thanks for the help!! I must have increased my Linux knowledge 10 fold doing this tongue

15

Re: [SOLVED] NTFS size bug/trouble with the tutorial

'Glad to  hear that the problem is now resolved, and thank you too for editing the initial post to prefix the title with SOLVED.  smile