Bug 423917 - Should check for mounts before Applying operations
Summary: Should check for mounts before Applying operations
Status: REPORTED
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andrius Štikonas
URL:
Keywords:
: 470946 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-06 05:59 UTC by brute4s99
Modified: 2024-06-30 16:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description brute4s99 2020-07-06 05:59:46 UTC
SUMMARY
Is it known that Partition Manager doesn't check for mounts before I hit apply? 

STEPS TO REPRODUCE
1. Ask KPartMgr (KDE Partition Manager) to Delete an NTFS formatted partition (just add the task, don't hit Apply yet)
2. Switch over to Dolphin, Mount the same partition.
3. Close Dolphin without manually unmounting the partition
4. Hit Apply in kpartmgr

OBSERVED RESULT

Error: Partition already Mounted

EXPECTED RESULT

kpartmgr handles it automatically and asks user to unmount the partition before moving ahead with the actions.

SOFTWARE/OS VERSIONS
Windows: NA
macOS: NA
Linux/KDE Plasma: Manjaro (latest)
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
Feel free to ask for more info.
Comment 1 Andrius Štikonas 2020-07-07 00:17:11 UTC
It is known that it doesn't check. Well, actually there is one check before deleting partition but not before other operations:

https://invent.kde.org/system/kpmcore/-/blob/master/src/ops/deleteoperation.cpp#L120

Note that other checks would be more complicated, resizing mounted partitions is often allowed or even required (you can't resize unmounted btrfs, for example if it is unmounted partition manager creates a temporary mount point, resizes and unmounts), so it would be a bit trickier although not impossible to insert similar check for resizing.

It's a bit hard to tell where we should draw the line. Partition Manager assumes that you do not change partitions under its feet after scanning (and GParted behaves exactly the same). And mounting is just one of the many ways you can modify partition.

So I'm not fully convinced about this yet...
Comment 2 Andrius Štikonas 2023-06-12 19:32:29 UTC
*** Bug 470946 has been marked as a duplicate of this bug. ***
Comment 3 Plata 2024-06-30 16:17:29 UTC
Agree that it would be helpful. If it's not possible to unmount automatically, maybe it would be possible to make the problem more obvious and show a button to unmount right in that error message ("Unmount and try again")?
Comment 4 Plata 2024-06-30 16:19:48 UTC
And/or a warning dialog before applying the operation: "A partition is still mounted, do you want to unmount it?".