Bug 12019 - diskdrake creates overlapping partitions in certain cases
Summary: diskdrake creates overlapping partitions in certain cases
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal minor
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords: Triaged
Depends on:
Blocks:
 
Reported: 2013-12-16 22:48 CET by Dick Gevers
Modified: 2014-10-24 17:27 CEST (History)
1 user (show)

See Also:
Source RPM: drakxtools-curses-16.15-1.mga4
CVE:
Status comment:


Attachments
/var/log/explanations for the related period (57.23 KB, text/plain)
2013-12-16 22:52 CET, Dick Gevers
Details

Description Dick Gevers 2013-12-16 22:48:27 CET
Description of problem:

Trying to solve the problem per https://bugs.mageia.org/show_bug.cgi?id=11966
I remapped my HD in machine described as entry #3 at:
https://wiki.mageia.org/en/QA_iso_hardware_list#Notebooks

sfdisk -luS 2>&1 show this result now:

sfdisk: Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.

Disk /dev/sda: 60801 cylinders, 255 heads, 63 sectors/track
Units: sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sda1   *        63    321299     321237  83  Linux
/dev/sda2        321489 678135779  677814291   5  Extended
/dev/sda3     678135808 678453247     317440  83  Linux
/dev/sda4     678453248 934453247  256000000  83  Linux
/dev/sda5        321536  51470335   51148800  83  Linux
/dev/sda6      51472323 665862119  614389797  83  Linux
/dev/sda7     665862183 678135779   12273597  82  Linux swap / Solaris

How it got the error I could not say. It must have happened when I bought the machine stg like 2 years ago and installed mdv/mga

This weekend I renumbered and added partitions with diskdrake. Above is no problem.

But as soon as I add one more partition of any type, diskdrake adds it without warning. However a warning appears subsequently when diskdrake is started after, or a kernel attempted to install, reading:
Error: Can't have overlapping partitions.
Error: Can't have overlapping partitions.
Error: Can't have overlapping partitions.
Error: Can't have overlapping partitions.
Error: Can't have overlapping partitions.
Error: Can't have overlapping partitions.
Error: Can't have overlapping partitions.
Error: Can't have overlapping partitions.

At the same, if gparted is tried at this point, it does not recognize any partition and sees the whole disk as "unallocated".

When such last created partition is deleted, the errors for '...overlapping..." go away and gparted is able to work with the drive.

I am going to attach my /var/log/explanations for the period concerned.




Reproducible: 

Steps to Reproduce:
Comment 1 Dick Gevers 2013-12-16 22:52:30 CET
Created attachment 4631 [details]
/var/log/explanations for the related period
Dick Gevers 2013-12-16 22:53:04 CET

Component: Installer => RPM Packages

Comment 2 Dave Hodgins 2013-12-16 23:18:14 CET
It's sda5 and sda6 that are overlapping. I don't see anything in the explanations,
to indicate either of those partitions were altered during that time.

When were those partitions created, and with what tool?

CC: (none) => davidwhodgins

Comment 3 Dave Hodgins 2013-12-16 23:33:59 CET
From the explanations ...
Dec 14 17:12:21 dvglt drakdisk[13898]: running: blkid -o udev -p /dev/sda10
Dec 14 17:13:31 dvglt drakdisk[13898]: running: resize2fs -pf /dev/sda1 88326
The above shows that the last extended partition is sda10, and sda1 has just been resized.

Dec 14 17:45:02 dvglt drakdisk[4817]: running: blkid -o udev -p /dev/sda10
Dec 14 17:45:45 dvglt drakdisk[4817]: running: resize2fs -pf /dev/sda1 112423
And resized again.

Dec 15 11:52:35 dvglt drakdisk[6019]: running: blkid -o udev -p /dev/sda9
Dec 15 11:55:04 dvglt drakdisk[6019]: running: mkfs.btrfs -f /dev/sda9
Looks like sda10 has been deleted, and sda9 formatted.

Dec 15 19:11:57 dvglt drakdisk[4636]: running: tune2fs -c0 -i0 /dev/sda8
Dec 15 19:11:57 dvglt drakdisk[4636]: running: blkid -o udev -p /dev/sda8
Looks like sda9 has been deleted. I'm not sure what triggers the tune2fs command.

Nothing here appears to show any changes being made to sda5, or sda6, the two
partitions that are overlapping.
Comment 4 Dave Hodgins 2013-12-16 23:50:26 CET
Sorry, ignore comments 2 and 3. I misread the numbers.

The problem, looks to be, the that it's trying to create a partition, when it
cannot possibly do so.

My guess, is that the drive was copied from a smaller drive. It's not clear
from the above, but I'm assuming there is some free space at the end of the
drive.

The problem appears to me to be that during the original install, sda1, was
created as a primary partition. sda2 was created as an extended partition,
likely taking all space after sda1, to the end of the drive.

sda5 through sda7 fill sda2. That is followed by sda3 and sda4.

Now, when a new partition is trying to be added, it is not possible. That's
because the primary partition table already has 4 partitions, and the
extended partition (sda2) must be one contigous space, and it's full.

The easiest way to fix this would be to move sda4, to the end of the drive,
and then move sda3, to be just before sda4. Then sda2 could be increased
in size, to make that space available for more partitions within the
extended partition.

I agree that the message is misleading, as to the cause of the problem.

The correct error message would be "Cannot create partition. And extended
partition must be contiguous, and the primary partition table is full."
Comment 5 Dick Gevers 2013-12-17 00:23:32 CET
Thanks for your comments David. No drive was ever copied. But partitions were added once upon a time as they were needed, by resizing existing partitions downward and creating new.

And yes there is now (and was when https://bugs.mageia.org/show_bug.cgi?id=11966 happened) free space at the end of the HD. Either I use the remaining space for /mnt/beta (~20 GB) or use the one before the end (~120 GB) as "/" in M4B2.

So thanks for the idea to fix the partition table. Bug remains though, that diskdrake should handle it better.
Comment 6 Dave Hodgins 2013-12-17 00:40:36 CET
If I understand correctly, what's happening, is that when diskdrake recognizes
that it must use a partition in the extended partition (since the primary is
full), it checks to see if it can resize the extended partition (sda2, in this
case) to extend it to include the new area. It can't do that, as that would make
sda2 overlap sda3, and sda4, hence the error messages.

Technically, diskdrake is handling this correctly, in my opinion. It would not
be good for it to try to automatically fix the problem, especially, since sda3
and/or sda4 may currently be mounted.

While a clearer error message would be good, I'm changing the severity to minor,
as diskdrake is taking the correct action, currently.

Severity: normal => minor

Manuel Hiebel 2013-12-22 20:13:34 CET

Keywords: (none) => Triaged
Assignee: bugsquad => thierry.vignaud

Comment 7 Dick Gevers 2014-10-24 17:27:41 CEST
If it should be fixed somehow, it cannot be verified, because the machine is broken. Closing as old.

If anyone has an interest to think differently please reopen and consider yourself as reporter of the bug.

Status: NEW => RESOLVED
Resolution: (none) => OLD


Note You need to log in before you can comment on or make changes to this bug.