Score:1

Error trying to shrink a LUKS container with KDE Partition Manager

ro flag

In order to make space for an additional unencrypted FAT32 partition on my SSD, I am trying to shrink an existing LUKS Container.

To this end booted on a LUBUNTU Live USB 22.04.1, launched KDE Partition Manager, unlocked the LUKS Container, successfully downsized the logical volumes inside and in a final step tried to apply a resize/shrink to the container.

this produced the following error:

Date:   8 Oct 2022 17:14:46 Program version:    21.12.3 Backend:    pmsfdiskbackendplugin (1) KDE Frameworks version:   5.91.0 Machine:     Linux lubuntu 5.15.0-43-generic #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022 x86_64

Shrink partition ‘/dev/nvme0n1p3’ from 951.70 GiB to 935.72 GiB Job: Check file system on partition ‘/dev/nvme0n1p3’ Command: lvm pvck
--verbose /dev/mapper/luks-24ed092b-c069-4d2c-8b25-bfb3f08840ee Check file system on partition ‘/dev/nvme0n1p3’: Success Job: Resize file system on partition ‘/dev/nvme0n1p3’ to 1,962,346,496 sectors

Resizing file system from 1,995,857,920 to 1,962,346,496 sectors.


Command: lvm pvmove --alloc anywhere /dev/mapper/luks-24ed092b-c069-4d2c-8b25-bfb3f08840ee:239544-243629 /dev/mapper/luks-24ed092b-c069-4d2c-8b25-bfb3f08840ee:0-239543 Command: lvm pvresize --yes --setphysicalvolumesize -17157849088B /dev/mapper/luks-24ed092b-c069-4d2c-8b25-bfb3f08840ee

Resizing encrypted file system on partition ‘/dev/nvme0n1p3’ failed.


Resize file system on partition ‘/dev/nvme0n1p3’ to 1,962,346,496 sectors: Error

Resize/move failed: Could not resize file system to shrink partition ‘/dev/nvme0n1p3’.

any suggestion or idea is welcome - need help on this !

Grief avatar
tr flag
Looks like a bug in partitionmanager. You can try to shrink to some size slightly large than minimum and it should succeed. Looks like partitionmanager calculates the sizes of volumes inside luks container incorrectly
guiverc avatar
cn flag
I've found *rare* cases where KDE Partition Manager can have issues, where switching to using `gparted` instead resolves it. If you have a crash like you mention, you should reboot before you try again (*or at least logout/login again but reboot is safer*).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.