Bug 489768 - Resizing a btrfs partition that is nested inside a LUKS container doesn't work
Summary: Resizing a btrfs partition that is nested inside a LUKS container doesn't work
Status: RESOLVED WORKSFORME
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.05.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andrius Štikonas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-05 05:22 UTC by Ellie
Modified: 2024-08-20 03:47 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 Ellie 2024-07-05 05:22:53 UTC
SUMMARY

Resizing a btrfs partition that is nested inside a LUKS container after unlocking the LUKS container will just keep prompting for the LUKS password even though the LUKS container is already unlocked.

STEPS TO REPRODUCE

1. Use "Partition" > "Unlock" on LUKS container with btrfs inside
2. Use "Partition" > "Resize" on btrfs inside
3. Specify new size in dialog
4. Press "Okay"

OBSERVED RESULT

Password prompt shows up. When entering the password it just keeps re-prompting.

EXPECTED RESULT

Partition is resized.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: postmarketOS Edge
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 6.3.0
Qt Version: 6.6.3

ADDITIONAL INFORMATION
Comment 1 Andrius Štikonas 2024-07-07 15:19:59 UTC
Hmm, I can't fully reproduce it. When I press OK in step 4 it asks for LUKS password (perhaps unnecessary but I need to check) once but then it works and resizes properly.
Comment 2 Andrius Štikonas 2024-07-07 15:54:56 UTC
So the passphrase is indeed necessary, cryptsetup resize needs passphrase even when volume is unlocked.

The code that asks for passphrase is in https://invent.kde.org/system/partitionmanager/-/blob/master/src/gui/resizedialog.cpp?ref_type=heads#L90
Which in summary does

                while  (!validPassphrase) {
                    validPassphrase = luksFs->testPassphrase(partition().deviceNode(), passphrase);
                    if(!validPassphrase)
                        errorMessage = i18nc("Part of %2Enter passphrase for %1:", "Invalid passphrase. ");
                }
                luksFs->setPassphrase(passphrase);

Could you please double check that you were indeed entering a valid passphrase.
Comment 3 Ellie 2024-07-21 00:21:21 UTC
I was able to resize it using command line tools without issues. While it's possible I typo'ed the password about 5 times with the UI, but then typed it flawlessly using the command line tools not much later, it doesn't seem likely to me. Since I don't have a partition that needs resizing anymore, I'm unsure how to best do further testing and check what was requested. I guess if really nobody else has ever seen this, I would understand if this was closed as a fluke.
Comment 4 Bug Janitor Service 2024-08-05 03:46:18 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Bug Janitor Service 2024-08-20 03:47:35 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.