1

Topic: NTFS resize problem fixed - drive works, yet 100% 'unallocated'!

Hello,

I first posted my typical NTFS resize problem here :

http://gparted-forum.surf4.info/viewtopic.php?id=13956

and after more research on this site I noticed that it was posted in the wrong forum, and that there was a solution 'tutorial'. So I used that to edit the PBR, and I got the drive back with WinXP intact. I used GParted to make 3 partitions, and except for a few Meg 'unallocated' space before my partitions (the MBR? PBR?), it was OK. I booted to WinXP and it was fine with all 3 partitions. I ran WinXP checkdisk and also a disk checker built into the BIOS and neither reported errors.

But then I couldnt leave well enough alone, I figured that since these 'sizes' were fixed, I should be able to run Partition Magic v8.01 without the initial "Init failed: Error 117" error I found, so I ran PM. It ran and 'fixed' some inconsistencies, and then hung, needing a hard power off to reboot the machine. PM will now hang the machine every time.

OK, so then I wanted to see if GParted still likes my drive. It now says the ENTIRE drive is unallocated, even though there are 3 partitions and WinXP boots fine.

So, I really dont have any more partitioning work to do, but this kinda bugs me that something is 'wrong' with my drive/partitions. I dont know if whatever is messed up now will come back to bite me later, when I have the machine totally configured w/critical data, apps etc.

Should I just leave it alone? Or should I repair whats wrong so GParted can correctly read my drive? Of course I can only do that with help from here.  I will totally abandon PartitionMagic in favor of GParted for this machine.

Thanks for any help...

CNR

2

Re: NTFS resize problem fixed - drive works, yet 100% 'unallocated'!

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.

This will help to determine why GParted cannot read the partition table.

3

Re: NTFS resize problem fixed - drive works, yet 100% 'unallocated'!

OK, heres the output :

root@sysresccd /mnt/usb % fdisk -l -u              

Disk /dev/sda: 160.0 GB, 160041885696 bytes
240 heads, 63 sectors/track, 20673 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x64656469

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   102407759    51202856    7  HPFS/NTFS
/dev/sda2       102398310   312590879   105096285    5  Extended
/dev/sda5       102398373   163840319    30720973+   7  HPFS/NTFS
/dev/sda6       163830933   312590879    74379973+   7  HPFS/NTFS
Note: sector size is 2048 (not 512)

root@sysresccd /mnt/usb % parted /dev/sda unit s print
Error: Can't have a partition outside the disk!  

I'm wondering if the first partition starting at 2048 is the problem?  I saw some 'unallocated space' before partition 1 in either GParted or PartitionMagic at one point. I'm not sure what its there for.

A side note - I mounted a USB drive to capture this output. I used Geany to edit a file on the drive, copy/pasted the data from Terminal. Saved the file. Did 'ls -la' to ensure the file was on the drive. Unplugged the drive, moved to my XP computer. The file was an OLD COPY. It took me 3 times to get the file saved properly! I even copied the file to 3 other files, and only 1 showed up on the drive when plugged into my PC. Any clues on this one??

Thanks,

CNR

4

Re: NTFS resize problem fixed - drive works, yet 100% 'unallocated'!

The first partition starting at sector 2048 is not a problem.  In fact recent versions of Windows place the first partition at sector 2048, whereas previously sector 63 was used.

The output from the parted command explains the problem:  At least one of the partitions extends beyond the size of the disk.  This can be seen based on the fdisk output:

312,581,808 total sectors for entire disk device
312,590,879 end sector of extended partition sda2 (beyond the end of the drive)
312,590,879 end sector of logical partition sda6 (beyond the end of the drive)

It is the fact that partitions sda2 and sda6 extend beyond the end of the disk drive that parted (and hence GParted) cannot work with this partition table.

Since no data can actually physically exist beyond the end of the drive, you can use fdisk to delete and recreate the partitions with the correct size.  Please note that I would advise you to backup your data prior to doing this in case anything goes wrong.


An interesting anomaly is the line from fdisk saying:
Note: sector size is 2048 (not 512)
This is strange because near the top of the fdisk output it says:
Units = sectors of 1 * 512 = 512 bytes

Perhaps this anomaly is caused by the fact that some partitions extend beyond the end if the physical device?

As to why you had problems copying the file, did you remember to umount the drive prior to removing the USB drive?

5

Re: NTFS resize problem fixed - drive works, yet 100% 'unallocated'!

OK, I'm not sure what I should do now. While this drive has no 'data' that needs to be backed up, it does have a company WinXP image that I cannot easily recreate. I dont know what kind of 'backup' will take 25G of OS and apps and make it re-loadable.

Although, since the error is only with sda2 and sda6, does that mean sda1 (WinXP) wont have to be touched? Will FDISK destroy/reformat sda2 and 6? I did put some stuff on D: which I assume is sda5, but I can recreate that easily. (I wonder what happend to sda 3 and 4?)

How do I use FDISK? I get this :

fdisk /dev/sda
The number of cylinders for this disk is set to 20673.
There is nothing wrong with that, but that is larger than 1024.
and could in certain setups cause problems with:
...

Not sure if that is another problem?

And, regarding the USB drive. No, I did not unmount - I just pulled it out. Not sure why it needs some official unmounting. If the file is saved and shows as such in 'ls -la', it should be saved on the drive.

Thanks again.

6

Re: NTFS resize problem fixed - drive works, yet 100% 'unallocated'!

cnrhome wrote:

Although, since the error is only with sda2 and sda6, does that mean sda1 (WinXP) wont have to be touched?

If your WinXP image is completely within sda1 and you do not have any applications installed on any drive other than C: (sda1) then WinXP should be fine.

cnrhome wrote:

Will FDISK destroy/reformat sda2 and 6? I did put some stuff on D: which I assume is sda5, but I can recreate that easily. (I wonder what happend to sda 3 and 4?)

The GNU/Linux fdisk application will alter the partition tables only, it does not reformat the file system.

In an MSDOS partition table, partions 1 - 4 are reserved for primary partitions.  Optionally one of these can be an extended partition which can contain multiple logical partitions starting with partition 5.

cnrhome wrote:

How do I use FDISK? I get this :

fdisk /dev/sda
The number of cylinders for this disk is set to 20673.
There is nothing wrong with that, but that is larger than 1024.
and could in certain setups cause problems with:
...

Not sure if that is another problem?

This error is because your disk is larger than 1024 cylinders.  Many hard drives today will show this same warning.

The simpliest solution might be to backup everything from your sda6 (probably D:) and sda7 (probably E:) drives.
Next use fdisk to delete the sda7, sda6 and finally the sda2 partitions.
Next use gparted to recreate the extended partition (sda2).  Then you can create your sda6 and sda7 partitions.
Next restore your data back onto sda6 and sda7.


cnrhome wrote:

And, regarding the USB drive. No, I did not unmount - I just pulled it out. Not sure why it needs some official unmounting. If the file is saved and shows as such in 'ls -la', it should be saved on the drive.

If you did not unmount the drive, then the buffers for the disk device might not have been flushed.  This is also important to do in Windows too (usually an icon on the task bar will permit you to safely remove the USB drive).