Skip to main content
added 337 characters in body
Source Link
Antti Haapala
  • 1.2k
  • 10
  • 11

For those that come to the answer to find out how to simply resize a LUKS partition to the size of the resized container, the commands are as follows:

  • with LUKS encrypted volume opened and the opened volume mapped as opened-volume, execute

    sudo cryptsetup resize /dev/mapper/opened-volume
    

    to resize the LUKS encrypted volume online...

  • then resize the file system. E.gcontents. if it is an Ext4 filesystem, you can resize it even if it is mounted with

    sudo resize2fs /dev/mapper/opened-volume
    
    • E.g. if it is an Ext4 filesystem, you can resize it even if it is mounted with

      sudo resize2fs /dev/mapper/opened-volume
      
    • Or if you had a LVM physical volume inside the LUKS encrypted volume, just use pvresize:

      sudo pvresize /dev/mapper/opened-volume
      

I did both commandsI've done this with a mounted file system/activated PV with no interruption; it was possible to resize the container without unmounting it first because the encrypted volume was on a LVM logical volume (using lvresize) / using parted to resize a GPT partition to contain the free space that immediately followed it!

For those that come to the answer to find out how to simply resize a LUKS partition to the size of the resized container, the commands are as follows:

  • with LUKS encrypted volume opened and the opened volume mapped as opened-volume, execute

    sudo cryptsetup resize /dev/mapper/opened-volume
    
  • then resize the file system. E.g. if it is an Ext4 filesystem, you can resize it even if it is mounted with

    sudo resize2fs /dev/mapper/opened-volume
    

I did both commands with a mounted file system with no interruption; it was possible to resize the container without unmounting it first because the encrypted volume was on a LVM logical volume (using lvresize)!

For those that come to the answer to find out how to simply resize a LUKS partition to the size of the resized container, the commands are as follows:

  • with LUKS encrypted volume opened and the opened volume mapped as opened-volume, execute

    sudo cryptsetup resize /dev/mapper/opened-volume
    

    to resize the LUKS encrypted volume online...

  • then resize the contents.

    • E.g. if it is an Ext4 filesystem, you can resize it even if it is mounted with

      sudo resize2fs /dev/mapper/opened-volume
      
    • Or if you had a LVM physical volume inside the LUKS encrypted volume, just use pvresize:

      sudo pvresize /dev/mapper/opened-volume
      

I've done this with a mounted file system/activated PV with no interruption; it was possible to resize the container without unmounting it first because the encrypted volume was on a LVM logical volume (using lvresize) / using parted to resize a GPT partition to contain the free space that immediately followed it!

added 31 characters in body
Source Link
Antti Haapala
  • 1.2k
  • 10
  • 11

For those that come to the answer to find out how to simply resize a LUKS partition to the size of the resized container, the commands are as follows:

  • with LUKS encrypted volume opened and the opened volume mapped as opened-volume, execute

    sudo cryptsetup resize /dev/mapper/opened-volume

    sudo cryptsetup resize /dev/mapper/opened-volume
    
  • then resize the file system. IfE.g. if it is Ext4an Ext4 filesystem, you can resize ait even if it is mounted file systemwith

    sudo resize2fs /dev/mapper/opened-volume

    sudo resize2fs /dev/mapper/opened-volume
    

I did both commands with a mounted file system with no interruption; it was possible to resize the container without unmounting it first because the encrypted volume was on a LVM logical volume (using lvresize)!

For those that come to the answer to find out how to simply resize a LUKS partition to the size of the resized container, the commands are as follows:

  • with LUKS encrypted volume opened and the opened volume mapped as opened-volume, execute

    sudo cryptsetup resize /dev/mapper/opened-volume

  • then resize the file system. If it is Ext4, you can resize a mounted file system

    sudo resize2fs /dev/mapper/opened-volume

I did both commands with a mounted file system with no interruption; it was possible to resize the container without unmounting it first because the encrypted volume was on a LVM logical volume (using lvresize)!

For those that come to the answer to find out how to simply resize a LUKS partition to the size of the resized container, the commands are as follows:

  • with LUKS encrypted volume opened and the opened volume mapped as opened-volume, execute

    sudo cryptsetup resize /dev/mapper/opened-volume
    
  • then resize the file system. E.g. if it is an Ext4 filesystem, you can resize it even if it is mounted with

    sudo resize2fs /dev/mapper/opened-volume
    

I did both commands with a mounted file system with no interruption; it was possible to resize the container without unmounting it first because the encrypted volume was on a LVM logical volume (using lvresize)!

added 2 characters in body
Source Link
Antti Haapala
  • 1.2k
  • 10
  • 11

For those that come to the answer to find out how to simply resize a LUKS partition to the size of the resized container, the commands are as follows:

  • with LUKS encrypted volume opened and the opened crypt volume mapped toas cryptopened-volume, execute

    sudo cryptsetup resize /dev/mapper/cryptopened-volume

  • then resize the file system. If it is Ext4, you can resize a mounted file system

    sudo resize2fs /dev/mapper/cryptopened-volume

I did both commands with a mounted file system with no interruption, thisinterruption; it was possible to resize the container without unmounting it first because the encrypted volume was on a LVM logical volume. (using lvresize)!

For those that come to the answer to find out how to simply resize a LUKS partition to the size of the resized container, the commands are as follows:

  • with opened crypt volume mapped to crypt-volume, execute

    sudo cryptsetup resize /dev/mapper/crypt-volume

  • then resize the file system. If it is Ext4, you can resize a mounted file system

    sudo resize2fs /dev/mapper/crypt-volume

I did both commands with a mounted file system with no interruption, this was possible because the encrypted volume was a LVM volume.

For those that come to the answer to find out how to simply resize a LUKS partition to the size of the resized container, the commands are as follows:

  • with LUKS encrypted volume opened and the opened volume mapped as opened-volume, execute

    sudo cryptsetup resize /dev/mapper/opened-volume

  • then resize the file system. If it is Ext4, you can resize a mounted file system

    sudo resize2fs /dev/mapper/opened-volume

I did both commands with a mounted file system with no interruption; it was possible to resize the container without unmounting it first because the encrypted volume was on a LVM logical volume (using lvresize)!

Source Link
Antti Haapala
  • 1.2k
  • 10
  • 11
Loading