Cannot have overlapping partitions

Bug #103794 reported by Sam Liddicott
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
parted (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: parted

parted thinks I have overlapping partitions:

sam@rattle:~$ sudo parted /dev/sda
GNU Parted 1.7.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print all
Error: Cannot have overlapping partitions.

however, take a look, there is no overlap (apart from all the partitions within the extended partition but thats normal)

sam@rattle:~$ sudo cfdisk -Ps /dev/sda
Partition Table for /dev/sda

               First Last
 # Type Sector Sector Offset Length Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
 1 Primary 0 75778604 63 75778605 HPFS/NTFS (07) Boot
 2 Primary 75778605 76951349 0 1172745 Linux (83) None
 3 Primary 76951350 156296384 0 79345035 W95 Ext'd (LBA) (0F) None
 5 Logical 76951350 108197774 126# 31246425 Linux (83) None
 6 Logical 108197775 110157704 63 1959930 Linux swap / So (82) None
 7 Logical 110157705 143364059 63 33206355 Linux (83) None
   Logical 143364060 143364122* 0 63*Free Space None
 4 Primary 143364123* 156296384 0 12932262*W95 FAT32 (0B) None

Whats REALLY scary is that gparted shows the disk as not being partioned at all! I coulda lost all my data.
it should have passed on the error instead of assuming no partition.

Revision history for this message
Sam Liddicott (sam-liddicott) wrote :

I see it.
Partition 4 really ought to be marked as logical, not primary.
I guess it ought to be partition 8
I'm sure I used to had a partition 8, no doubt some clever partition tool moved it to 4.

I don't know what tool I can use to fix this, obviously not parted :-)

But the bug remains that gparted should not pretend there are no partitions.

is someone able to assign this to gparted or do I need to file a new bug?

Revision history for this message
Sam Liddicott (sam-liddicott) wrote :

I think it was sfdisk that busted my partition table.
sfdisk -d output doesn't identify physiclal or logical partitions.

I think it assumkes the first 4 are physical and the remaining are logical.
I think I actually only had 3 physical partitions

Anyway I edited the output of sfdisk -d and shurnk my extended partition to stop at parition 7 thus making partition 4 outside of the extended partition but still physical

anyway... so I have a valid partition table, but perhaps parted could be more helpful about fixing such messes?

Revision history for this message
Jeff Anderson (jander99) wrote :

Sam,

Thanks for the bug report. Since your bug report pertains to parted reporting overlapping partitions, which actually happened (glad you fixed it!), I believe this bug to be invalid. Saying that, if you could remember back to April of 2007 ( :-P ) and what might have originally caused your issue with sfdisk, perhaps this issue can be looked at. Otherwise, I'm going to mark this bug as invalid since you've seemed to correct your issue with parted.

Changed in parted:
status: New → Invalid
Revision history for this message
Sam Liddicott (sam-liddicott) wrote :

This is a bad resolution.

The bug is that gparted pretends I don't have a partition table when in fact I do and it doesn't even warn me.

Its poor enough that gparted won't help me fix the problem (thats its job, right) but unforgivable that it pretends that there's nothing wrong.

I hada similar problem yesterday on a friends computer, installing intrepid on a vista box, luckily *I* know that gparted is a lying wretch, and fixed it with sfdisk - other people may not read this bug report and find out that gparted cannot be trusted until their sad story of gigabytes of lost data gets marked duplicate of this bug and then they'll wonder what's invalid about the bug....

Revision history for this message
Steve Dodd (anarchetic) wrote :

I ended up in a similar situation with a logical partition inexplicably listed as primary instead, which was preventing me testing Wubi. No idea how that happened, the only things that should have touched the partition table on that disk are gparted and WinXP's installer.

Anyway, for anybody stumbling across this bug report, TestDisk did a nice job of fixing the mess, though in the interests of paranoia I'd recommend saving the output of sfdisk (with -d and -d -x) before, and comparing with the results after, just to make sure it looks sane..

http://www.cgsecurity.org/wiki/TestDisk

I'd agree that silently pretending a screwed up ptable is empty is fairly evil. A simple dialog to say "I don't understand what's on this disk, bailing out" would be enough ..

Revision history for this message
racecar56 (racecar56) wrote :

I just got hit by this.

Revision history for this message
Sam Liddicott (sam-liddicott) wrote :

Did you lose any data?

Revision history for this message
teyesahr (emailtonys) wrote :

This happened to me, too. I first noticed it after upgrading, recently, to Ubuntu 10.04 from 9.10. I decided I wanted to go from dual-boot (with WinVista) to single-boot (Ubuntu 10.04 only). I opened GParted, and it showed my disk, /dev/sda, as wholly "Unallocated Space." Same thing when I tried booting from a GParted Live CD and from an Ubuntu 10.10 Live CD.

I have not lost any data, but it is very frustrating. Below is the output of 'sudo fdisk -l /dev/sda':

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd8000000

   Device Boot Start End Blocks Id System
/dev/sda1 * 14267 14594 2620416 c W95 FAT32 (LBA)
/dev/sda2 10 1315 10485760 7 HPFS/NTFS
/dev/sda3 * 1315 6276 39852216+ 7 HPFS/NTFS
/dev/sda4 6277 14594 66807327+ f W95 Ext'd (LBA)
/dev/sda5 14267 14594 2620416 dd Unknown
/dev/sda6 6277 13935 61520886 83 Linux
/dev/sda7 13936 14266 2658726 82 Linux swap / Solaris

Partition table entries are not in disk order

--And here is the output of 'sudo sfdisk -l /dev/sda':

Disk /dev/sda: 14593 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 14266+ 14593- 327- 2620416 c W95 FAT32 (LBA)
  start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sda2 9+ 1314- 1306- 10485760 7 HPFS/NTFS
/dev/sda3 * 1314+ 6275- 4962- 39852216+ 7 HPFS/NTFS
/dev/sda4 6276+ 14593- 8318- 66807327+ f W95 Ext'd (LBA)
/dev/sda5 14266+ 14593- 327- 2620416 dd Unknown
/dev/sda6 6276+ 13934 7659- 61520886 83 Linux
/dev/sda7 13935+ 14265 331- 2658726 82 Linux swap / Solaris

I'm not expert, but that partition table looks a little odd to me. Any help?

Revision history for this message
teyesahr (emailtonys) wrote :

And here's the output of 'sudo parted'

GNU Parted 2.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: Can't have overlapping partitions.
(parted)

Revision history for this message
V字龍(Vdragon) (vdragon) wrote :

I just encountered this problem orz.
Parted should mention much verbosely then giving a message (when the partition don't actually "overlapped" but misassigned ID)

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Have anyone tried to compile parted 3.1 and see if problem affects 3.1 series?

Revision history for this message
Phillip Susi (psusi) wrote :

This has been fixed from gparted's perspective, as it now correctly shows the parted error messages rather than pretending that the disk is empty.

Fixing parted to allow you to ignore the error and proceed with trying to repair it is a feature that still has not been implemented upstream.

Revision history for this message
Steve Dodd (anarchetic) wrote : Re: [Bug 103794] Re: Cannot have overlapping partitions

Fair enough - I think I originally commented here mainly to share my
information on how to fix such mangled partition tables - I don't recall ever
finding out which program caused the problem in the first place!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.