Bug 417835

Summary: Trying to partition a device that is mounted results in failure without any information regarding the actual reason.
Product: [Applications] partitionmanager Reporter: Vladimir <vladimiroski>
Component: generalAssignee: Andrius Štikonas <andrius>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Vladimir 2020-02-18 16:26:06 UTC
SUMMARY
Trying to partition a device that is mounted results in failure without any information regarding the actual reason.


STEPS TO REPRODUCE
1. Mount disk in Dolphin
2. Delete partition table in partitionmanager, create ext4 partition


OBSERVED RESULT
You will have a not informative error screen, the partition will fail to be created

EXPECTED RESULT
Either: partitionmanager ask the user to unmount first the resource or informs that the operation can't be done because of this.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 19.10
KDE Plasma Version: 5.18.0
KDE Frameworks Version: 5.67.0
Qt Version: 5.12.4
Kernel Version: 5.3.2-050302-generic
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-7400 CPU @ 3.00GHz
Memory: 14.6 GiB of RAM


ADDITIONAL INFORMATION
Comment 1 Andrius Štikonas 2020-02-18 18:44:54 UTC
Create a new partition table button is greyed out for me in partition manager when partition is mounted.

Did you change partition state after you started partition manager? In that case you need to rescan.
Comment 2 Vladimir 2020-02-18 20:18:59 UTC
I didn't, this was an SSD with Windows installed on it (pulled from another PC).

The flow was as follows:

1. Physically install the SSD
2. Open Dolphin, click on the new device, lurk around a little bit.
3. Closed Dolphin (I didn't think about unmounting device)
4. Found out that this partitionmanager software exists, open it up, provide sudo credentials
5. Select /dev/sdb, right click on it:
5.1 New Partition Table -> GPT
5.2 /dev/sdb1 created as ext4
6. Apply changes

First time I did steps 5-6, changes were not applied, closed partitionmanager between attempts, I even did each step + Apply to find out what could be the error.

This is were I found that buried in that popup there was a text that indicated an error creating sdb1+ext4.

Then I tried fdisk and found out that I couldn't do it because it was mounted, I unmounted it via Dolphin, retried with partitionmanager and it worked!
Comment 3 Vladimir 2020-02-18 20:19:55 UTC
Additional info: the disk format was initially NTFS, 4 partitions, usual Windows stuff
Comment 4 Andrius Štikonas 2020-02-18 21:37:38 UTC
I retried your steps, New Partition Table option is disabled as it should be.

Also, see it here in the code:
https://invent.kde.org/kde/kpmcore/blob/master/src/ops/createpartitiontableoperation.cpp#L107

There is a check that disables creation of new partition table if there are mounted children.

Maybe you can try redoing your steps?
Comment 5 Bug Janitor Service 2020-03-04 04:33:11 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2020-03-19 04:33:20 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!