0

I'm running a dual boot (Win 10 Pro, Ubuntu 20.04) system on a single NVMe harddisk. Linux contains one encrypted root partition, an encrypted boot partition and a swap partition. As the root partition was nearly full, I decided to delete the Windows Partition and use the free space for Ubuntu.

Windows was installed on partition /dev/sda3 which is 89,01 GB. I already deleted the partition. Now I want to extend the Linux root partition on /dev/sda5 which is encrypted with Luks.

The current status is shown in the following screenshots from KDE Partition Manager and Ubuntu Disk Utility.

KDE Partition Manager shows 89,01 GB of unallocated space:

https://i.sstatic.net/u0o4y.png

Ubuntu Disk Utility show 96 GB of unallocated space:

https://i.sstatic.net/ADemv.png

I don't know why the two tools show different size of unallocated space. That's the first unclear point.

I know that I only can extend a partition to the right which means I would have to shift the boot partition (/dev/sda4) and the root partition to the left (where the Windows Partition has been before). Unfortunately I didn't find the possibility to do this in GParted or KDE Partition Manager. I can't move or extend the partitions.

What I tried so far: Boot from Live Ubuntu USB Stick (because I cant modify the root partition Ubuntu is running on). Decrypted the boot partition and root partition with the Ubuntu Disk Utility. Launched KDE Partition Manager in order to move and extend the root partition. As you can see in the following screenshots I don't get the possibility to move or extend the boot or root partition (the screenshots show encrypted partitions, I tried it with encrypted and unencrypted partitions, both the same).

https://i.sstatic.net/k20Qr.png

https://i.sstatic.net/7o3DQ.png

As mentioned above I checked the possible options in KDE Partition Manager with encrypted and decrypted partitions. But I couldn't move or increase the partitions.

Does anybody know how to move the partitions to the left so the root partition can use the 89,01 GB additionally?

Thank's and best regards, Chris

10
  • As for the difference between 89.01 and 96, 89.01GiB ≈ 96GB since 89.01*1024*1024*1024 = 95573759754.24 ≈ 96*1000*1000*1000. Commented Oct 6, 2022 at 21:51
  • Is the move action available for the /boot partition in GParted (Live)? I suppose you'll need to move it first? By the way if you are using LVM, you can consider just create another LUKS/PV on the available space and add it to your VG (and LVs), although it might make booting more tricky.
    – Tom Yan
    Commented Oct 7, 2022 at 1:12
  • By the way if you have an extra drive to spare for backup (which you should anyway for such action), you might as well just dump the two LUKS (with e.g. dd) to the backup drive and dump it back to the original one with the locations you desire. Just make sure the new partitions (entries) you create are no smaller than the one you are going to delete.
    – Tom Yan
    Commented Oct 7, 2022 at 1:16
  • Thank's for the clarification @user2233709
    – bsj4sla
    Commented Oct 7, 2022 at 7:24
  • @TomYan I didn't get the possibility to move the /boot partition. I thought, too, that I have to move boot partition at first, then root partition. It looks like I cant do anything with these two partitions in GParted/KDE PM. Yes,I have a backup drive. So this solution can work. So I would need to copy boot and root partition using dd to another backup drive.Then delete these two partitions on my harddisk. And then I need to create the boot partition again on the most left side with same size as before and on the rest I will create the root partition. Then copy data back using dd again. Right?
    – bsj4sla
    Commented Oct 7, 2022 at 7:30

1 Answer 1

0

Suddenly I could move both partitions in GParted. I don't know why it worked. I attached my backup drive to do the backup before deleting the partition. A last time I wanted to check the options for both partitions and it was possible. No clue what made the differences to my previous attempts. So at the end:

  1. made a backup of my whole harddisk using dd

  2. moved the encrypted /boot and /root partitions using GParted. When trying to move them I got an error message

Could not add this operation to the list A partition with used sectors (...) greater than its length (...) is not valid

After googling I found this thread: https://gitlab.gnome.org/GNOME/gparted/-/issues/48 I sounds as they didn't fix it but nonetheless I tried to use the newest GParted version (1.4.0) and the error was gone. So I didn't use the workaround described in the gitlab thread. Hint: currently GParted is only available with version 1.0.0 in the official Ubuntu apt repo. I used the .iso image (with version 1.4.0) published by GParted to do the resizing.

  1. resized the /root partition using this tutorial: https://help.ubuntu.com/community/ResizeEncryptedPartitions#Detailed_resizing_.2BAH4_Enlarging_an_encrypted_partition I used exactly the same commands as described in the tutorial.

Afterwards everything worked the same as before (except the bigger /root partition :-)) I didn't modify Grub to not show the deleted windows as a boot option. I'm happy as it is.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .