1 (edited by webmanoffesto 2014-07-17 15:53:36)

Topic: Unable to Satisfy All Constraints

I'm using a Ubuntu 14 live disk and GParted 0.18.0 to partition my HD. I want dual boot W7 and Ubuntu.
I get the error "Unable to Satisfy All Constraints on the partition".

Following a suggestion I found in one of the forums I tried to resolve this by using System Rescue CD live disk and booting into another partitioning tool. But I only found GParted and I got the same error messages.

http://i1232.photobucket.com/albums/ff365/webmanoffesto/Error%20Partitioning%20for%20Linux/gpartedproblemn01v01.png
----------------
fdisk output

ubuntu@ubuntu:~$ sudo fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 500.1 GB, 500107862016 bytes
256 heads, 63 sectors/track, 60563 cylinders, total 976773168 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: 0x2902cc6d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  4294967295  2147483647+  ee  GPT
-----------------.

ubuntu@ubuntu:~$ sudo sfdisk -d /dev/sda > sda-dj.out

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util sfdisk doesn't support GPT. Use GNU Parted.

2

Re: Unable to Satisfy All Constraints

Thank you for providing the GParted error and the sfdisk output.

Since the sfdisk reports that a GUID Partition Table exists, would you be able to provide the output from the following two commands?

sudo gdisk -l

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

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

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

3 (edited by webmanoffesto 2014-07-17 15:54:14)

Re: Unable to Satisfy All Constraints

gedakc wrote:

would you be able to provide the output from the following two commands?

sudo gdisk -l

----------------

ubuntu@ubuntu:~$ sudo gdisk -l

GPT fdisk (gdisk) version 0.8.8

Problem opening -l for reading! Error is 2.
The specified file does not exist!
---------------------

ubuntu@ubuntu:~$ sudo parted /dev/sda unit s print

Error: Unable to satisfy all constraints on the partition.         
---------------------

ubuntu@ubuntu:~$ sudo parted /dev/sda1 unit s print

Model: Unknown (unknown)
Disk /dev/sda1: 409600s
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End      Size     File system  Flags
 1      0s     409599s  409600s  fat32
ubuntu@ubuntu:~$ sudo parted /dev/sda2 unit s print

Error: /dev/sda2: unrecognised disk label                                 

ubuntu@ubuntu:~$ sudo parted /dev/sda0 unit s print

Error: Could not stat device /dev/sda0 - No such file or directory.

----------------
Why does everything show up in Ubuntu Disks Devices?
http://i1232.photobucket.com/albums/ff365/webmanoffesto/Error%20Partitioning%20for%20Linux/UbuntuDrivesDevicesn01v01.png
-------------------

ubuntu@ubuntu:~$ sudo parted /dev/sda4 unit s print

Model: Unknown (unknown)
Disk /dev/sda4: 586063872s
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End         Size        File system  Flags
 1      0s     586063871s  586063872s  ntfs

4

Re: Unable to Satisfy All Constraints

webmanoffesto wrote:

Why does everything show up in Ubuntu Disks Devices?

Good question.

Regarding the partition commands, these need to be passed the path the device (e.g., /dev/sda), not the partition (e.g., /dev/sda1).

Would you be able to provide the output from the following command?

sudo gdisk -l /path-to-your-device

where /path-to-your-device is something like /dev/sda, and the other option is a lowercase "L" and not the number "1".

5 (edited by webmanoffesto 2014-07-16 22:38:45)

Re: Unable to Satisfy All Constraints

gedakc wrote:

Would you be able to provide the output from the following command?

sudo gdisk -l /path-to-your-device

where /path-to-your-device is something like /dev/sda, and the other option is a lowercase "L" and not the number "1".

ubuntu@ubuntu:~$ sudo gdisk -l /dev/sda

GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Warning! Secondary partition table overlaps the last partition by
33 blocks! You will need to delete this partition or resize it in another utility.

Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 91B5A850-8718-4D8C-AA48-4DA569E5BEAE
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          411647   200.0 MiB   EF00  EFI system partition
   2          411648          673791   128.0 MiB   0C01  Microsoft reserved part
   3          673792       339511295   161.6 GiB   0700  Basic data partition
   4       339511296       925575167   279.5 GiB   0700  Basic data partition
   5       925575168       976773167   24.4 GiB    2700  Basic data partition

It says, "Warning! Secondary partition table overlaps the last partition by
33 blocks! You will need to delete this partition or resize it in another utility." How do I do that?

6 (edited by gedakc 2014-07-17 03:24:04)

Re: Unable to Satisfy All Constraints

The key information here is as follows:

First usable sector is 34, last usable sector is 976773134

Number  Start (sector)    End (sector)  Size       Code  Name
5       925575168       976773167   24.4 GiB    2700  Basic data partition

From this information we can see that partition number 5 extends beyond the end of the physical disk device.  Of course this is an impossible situation.

One approach is to backup your data, use gdisk to delete the 5th partition, use GParted to create the 5th partition, and then restore your data.

Another approach is to backup your data, use gdisk to delete the 5th partitoin, use gdisk to create the 5th partition with starting sector 925575168 and ending sector 976773134.   Ideally you would not need to restore the data since gdisk works on the partition table only.  Having said that, things can go wrong so it is always advisable to have a backup of your data before editing the partition table with any partitioning tool.

The reason the ending sector is not at the end of the device is that GUID Partition Tables store a backup copy at the end of the drive.  It takes 34 sectors for a standard GPT, so at least 34 sectors must also be reserved at the end of the drive.

7 (edited by webmanoffesto 2014-07-17 15:54:46)

Re: Unable to Satisfy All Constraints

This is the recovery partition. Is there anything special I should do, or just follow what you said above?
http://i1232.photobucket.com/albums/ff365/webmanoffesto/Error%20Partitioning%20for%20Linux/RecoveryPartition5v01.png

8 (edited by webmanoffesto 2014-07-17 15:55:09)

Re: Unable to Satisfy All Constraints

Wow, I found a partition image tool right in the Ubuntu live disk I'm using, "Disks". Just click the gears, see arrow.
http://i1232.photobucket.com/albums/ff365/webmanoffesto/Error%20Partitioning%20for%20Linux/283190a6-07cd-4f3b-aa2b-ee8cd2d84189.png

9 (edited by webmanoffesto 2014-07-17 15:55:30)

Re: Unable to Satisfy All Constraints

Error Deleting Partion. "Unable to satisfy all constraints on the partition." I'm using an Ubuntu 14 live disk.
Talk about a "Catch 22". In order to fix the problem in the partition, I need to delete it. I can't delete the partition because there's a problem in it.

http://i1232.photobucket.com/albums/ff365/webmanoffesto/Error%20Partitioning%20for%20Linux/4b6d6f38-2aa6-4eeb-ade8-e273ff846eba.png
------------------.

Then I tried gdisk

Note: this "code window" scrolls.

ubuntu@ubuntu:~$ gdisk /dev/sda5
GPT fdisk (gdisk) version 0.8.8

Problem opening /dev/sda5 for reading! Error is 13.
You must run this program as root or use sudo!
ubuntu@ubuntu:~$ sudo gdisk /dev/sda5
GPT fdisk (gdisk) version 0.8.8

Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!

Caution! After loading partitions, the CRC doesn't check out!
Warning! One or more CRCs don't match. You should repair the disk!

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: damaged

Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT

Your answer: 2

Warning! Secondary partition table overlaps the last partition by
16717361815834723826 blocks!
You will need to delete this partition or resize it in another utility.

So now I've hit a dead end with both "Disks" and GPT. What do you suggest I do?

10

Re: Unable to Satisfy All Constraints

I tried Test Disk too

http://i1232.photobucket.com/albums/ff365/webmanoffesto/Error%20Partitioning%20for%20Linux/TestDiskDiskAnalysisn01v01.png

http://i1232.photobucket.com/albums/ff365/webmanoffesto/Error%20Partitioning%20for%20Linux/TestDiskDiskPartitionCantbeRecoveredn01v02.png

11 (edited by gedakc 2014-07-17 19:05:45)

Re: Unable to Satisfy All Constraints

This certainly is a unique problem -- even gdisk won't let you delete the partition.  sad

If we could learn how this partition situation came about in the first place then that might help us come up with a solution.

Lacking this information, one possibility I can think of is:

A)  Use a hex editor to manually change the ending sector for partition 5 from 976773167 to 976773134.  See GUID Partition Table for a description of how the GPT is stored on disk.

Note that I have written a document entitled How-to Fix Invalid MSDOS Partition Tables, and based on your situation it appears there might be a need for a "How-to Fix Invalid GUID Partition Tables".

EDIT:

I just thought of another option.  Since this current Windows setup is working, you might consider acquiring a second drive and then installing GNU/Linux on the new drive.  That way you would not need to alter the partition layout on your current drive.

12 (edited by webmanoffesto 2014-07-17 20:36:24)

Re: Unable to Satisfy All Constraints

Would I be able to simply reformat the whole HD, or would this problem prevent that too?

I'm running Ubuntu off an external HD. But this is a laptop and I need to run Ubuntu from the internal HD.

13

Re: Unable to Satisfy All Constraints

webmanoffesto wrote:

Would I be able to simply reformat the whole HD, or would this problem prevent that too?

Yes, that certainly is one way to address the problem.  The steps would be:  Backup your data, write a new GPT partition table and create partition layout you desire, install Windows, restore data, install ubuntu.

14

Re: Unable to Satisfy All Constraints

I solved the problem by using an Ubuntu live disk to repartition the whole disk and install Ubuntu.

15

Re: Unable to Satisfy All Constraints

'Glad to hear that you were able to work-around the problem.  smile