Bug 505138 - Unable to delete unlocked LUKS partition
Summary: Unable to delete unlocked LUKS partition
Status: RESOLVED FIXED
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andrius Štikonas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-02 20:38 UTC by sixty_taro9z
Modified: 2025-06-03 18:15 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sixty_taro9z 2025-06-02 20:38:16 UTC
Weirdly I can't delete a LUKS partition unless it's locked.
Comment 1 Andrius Štikonas 2025-06-02 20:41:12 UTC
That's intentional. Same is with mounted partitions. You need to lock it (or unmount mounted partitions).

Otherwise you'll have various bad effects on your system.
Comment 2 sixty_taro9z 2025-06-02 21:03:57 UTC
(In reply to Andrius Štikonas from comment #1)
> That's intentional. Same is with mounted partitions. You need to lock it (or
> unmount mounted partitions).
> 
> Otherwise you'll have various bad effects on your system.

Got it, thanks. Could this be indicated to the user somehow, e.g. by making the "delete" button lock and then delete, or in a tooltip?
Comment 3 Andrius Štikonas 2025-06-02 21:39:12 UTC
(In reply to closed.limelike.curves from comment #2)
> (In reply to Andrius Štikonas from comment #1)
> > That's intentional. Same is with mounted partitions. You need to lock it (or
> > unmount mounted partitions).
> > 
> > Otherwise you'll have various bad effects on your system.
> 
> Got it, thanks. Could this be indicated to the user somehow, e.g. by making
> the "delete" button lock and then delete, or in a tooltip?

I think we can extend tooltip there but it at it can't be specific to needing locking (at least not easily). But we can add some more general tooltip. Any suggestion on text (hopefully not too long as it is a tooltip)?

"Delete partition (must be not in use)" ?

Or something a bit more detailed?
Comment 4 sixty_taro9z 2025-06-02 21:52:19 UTC
I'd suggest "Cannot delete partition. Please make sure it is locked and unmounted before proceeding".
Comment 5 Andrius Štikonas 2025-06-02 23:18:39 UTC
Git commit adddbf5297466970f6f36dba8211aa1f97d41219 by Andrius Štikonas.
Committed on 02/06/2025 at 23:17.
Pushed by stikonas into branch 'master'.

Add more detailed tooltip to delete partition action.

M  +8    -2    src/gui/mainwindow.cpp

https://invent.kde.org/system/partitionmanager/-/commit/adddbf5297466970f6f36dba8211aa1f97d41219
Comment 6 sixty_taro9z 2025-06-03 16:58:14 UTC
(In reply to Andrius Štikonas from comment #5)
> Git commit adddbf5297466970f6f36dba8211aa1f97d41219 by Andrius Štikonas.
> Committed on 02/06/2025 at 23:17.
> Pushed by stikonas into branch 'master'.
> 
> Add more detailed tooltip to delete partition action.
> 
> M  +8    -2    src/gui/mainwindow.cpp
> 
> https://invent.kde.org/system/partitionmanager/-/commit/
> adddbf5297466970f6f36dba8211aa1f97d41219

Thank you! (One minor thing -- shouldn't it say "unmounted and locked" instead of "unmounted or locked"? In my case the drive was already unmounted, but it wasn't locked, which is what confused me.)
Comment 7 Andrius Štikonas 2025-06-03 18:15:31 UTC
being mounted or locked is kind of mutually exclusive, so "and" and "or" should be equivalent. You can't mount luks formatted file system directly, only inner file system inside luks can be mounted.