1 (edited by ahcomput 2011-12-05 22:45:24)

Topic: [Solved] error: can't have a partition oustide the disk

Attempting to shrink 700gb NTFS volume from Windows 2008 vm and receive the following error in Gparted 0.10

"Can't have a partition outside the disk"

Any help resolving this is appreciated.

2

Re: [Solved] error: can't have a partition oustide the disk

More Information:

root@PartedMagic:~# parted /dev/sda print
Error: Can't have a partition outside the disk!                           
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 749GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
root@PartedMagic:~# fdisk -lu /dev/sda

Disk /dev/sda: 749.0 GB, 748985804800 bytes
256 heads, 63 sectors/track, 90703 cylinders, total 1462862900 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: 0x6c58a108

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *         128  1462863027   731431450    7  HPFS/NTFS/exFAT
root@PartedMagic:~#

3

Re: [Solved] error: can't have a partition oustide the disk

From the output it appears that partition sda1 is larger than the disk drive size.

1,462,862,900 total sectors in disk
1,462,863,027 end sector of sda1 partition  <-- Problem here!

Hence the partition will need to be shrunk to fit within the drive.

If you would like help with this then please provide the Master 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-ahcomput.mbr bs=512 count=1

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

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

4

Re: [Solved] error: can't have a partition oustide the disk

Sorry for the delay and thank you for the help.

I didn't receive email notification that a reply was posted.  Here is the link on media fire

http://www.mediafire.com/download.php?908btwbdtrnua0w

5

Re: [Solved] error: can't have a partition oustide the disk

The change I have made to the file is from a length of 1,462,863,027 sectors:
000001C0   03 00 07 FF  FF FF 80 00  00 00 34 84  31 57 00 00
To a new length of 1,462,862,772 sectors (= 1,462,862,900 - 128):
000001C0   03 00 07 FF  FF FF 80 00  00 00 B4 83  31 57 00 00

To apply this change:

1) Download the new MBR: sda-ahcomput_new.mbr

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

dd if=sda-ah-comput_new.pbr of=/dev/sda bs=512 count=1 

3) Reboot the computer

4) Check that the file system is recognized in GParted

It is possible that the file system size might require adjustment too.

6

Re: [Solved] error: can't have a partition oustide the disk

After applying new MBR, the partition is recognized in Gparted.  Attempting to shrink partition now.  Thanks for the help.

Ben




gedakc wrote:

The change I have made to the file is from a length of 1,462,863,027 sectors:
000001C0   03 00 07 FF  FF FF 80 00  00 00 34 84  31 57 00 00
To a new length of 1,462,862,772 sectors (= 1,462,862,900 - 128):
000001C0   03 00 07 FF  FF FF 80 00  00 00 B4 83  31 57 00 00

To apply this change:

1) Download the new MBR: sda-ahcomput_new.mbr

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

dd if=sda-ah-comput_new.pbr of=/dev/sda bs=512 count=1 

3) Reboot the computer

4) Check that the file system is recognized in GParted

It is possible that the file system size might require adjustment too.

7

Re: [Solved] error: can't have a partition oustide the disk

'Glad to hear the problem is resolved.   smile

Also thanks for editing the initial post and prefixing SOLVED in front of the title.  This helps others searching for answers to problems.

8 (edited by teemer55461 2016-03-11 18:58:55)

Re: [Solved] error: can't have a partition oustide the disk

--deleted

9

Re: [Solved] error: can't have a partition oustide the disk

teemer55461 wrote:

Is there an online tool to convert from one to the other?

The numbers are hexadecimal and in reverse byte order to match the Master Boot Record specificiation which includes the MSDOS partition table.

Forum user greegthegeek wrote a tutorial on how to manually perform the steps.  See Proposition of a tutorial for the NTFS size bug.

Hope that helps.  :-)

10

Re: [Solved] error: can't have a partition oustide the disk

Found the tutorial, but when I run parted from Partition Magic the same error pops up; it refuses to give me a PRINT of the table.

It's a USB drive that windows likes, but it's loosy goosy, apparently!
(I HATE GATES!)

Anyway, is there a version that will run a drive that seems to have been screwed up by a Sync program used for backup, although I'm heavily targeted so anything is possible!


Thx!

Tip a gparted --FixTheFrackingMBR option that does the MBR shrink would be greatly appreciated.

gedakc wrote:

The change I have made to the file is from a length of 1,462,863,027 sectors:
000001C0   03 00 07 FF  FF FF 80 00  00 00 34 84  31 57 00 00
To a new length of 1,462,862,772 sectors (= 1,462,862,900 - 128):
000001C0   03 00 07 FF  FF FF 80 00  00 00 B4 83  31 57 00 00

To apply this change:

1) Download the new MBR: sda-ahcomput_new.mbr

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

dd if=sda-ah-comput_new.pbr of=/dev/sda bs=512 count=1 

3) Reboot the computer

4) Check that the file system is recognized in GParted

It is possible that the file system size might require adjustment too.

11 (edited by teemer55461 2016-03-11 19:29:40)

Re: [Solved] error: can't have a partition oustide the disk

Here's the fdisk
Command (m for help): p

Disk /dev/sdc:
1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track,
121601 cylinders, total 1953525168 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: 0xadf95f51

   
Device     Boot      Start         End                  Blocks           Id          System
/dev/sdc1   *        2048  1953536129   976767041    7  HPFS/NTFS/exFAT


I'd prefer to fix this myself, but this file looks packed and the editor used did not allow me to read it. Sorry if I missed this above!

Are the units of "Start" and "End" the same as "Blocks"?
(If so it's way off!) 

Link to mbr from dd:
https://mega.nz/#!Y8RASJqT!CxYoyKfS12G4 … pUuy6iR4cI

I'm sure this will likely happen again so any tips on which editor, (hex?), to use and how this could be so far off would be greatly appreciated!

Thanks,
T

12

Re: [Solved] error: can't have a partition oustide the disk

Hi teemer55461,

To avoid confusion with the system specific solution in this thread, please create a new thread describing your problem.

13

Re: [Solved] error: can't have a partition oustide the disk

Hi!
Done and thanks again!

http://gparted-forum.surf4.info/viewtop … 927#p33927

gedakc wrote:

Hi teemer55461,

To avoid confusion with the system specific solution in this thread, please create a new thread describing your problem.