1

Topic: error: can't have a partition outside 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



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 a gparted --FixTheF*ckingMBR option that does the MBR shrink/hex swap to actual size would be greatly appreciated by those being targeted by LA MACHINE.

Godsend, actually! Forgive my Francais, but this is frustrating as hell to 'lose' systems regularly, then to find the wonderful Clonzilla tool only to have that disk fragged on  a system not connected to the big bad Internet which 'THEY' rule!

It's like they can 'bite' you on even disconnected systems via a covert 'bluetooth'?!

Anyone else complain of this?
(Even video project files are tweaked!)

2

Re: error: can't have a partition outside the disk

Unfortunately I was unable to download the MBR.  After clicking the link, I was prompted for a decryption key.  Anyways on to resolving the issue.

The problem is that the partition extends beyond the end of the physical drive.

1,953,525,168 sectors on drive
1,953,536,129 end sector (beyond end of drive)

To resolve the issue, see How-to Fix Invalid MSDOS Partition Tables and specifically the section How-to Fix Partition Outside the Disk.

3

Re: error: can't have a partition outside the disk

OMG, sorry! Likely my bad!

If it's chopped the pieces are ALSO separate; if you would be so kind as to do the hex my religion prevents me from magic, let alone a hex! ;D)

https://mega.nz/#!Y8RASJqT!CxYoyKfS12G4 … pUuy6iR4cI


Link: mega.nz/#!Y8RASJqT

DecrypKey: !CxYoyKfS12G4Q7WrtM3SyHgMMGVetet0apUuy6iR4cI

"Unfortunately I was unable to download the MBR.  After clicking the link, I was prompted for a decryption key.  Anyways on to resolving the issue."

4

Re: error: can't have a partition outside the disk

If we follow the above linked tutorial, then there is no need to use hexadecimal values.  :-)

Using the fdisk output above we can calculate the new sdc1 end value and the new sdc1 size:

new sdc1 end = (sdc disk size) - 1
             = 1953525168 - 1
             = 1953525167

New size of sdc1 will be the new end of sdc1 minus the start of sdc1 plus one sector.

new sdc1 size = (new sdc1 end) - (sdc1 start) + 1
              = 1953525167 - 2048 + 1
              = 1953523120

If we reconstruct what the new input to sfdisk should be then we arrive at the following:

# partition table of /dev/sdc
unit: sectors

/dev/sdc1 : start=      2048, size=1953523120, Id= 7, bootable

If you copy the above line 4 lines (including the blank third line) into a file named sdc-fixed.txt, you can write the partition table to drive sdc with the following command:

WARNING:  Be sure that the drive is actually sdc before overwriting the partition table of this device!

sudo sfdisk /dev/sdc < sdc-fixed.txt

Then you can confirm the problem is resolved by running parted on the disk device.

sudo parted /dev/sdb unit s print

'Hope that helps.

Curtis

5

Re: error: can't have a partition outside the disk

Curtis,
Of course that helps!

You rock, thanks a million!

gedakc wrote:

If we follow the above linked tutorial, then there is no need to use hexadecimal values.  :-)

Using the fdisk output above we can calculate the new sdc1 end value and the new sdc1 size:

new sdc1 end = (sdc disk size) - 1
             = 1953525168 - 1
             = 1953525167

New size of sdc1 will be the new end of sdc1 minus the start of sdc1 plus one sector.

new sdc1 size = (new sdc1 end) - (sdc1 start) + 1
              = 1953525167 - 2048 + 1
              = 1953523120

If we reconstruct what the new input to sfdisk should be then we arrive at the following:

# partition table of /dev/sdc
unit: sectors

/dev/sdc1 : start=      2048, size=1953523120, Id= 7, bootable

If you copy the above line 4 lines (including the blank third line) into a file named sdc-fixed.txt, you can write the partition table to drive sdc with the following command:

WARNING:  Be sure that the drive is actually sdc before overwriting the partition table of this device!

sudo sfdisk /dev/sdc < sdc-fixed.txt

Then you can confirm the problem is resolved by running parted on the disk device.

sudo parted /dev/sdb unit s print

'Hope that helps.

Curtis

6

Re: error: can't have a partition outside the disk

'Glad to hear that the issue is resolved.  :-)

To help others searching for answers to similar questions you can edit your initial post to prefix "SOLVED" in front of the title.

7

Re: error: can't have a partition outside the disk

Hey guys,
I have the same error now.. have a huge problem with my windows disk. killed the partitions and now on my way recover them step by step and running into more and more issues. need to convert the disk to GPT next.

gparted now give me the outside the disk error.
so the next would be changing the sector as well by one.
I have a live linux running but am not expert at all in those commands.

can someone guide me through the commands and I'll provide the next screenshot! thanks! sad