Skip to main content
added 5254 characters in body
Source Link
  1. [Adapted from my instructions here] Use blivet-gui to grow and edit the inner LVM volume(s) within the outer LUKS-encrypted partition: press the Windows key and type in "blivet" to open the blivet-gui tool. Note: the blivet-gui should NOT already be open! You must do the unlock step above in "Disks" before opening blivet-gui. Under the bold "LVM" label is my vgubuntu Logical Volume which I just unlocked with the Disks tool above. I want to grow this LVM to fill the entire outer LUKS-encrypted partition space. Here is what I see in blivet-gui when I click on the vgubuntu LVM and then the "Logical View" tab:

    1. enter image description here

    2. You can see the vgubuntu-root 474.75 GiB section, which is what I just cloned to this new disk using ddrescue above. Let's delete the 980 MiB swap logical partition in this LVM and grow the main LVM to fill the whole (980 MiB + 1.3 TiB) space, as follows:

    3. Right-click the 980 MiB logial swap partition and go to "Delete". Right-click the 474.75 GiB logical main partition and go to --> Edit --> Resize --> drag the slider all the way to the right to resize it to fill the whole LVM container within the LUKS partition. Here's what that looks like for me:

      enter image description here

      Click "Resize", then click the little check-mark at the top of the main blivet-gui window --> you'll need to "Confirm scheduled actions" by clicking "Ok" to complete the operation. It will take about 20 seconds. Be patient. When it completes, click "OK" on the box which says "All queued actions have been processed."

  2. Now close blivet-gui, Disks, and gparted (if you had it open too). Then, open your nautilus file manager and go to Other Locations"Other Locations" in the left-hand pane --> click on "1.9 TB Volume" to auto-mount it. Once your new disk is mounted, run df -h in the terminal to view its new size and space avaiable. The output below is what I see now. The file-system I just expanded via blivet-gui is the very last line in this output, and is called Filesystem /dev/mapper/vgubuntu-root, mounted at path /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab. You can see I now have 412 GB used and now have 1.3 TB available! I just cloned my nearly-full 512 GB disk to a new 2 TB disk, so that makes sense!

    ubuntu@ubuntu:~$ df -h
    Filesystem                   Size  Used Avail Use% Mounted on
    tmpfs                        3.2G   11M  3.2G   1% /run
    /dev/sda1                    3.6G  3.6G     0 100% /cdrom
    /cow                          16G  581M   16G   4% /
    /dev/disk/by-label/writable   11G   18M   11G   1% /var/log
    tmpfs                         16G  432K   16G   1% /dev/shm
    tmpfs                        5.0M  8.0K  5.0M   1% /run/lock
    tmpfs                         16G  324K   16G   1% /tmp
    tmpfs                        3.2G  184K  3.2G   1% /run/user/999
    /dev/mapper/vgubuntu-root    1.8T  412G  1.3T  25% /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab
    

Basically, just shut down, remove your Ubuntu live USB, and boot back up into the internal drive as normal! That's it!

You'll type in your LUKS encryption password at boot, just like normal. You'll log in to your user account just like normal. Everything will be exactly as you last left it before the clone, except df -h will show that your root filesystem mounted at path / is now much bigger!

Done.

  1. [Adapted from my instructions here] Use blivet-gui to grow and edit the inner LVM volume(s) within the outer LUKS-encrypted partition: press the Windows key and type in "blivet" to open the blivet-gui tool. Note: the blivet-gui should NOT already be open! You must do the unlock step above in "Disks" before opening blivet-gui. Under the bold "LVM" label is my vgubuntu Logical Volume which I just unlocked with the Disks tool above. I want to grow this LVM to fill the entire outer LUKS-encrypted partition space. Here is what I see in blivet-gui when I click on the vgubuntu LVM and then the "Logical View" tab:

    1. enter image description here

    2. You can see the vgubuntu-root 474.75 GiB section, which is what I just cloned to this new disk using ddrescue above. Let's delete the 980 MiB swap logical partition in this LVM and grow the main LVM to fill the whole space, as follows:

    3. Right-click the 980 MiB logial swap partition and go to "Delete". Right-click the 474.75 GiB logical main partition and go to --> Edit --> Resize --> drag the slider all the way to the right to resize it to fill the whole LVM container within the LUKS partition. Here's what that looks like for me:

      enter image description here

      Click "Resize", then click the little check-mark at the top of the main blivet-gui window --> you'll need to "Confirm scheduled actions" by clicking "Ok" to complete the operation. It will take about 20 seconds. Be patient. When it completes, click "OK" on the box which says "All queued actions have been processed."

  2. Now close blivet-gui, Disks, and gparted (if you had it open too). Then, open your nautilus file manager and go to Other Locations --> click on "1.9 TB Volume" to auto-mount it. Once your new disk is mounted, run df -h in the terminal to view its new size and space avaiable. The output below is what I see now. The file-system I just expanded via blivet-gui is the very last line in this output, and is called Filesystem /dev/mapper/vgubuntu-root, mounted at path /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab. You can see I have 412 GB used and now have 1.3 TB available! I just cloned my nearly-full 512 GB disk to a new 2 TB disk, so that makes sense!

    ubuntu@ubuntu:~$ df -h
    Filesystem                   Size  Used Avail Use% Mounted on
    tmpfs                        3.2G   11M  3.2G   1% /run
    /dev/sda1                    3.6G  3.6G     0 100% /cdrom
    /cow                          16G  581M   16G   4% /
    /dev/disk/by-label/writable   11G   18M   11G   1% /var/log
    tmpfs                         16G  432K   16G   1% /dev/shm
    tmpfs                        5.0M  8.0K  5.0M   1% /run/lock
    tmpfs                         16G  324K   16G   1% /tmp
    tmpfs                        3.2G  184K  3.2G   1% /run/user/999
    /dev/mapper/vgubuntu-root    1.8T  412G  1.3T  25% /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab
    
  1. [Adapted from my instructions here] Use blivet-gui to grow and edit the inner LVM volume(s) within the outer LUKS-encrypted partition: press the Windows key and type in "blivet" to open the blivet-gui tool. Note: the blivet-gui should NOT already be open! You must do the unlock step above in "Disks" before opening blivet-gui. Under the bold "LVM" label is my vgubuntu Logical Volume which I just unlocked with the Disks tool above. I want to grow this LVM to fill the entire outer LUKS-encrypted partition space. Here is what I see in blivet-gui when I click on the vgubuntu LVM and then the "Logical View" tab:

    1. enter image description here

    2. You can see the vgubuntu-root 474.75 GiB section, which is what I just cloned to this new disk using ddrescue above. Let's delete the 980 MiB swap logical partition in this LVM and grow the main LVM to fill the whole (980 MiB + 1.3 TiB) space, as follows:

    3. Right-click the 980 MiB logial swap partition and go to "Delete". Right-click the 474.75 GiB logical main partition and go to --> Edit --> Resize --> drag the slider all the way to the right to resize it to fill the whole LVM container within the LUKS partition.

      Click "Resize", then click the little check-mark at the top of the main blivet-gui window --> you'll need to "Confirm scheduled actions" by clicking "Ok" to complete the operation. It will take about 20 seconds. Be patient. When it completes, click "OK" on the box which says "All queued actions have been processed."

  2. Now close blivet-gui, Disks, and gparted (if you had it open too). Then, open your nautilus file manager and go to "Other Locations" in the left-hand pane --> click on "1.9 TB Volume" to auto-mount it. Once your new disk is mounted, run df -h in the terminal to view its new size and space avaiable. The output below is what I see now. The file-system I just expanded via blivet-gui is the very last line in this output, and is called Filesystem /dev/mapper/vgubuntu-root, mounted at path /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab. You can see I now have 412 GB used and 1.3 TB available! I just cloned my nearly-full 512 GB disk to a new 2 TB disk, so that makes sense!

    ubuntu@ubuntu:~$ df -h
    Filesystem                   Size  Used Avail Use% Mounted on
    tmpfs                        3.2G   11M  3.2G   1% /run
    /dev/sda1                    3.6G  3.6G     0 100% /cdrom
    /cow                          16G  581M   16G   4% /
    /dev/disk/by-label/writable   11G   18M   11G   1% /var/log
    tmpfs                         16G  432K   16G   1% /dev/shm
    tmpfs                        5.0M  8.0K  5.0M   1% /run/lock
    tmpfs                         16G  324K   16G   1% /tmp
    tmpfs                        3.2G  184K  3.2G   1% /run/user/999
    /dev/mapper/vgubuntu-root    1.8T  412G  1.3T  25% /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab
    

Basically, just shut down, remove your Ubuntu live USB, and boot back up into the internal drive as normal! That's it!

You'll type in your LUKS encryption password at boot, just like normal. You'll log in to your user account just like normal. Everything will be exactly as you last left it before the clone, except df -h will show that your root filesystem mounted at path / is now much bigger!

Done.

added 5254 characters in body
Source Link

You now have 2 options:

Option 1. [Newly-added as of 16 Mar. 2023--what I recommend now] Use a GUI to grow the LVM volume within the LUKS partition

In the Ubuntu live USB, install blivet-gui, following my instructions here. In short:

sudo apt update
sudo add-apt-repository universe
sudo apt --fix-broken install
sudo apt update

# optional, if you want to try the other answer here recommending this tool too
sudo apt install partitionmanager

sudo apt install curl

# On the Ubuntu 22.04 live USB
echo 'deb http://download.opensuse.org/repositories/home:/vtrefny/xUbuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/home:vtrefny.list
curl -fsSL https://download.opensuse.org/repositories/home:vtrefny/xUbuntu_22.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_vtrefny.gpg > /dev/null
sudo apt update
sudo apt install blivet-gui

Then:

  1. Use Disks to unlock the outer LUKS-encrypted partition: press the Windows key and type in "disks" to open up the gnome-disks GUI tool. Click on your drive of interest containing the LUKS-encrypted partition, then find the locked LUKS-encrypted partition. This is what I'm calling the "outer partition", since it contains protected inner LVM volumes. Click the unlock icon (it looks like an unlocked padlock) and enter your encryption password to unlock the partition. It will take several seconds to complete unlocking. You'll see the unlocked inner "LVM2 PV" volumes now show up in the Disks GUI underneath that outer "LUKS" partition. Reminder: only the Disks tool can properly unlock the partition to work with the next step. Don't unlock it with blivet-gui nor GParted, or else blivet-gui will throw an error in the next step.
  1. [Adapted from my instructions here] Use blivet-gui to grow and edit the inner LVM volume(s) within the outer LUKS-encrypted partition: press the Windows key and type in "blivet" to open the blivet-gui tool. Note: the blivet-gui should NOT already be open! You must do the unlock step above in "Disks" before opening blivet-gui. Under the bold "LVM" label is my vgubuntu Logical Volume which I just unlocked with the Disks tool above. I want to grow this LVM to fill the entire outer LUKS-encrypted partition space. Here is what I see in blivet-gui when I click on the vgubuntu LVM and then the "Logical View" tab:

    1. enter image description here

    2. You can see the vgubuntu-root 474.75 GiB section, which is what I just cloned to this new disk using ddrescue above. Let's delete the 980 MiB swap logical partition in this LVM and grow the main LVM to fill the whole space, as follows:

    3. Right-click the 980 MiB logial swap partition and go to "Delete". Right-click the 474.75 GiB logical main partition and go to --> Edit --> Resize --> drag the slider all the way to the right to resize it to fill the whole LVM container within the LUKS partition. Here's what that looks like for me:

      enter image description here

      Click "Resize", then click the little check-mark at the top of the main blivet-gui window --> you'll need to "Confirm scheduled actions" by clicking "Ok" to complete the operation. It will take about 20 seconds. Be patient. When it completes, click "OK" on the box which says "All queued actions have been processed."

  2. Now close blivet-gui, Disks, and gparted (if you had it open too). Then, open your nautilus file manager and go to Other Locations --> click on "1.9 TB Volume" to auto-mount it. Once your new disk is mounted, run df -h in the terminal to view its new size and space avaiable. The output below is what I see now. The file-system I just expanded via blivet-gui is the very last line in this output, and is called Filesystem /dev/mapper/vgubuntu-root, mounted at path /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab. You can see I have 412 GB used and now have 1.3 TB available! I just cloned my nearly-full 512 GB disk to a new 2 TB disk, so that makes sense!

    ubuntu@ubuntu:~$ df -h
    Filesystem                   Size  Used Avail Use% Mounted on
    tmpfs                        3.2G   11M  3.2G   1% /run
    /dev/sda1                    3.6G  3.6G     0 100% /cdrom
    /cow                          16G  581M   16G   4% /
    /dev/disk/by-label/writable   11G   18M   11G   1% /var/log
    tmpfs                         16G  432K   16G   1% /dev/shm
    tmpfs                        5.0M  8.0K  5.0M   1% /run/lock
    tmpfs                         16G  324K   16G   1% /tmp
    tmpfs                        3.2G  184K  3.2G   1% /run/user/999
    /dev/mapper/vgubuntu-root    1.8T  412G  1.3T  25% /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab
    

You can now reboot onto your new internal disk and use it as normal. See the steps below for more details.

Option 2. [Original answer] Use the command-line to grow the LVM volume within the LUKS partition

You now have 2 options:

Option 1. [Newly-added as of 16 Mar. 2023--what I recommend now] Use a GUI to grow the LVM volume within the LUKS partition

In the Ubuntu live USB, install blivet-gui, following my instructions here. In short:

sudo apt update
sudo add-apt-repository universe
sudo apt --fix-broken install
sudo apt update

# optional, if you want to try the other answer here recommending this tool too
sudo apt install partitionmanager

sudo apt install curl

# On the Ubuntu 22.04 live USB
echo 'deb http://download.opensuse.org/repositories/home:/vtrefny/xUbuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/home:vtrefny.list
curl -fsSL https://download.opensuse.org/repositories/home:vtrefny/xUbuntu_22.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_vtrefny.gpg > /dev/null
sudo apt update
sudo apt install blivet-gui

Then:

  1. Use Disks to unlock the outer LUKS-encrypted partition: press the Windows key and type in "disks" to open up the gnome-disks GUI tool. Click on your drive of interest containing the LUKS-encrypted partition, then find the locked LUKS-encrypted partition. This is what I'm calling the "outer partition", since it contains protected inner LVM volumes. Click the unlock icon (it looks like an unlocked padlock) and enter your encryption password to unlock the partition. It will take several seconds to complete unlocking. You'll see the unlocked inner "LVM2 PV" volumes now show up in the Disks GUI underneath that outer "LUKS" partition. Reminder: only the Disks tool can properly unlock the partition to work with the next step. Don't unlock it with blivet-gui nor GParted, or else blivet-gui will throw an error in the next step.
  1. [Adapted from my instructions here] Use blivet-gui to grow and edit the inner LVM volume(s) within the outer LUKS-encrypted partition: press the Windows key and type in "blivet" to open the blivet-gui tool. Note: the blivet-gui should NOT already be open! You must do the unlock step above in "Disks" before opening blivet-gui. Under the bold "LVM" label is my vgubuntu Logical Volume which I just unlocked with the Disks tool above. I want to grow this LVM to fill the entire outer LUKS-encrypted partition space. Here is what I see in blivet-gui when I click on the vgubuntu LVM and then the "Logical View" tab:

    1. enter image description here

    2. You can see the vgubuntu-root 474.75 GiB section, which is what I just cloned to this new disk using ddrescue above. Let's delete the 980 MiB swap logical partition in this LVM and grow the main LVM to fill the whole space, as follows:

    3. Right-click the 980 MiB logial swap partition and go to "Delete". Right-click the 474.75 GiB logical main partition and go to --> Edit --> Resize --> drag the slider all the way to the right to resize it to fill the whole LVM container within the LUKS partition. Here's what that looks like for me:

      enter image description here

      Click "Resize", then click the little check-mark at the top of the main blivet-gui window --> you'll need to "Confirm scheduled actions" by clicking "Ok" to complete the operation. It will take about 20 seconds. Be patient. When it completes, click "OK" on the box which says "All queued actions have been processed."

  2. Now close blivet-gui, Disks, and gparted (if you had it open too). Then, open your nautilus file manager and go to Other Locations --> click on "1.9 TB Volume" to auto-mount it. Once your new disk is mounted, run df -h in the terminal to view its new size and space avaiable. The output below is what I see now. The file-system I just expanded via blivet-gui is the very last line in this output, and is called Filesystem /dev/mapper/vgubuntu-root, mounted at path /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab. You can see I have 412 GB used and now have 1.3 TB available! I just cloned my nearly-full 512 GB disk to a new 2 TB disk, so that makes sense!

    ubuntu@ubuntu:~$ df -h
    Filesystem                   Size  Used Avail Use% Mounted on
    tmpfs                        3.2G   11M  3.2G   1% /run
    /dev/sda1                    3.6G  3.6G     0 100% /cdrom
    /cow                          16G  581M   16G   4% /
    /dev/disk/by-label/writable   11G   18M   11G   1% /var/log
    tmpfs                         16G  432K   16G   1% /dev/shm
    tmpfs                        5.0M  8.0K  5.0M   1% /run/lock
    tmpfs                         16G  324K   16G   1% /tmp
    tmpfs                        3.2G  184K  3.2G   1% /run/user/999
    /dev/mapper/vgubuntu-root    1.8T  412G  1.3T  25% /media/ubuntu/abcdef01-abcd-0123-abcd-0123456789ab
    

You can now reboot onto your new internal disk and use it as normal. See the steps below for more details.

Option 2. [Original answer] Use the command-line to grow the LVM volume within the LUKS partition

added 1 character in body
Source Link

TLDRBrief summary:

TLDR summary:

Brief summary:

added 786 characters in body
Source Link
Loading
added 331 characters in body
Source Link
Loading
added 121 characters in body
Source Link
Loading
added 6 characters in body
Source Link
Loading
added 210 characters in body
Source Link
Loading
added 131 characters in body
Source Link
Loading
added 29 characters in body
Source Link
Loading
added 333 characters in body
Source Link
Loading
added 333 characters in body
Source Link
Loading
added 333 characters in body
Source Link
Loading
added 333 characters in body
Source Link
Loading
added 1387 characters in body
Source Link
Loading
added 367 characters in body
Source Link
Loading
Source Link
Loading