Resizing a crypt-luks partition.

Hi, I hope this is the correct place for this post.I would like to shrink my main partition to create space on my HDD for another installation. As the title says my main partition is encrypted with the Opensuse default full disc encryption.I tried and failed with G-Parted. Is there a command line approach a relative newb could use ?Thanks in advance.

I would not expect “gparted” to be able to do this.

Here’s the picture:

  • You have some raw disk space which is encrypted, to give a virtual disk space.
  • A file system is created in that virtual disk space.

What you would need to do is:

  1. Resize the file system. For an “ext2”, “ext3” or “ext4” file system, the “resize2fs” command is supposed to be usable for this purpose.
  2. Once the file system is resized to a smaller size, you would need to shrink the virtual encrypted disk space. The man pages for “cryptsetup” give some information on this.

Personally, my advice would be to backup the partition, presumably to an encrypted archive of some kind, then delete a reallocate the partition to the desired size, then restore from backup. You might need to reinstall grub or other boot software.