How to add unallocated space to encrypted partition (using Gparted)Why do I keep getting an error when I try to resize ext4 under extended?Can't extend root partition even after booting from LiveUSBResizing LUKS partition when not using LVMAfter insuccessful partition resize with Gparted, partition grew but file system notError when resizing a ext4 partition

Advice for Stockholm metro and buses for a large family

How should I analyze this passage? As vii°7, V7, or both?

Why does China have so few nuclear weapons?

Thoughts on if it's possible to succeed in math @ PhD level w/o natural ability in quant reasoning?

Confused about Autoregressive AR(1) process

How do successful undergraduate and PhD students differ?

Can a human colony survive on a 'hot' world?

Why didn't the 6502 have increase/decrease opcodes for A?

How do I get a stuck gas canister (for hiking/camping) out of a stainless steel mug?

Reconstructing the results of a 5-team soccer tournament

At a conference, should I visit other people's posters during my poster session?

Is using Swiss Francs (CHF) cheaper than Euros (EUR) in Switzerland?

Reimbursed more than my travel expenses for interview

Car Possession being threatened by Signer

Key takeaways in German in a presentation

Talmud Bavli Sanhedrin 98b: an interpretation in a messianic sense of the figure of the "suffering servant" of Isaiah 52-53?

How can I encourage a fellow player to develop a character a bit more?

What does it mean to play in a mode?

How do I compile something for Linux if I don't have enough space for installing GCC?

Geodesic sphere in the octonion projective plane

Longest Prime Sums

I shift the source code, you shift the input!

Why didn't the British consider the USS President's attempted flight as a fake surrender?

What is a Aged Rope Phrase™?



How to add unallocated space to encrypted partition (using Gparted)


Why do I keep getting an error when I try to resize ext4 under extended?Can't extend root partition even after booting from LiveUSBResizing LUKS partition when not using LVMAfter insuccessful partition resize with Gparted, partition grew but file system notError when resizing a ext4 partition






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0


















Sorry if this is a duplicate, but I think I haven’t seen this exact situation on askubuntu yet.. I have an encrypted partition on a VPS running Ubuntu 18.04 that I would like to enlarge. I also have unallocated space. However, using Gparted I am unable to resize the partition. What can I do to solve this?



Gparted



enter image description here



Edit: resizing with this method almost works, except the last step.



I get:



resize2fs: Device or resource busy while trying to open /dev/mapper/vda5_crypt
Couldn't find valid filesystem superblock.


Anyone know what I could do about this?










share|improve this question






















  • 1





    I think you can't because you are working from the mounted /dev/vda5 partition, is that correct? You need to reboot from a LiveUSB, and use gparted from there.

    – Jos
    Sep 30 at 15:33











  • A Google search for “Gparted encrypted partition“ throws up many hits including the Gparted manual which contains instructions for working with LUKS: Select a closed LUKS encrypted partition. See the section called “Selecting a Partition”. Choose: Partition → Open Encryption.

    – PonJar
    Sep 30 at 15:40











  • @Jos is it even possible to reboot from a LiveUSB with a VPS?

    – Flobin
    Oct 2 at 11:33











  • @PonJar When I select the encrypted partition and click on 'partition' in the menu, I don't see 'open encryption': dropbox.com/s/hu37lvbnqjcneli/…

    – Flobin
    Oct 2 at 11:40











  • If that function is absent it suggests a version issue. What version of Gparted are you running? I think it will need to be 0.32 or above. The latest is 1.0.0-5.

    – PonJar
    Oct 2 at 12:52

















0


















Sorry if this is a duplicate, but I think I haven’t seen this exact situation on askubuntu yet.. I have an encrypted partition on a VPS running Ubuntu 18.04 that I would like to enlarge. I also have unallocated space. However, using Gparted I am unable to resize the partition. What can I do to solve this?



Gparted



enter image description here



Edit: resizing with this method almost works, except the last step.



I get:



resize2fs: Device or resource busy while trying to open /dev/mapper/vda5_crypt
Couldn't find valid filesystem superblock.


Anyone know what I could do about this?










share|improve this question






















  • 1





    I think you can't because you are working from the mounted /dev/vda5 partition, is that correct? You need to reboot from a LiveUSB, and use gparted from there.

    – Jos
    Sep 30 at 15:33











  • A Google search for “Gparted encrypted partition“ throws up many hits including the Gparted manual which contains instructions for working with LUKS: Select a closed LUKS encrypted partition. See the section called “Selecting a Partition”. Choose: Partition → Open Encryption.

    – PonJar
    Sep 30 at 15:40











  • @Jos is it even possible to reboot from a LiveUSB with a VPS?

    – Flobin
    Oct 2 at 11:33











  • @PonJar When I select the encrypted partition and click on 'partition' in the menu, I don't see 'open encryption': dropbox.com/s/hu37lvbnqjcneli/…

    – Flobin
    Oct 2 at 11:40











  • If that function is absent it suggests a version issue. What version of Gparted are you running? I think it will need to be 0.32 or above. The latest is 1.0.0-5.

    – PonJar
    Oct 2 at 12:52













0













0









0








Sorry if this is a duplicate, but I think I haven’t seen this exact situation on askubuntu yet.. I have an encrypted partition on a VPS running Ubuntu 18.04 that I would like to enlarge. I also have unallocated space. However, using Gparted I am unable to resize the partition. What can I do to solve this?



Gparted



enter image description here



Edit: resizing with this method almost works, except the last step.



I get:



resize2fs: Device or resource busy while trying to open /dev/mapper/vda5_crypt
Couldn't find valid filesystem superblock.


Anyone know what I could do about this?










share|improve this question
















Sorry if this is a duplicate, but I think I haven’t seen this exact situation on askubuntu yet.. I have an encrypted partition on a VPS running Ubuntu 18.04 that I would like to enlarge. I also have unallocated space. However, using Gparted I am unable to resize the partition. What can I do to solve this?



Gparted



enter image description here



Edit: resizing with this method almost works, except the last step.



I get:



resize2fs: Device or resource busy while trying to open /dev/mapper/vda5_crypt
Couldn't find valid filesystem superblock.


Anyone know what I could do about this?







partitioning encryption gparted






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 3 at 13:38







Flobin

















asked Sep 30 at 14:59









FlobinFlobin

1013 bronze badges




1013 bronze badges










  • 1





    I think you can't because you are working from the mounted /dev/vda5 partition, is that correct? You need to reboot from a LiveUSB, and use gparted from there.

    – Jos
    Sep 30 at 15:33











  • A Google search for “Gparted encrypted partition“ throws up many hits including the Gparted manual which contains instructions for working with LUKS: Select a closed LUKS encrypted partition. See the section called “Selecting a Partition”. Choose: Partition → Open Encryption.

    – PonJar
    Sep 30 at 15:40











  • @Jos is it even possible to reboot from a LiveUSB with a VPS?

    – Flobin
    Oct 2 at 11:33











  • @PonJar When I select the encrypted partition and click on 'partition' in the menu, I don't see 'open encryption': dropbox.com/s/hu37lvbnqjcneli/…

    – Flobin
    Oct 2 at 11:40











  • If that function is absent it suggests a version issue. What version of Gparted are you running? I think it will need to be 0.32 or above. The latest is 1.0.0-5.

    – PonJar
    Oct 2 at 12:52












  • 1





    I think you can't because you are working from the mounted /dev/vda5 partition, is that correct? You need to reboot from a LiveUSB, and use gparted from there.

    – Jos
    Sep 30 at 15:33











  • A Google search for “Gparted encrypted partition“ throws up many hits including the Gparted manual which contains instructions for working with LUKS: Select a closed LUKS encrypted partition. See the section called “Selecting a Partition”. Choose: Partition → Open Encryption.

    – PonJar
    Sep 30 at 15:40











  • @Jos is it even possible to reboot from a LiveUSB with a VPS?

    – Flobin
    Oct 2 at 11:33











  • @PonJar When I select the encrypted partition and click on 'partition' in the menu, I don't see 'open encryption': dropbox.com/s/hu37lvbnqjcneli/…

    – Flobin
    Oct 2 at 11:40











  • If that function is absent it suggests a version issue. What version of Gparted are you running? I think it will need to be 0.32 or above. The latest is 1.0.0-5.

    – PonJar
    Oct 2 at 12:52







1




1





I think you can't because you are working from the mounted /dev/vda5 partition, is that correct? You need to reboot from a LiveUSB, and use gparted from there.

– Jos
Sep 30 at 15:33





I think you can't because you are working from the mounted /dev/vda5 partition, is that correct? You need to reboot from a LiveUSB, and use gparted from there.

– Jos
Sep 30 at 15:33













A Google search for “Gparted encrypted partition“ throws up many hits including the Gparted manual which contains instructions for working with LUKS: Select a closed LUKS encrypted partition. See the section called “Selecting a Partition”. Choose: Partition → Open Encryption.

– PonJar
Sep 30 at 15:40





A Google search for “Gparted encrypted partition“ throws up many hits including the Gparted manual which contains instructions for working with LUKS: Select a closed LUKS encrypted partition. See the section called “Selecting a Partition”. Choose: Partition → Open Encryption.

– PonJar
Sep 30 at 15:40













@Jos is it even possible to reboot from a LiveUSB with a VPS?

– Flobin
Oct 2 at 11:33





@Jos is it even possible to reboot from a LiveUSB with a VPS?

– Flobin
Oct 2 at 11:33













@PonJar When I select the encrypted partition and click on 'partition' in the menu, I don't see 'open encryption': dropbox.com/s/hu37lvbnqjcneli/…

– Flobin
Oct 2 at 11:40





@PonJar When I select the encrypted partition and click on 'partition' in the menu, I don't see 'open encryption': dropbox.com/s/hu37lvbnqjcneli/…

– Flobin
Oct 2 at 11:40













If that function is absent it suggests a version issue. What version of Gparted are you running? I think it will need to be 0.32 or above. The latest is 1.0.0-5.

– PonJar
Oct 2 at 12:52





If that function is absent it suggests a version issue. What version of Gparted are you running? I think it will need to be 0.32 or above. The latest is 1.0.0-5.

– PonJar
Oct 2 at 12:52










1 Answer
1






active

oldest

votes


















0



















I was able to enlarge the partition using the method outlined in this forum post.



I'll repost it here in case that post is taken down. Side note: I did not do steps 1 - 3, because I had already managed to enlarge the partition in Gparted.



  1. Boot a live CD and, using any tool, create a new partition, lets call it /dev/sda6 , next to and to the left of (after) your crypt.


  2. Write random data to the new partition.


Make sure you have the correct partition for this command or you will overwrite your crypt.



sudo dd if=/dev/urandom of=/dev/sda6



You can run that command as many times as your paranoia requires.



  1. Use fdisk as above to delete and then re-create a larger crypt partition.


  2. Reboot to the live CD.


  3. Install lvm2 and cryptsetup.


sudo apt-get update && sudo apt-get install lvm2 cryptsetup



  1. Load the cryptsetup module.

sudo modprobe dm-crypt



  1. Decrypt your file system.

sudo cryptsetup luksOpen /dev/sda5 crypt1



  1. Get the live CD to recognize (activate) your LVM.

sudo vgscan --mknodes
sudo vgchange -ay



  1. Resize the Crypt.

sudo cryptsetup resize crypt1



  1. Resize the (LVM) Physical volume.

sudo pvresize /dev/mapper/crypt1



  1. Resize your root (LVM) Logical Volume.

Unlock the physical volume.



sudo pvchange -x y /dev/mapper/crypt1



Resize your root (LVM) Logical Volume.



lvresize -L +4G /dev/hardy/root



Note: Change the +4G to the amount of space you are adding.



Re-lock the (LVM) Physical Volume.



sudo pvchange -x n /dev/mapper/crypt1



  1. Resize the filesystem.

sudo e2fsck -f /dev/mapper/hardy-root
sudo resize2fs -p /dev/mapper/hardy-root






share|improve this answer


























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177700%2fhow-to-add-unallocated-space-to-encrypted-partition-using-gparted%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown


























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0



















    I was able to enlarge the partition using the method outlined in this forum post.



    I'll repost it here in case that post is taken down. Side note: I did not do steps 1 - 3, because I had already managed to enlarge the partition in Gparted.



    1. Boot a live CD and, using any tool, create a new partition, lets call it /dev/sda6 , next to and to the left of (after) your crypt.


    2. Write random data to the new partition.


    Make sure you have the correct partition for this command or you will overwrite your crypt.



    sudo dd if=/dev/urandom of=/dev/sda6



    You can run that command as many times as your paranoia requires.



    1. Use fdisk as above to delete and then re-create a larger crypt partition.


    2. Reboot to the live CD.


    3. Install lvm2 and cryptsetup.


    sudo apt-get update && sudo apt-get install lvm2 cryptsetup



    1. Load the cryptsetup module.

    sudo modprobe dm-crypt



    1. Decrypt your file system.

    sudo cryptsetup luksOpen /dev/sda5 crypt1



    1. Get the live CD to recognize (activate) your LVM.

    sudo vgscan --mknodes
    sudo vgchange -ay



    1. Resize the Crypt.

    sudo cryptsetup resize crypt1



    1. Resize the (LVM) Physical volume.

    sudo pvresize /dev/mapper/crypt1



    1. Resize your root (LVM) Logical Volume.

    Unlock the physical volume.



    sudo pvchange -x y /dev/mapper/crypt1



    Resize your root (LVM) Logical Volume.



    lvresize -L +4G /dev/hardy/root



    Note: Change the +4G to the amount of space you are adding.



    Re-lock the (LVM) Physical Volume.



    sudo pvchange -x n /dev/mapper/crypt1



    1. Resize the filesystem.

    sudo e2fsck -f /dev/mapper/hardy-root
    sudo resize2fs -p /dev/mapper/hardy-root






    share|improve this answer





























      0



















      I was able to enlarge the partition using the method outlined in this forum post.



      I'll repost it here in case that post is taken down. Side note: I did not do steps 1 - 3, because I had already managed to enlarge the partition in Gparted.



      1. Boot a live CD and, using any tool, create a new partition, lets call it /dev/sda6 , next to and to the left of (after) your crypt.


      2. Write random data to the new partition.


      Make sure you have the correct partition for this command or you will overwrite your crypt.



      sudo dd if=/dev/urandom of=/dev/sda6



      You can run that command as many times as your paranoia requires.



      1. Use fdisk as above to delete and then re-create a larger crypt partition.


      2. Reboot to the live CD.


      3. Install lvm2 and cryptsetup.


      sudo apt-get update && sudo apt-get install lvm2 cryptsetup



      1. Load the cryptsetup module.

      sudo modprobe dm-crypt



      1. Decrypt your file system.

      sudo cryptsetup luksOpen /dev/sda5 crypt1



      1. Get the live CD to recognize (activate) your LVM.

      sudo vgscan --mknodes
      sudo vgchange -ay



      1. Resize the Crypt.

      sudo cryptsetup resize crypt1



      1. Resize the (LVM) Physical volume.

      sudo pvresize /dev/mapper/crypt1



      1. Resize your root (LVM) Logical Volume.

      Unlock the physical volume.



      sudo pvchange -x y /dev/mapper/crypt1



      Resize your root (LVM) Logical Volume.



      lvresize -L +4G /dev/hardy/root



      Note: Change the +4G to the amount of space you are adding.



      Re-lock the (LVM) Physical Volume.



      sudo pvchange -x n /dev/mapper/crypt1



      1. Resize the filesystem.

      sudo e2fsck -f /dev/mapper/hardy-root
      sudo resize2fs -p /dev/mapper/hardy-root






      share|improve this answer



























        0















        0











        0









        I was able to enlarge the partition using the method outlined in this forum post.



        I'll repost it here in case that post is taken down. Side note: I did not do steps 1 - 3, because I had already managed to enlarge the partition in Gparted.



        1. Boot a live CD and, using any tool, create a new partition, lets call it /dev/sda6 , next to and to the left of (after) your crypt.


        2. Write random data to the new partition.


        Make sure you have the correct partition for this command or you will overwrite your crypt.



        sudo dd if=/dev/urandom of=/dev/sda6



        You can run that command as many times as your paranoia requires.



        1. Use fdisk as above to delete and then re-create a larger crypt partition.


        2. Reboot to the live CD.


        3. Install lvm2 and cryptsetup.


        sudo apt-get update && sudo apt-get install lvm2 cryptsetup



        1. Load the cryptsetup module.

        sudo modprobe dm-crypt



        1. Decrypt your file system.

        sudo cryptsetup luksOpen /dev/sda5 crypt1



        1. Get the live CD to recognize (activate) your LVM.

        sudo vgscan --mknodes
        sudo vgchange -ay



        1. Resize the Crypt.

        sudo cryptsetup resize crypt1



        1. Resize the (LVM) Physical volume.

        sudo pvresize /dev/mapper/crypt1



        1. Resize your root (LVM) Logical Volume.

        Unlock the physical volume.



        sudo pvchange -x y /dev/mapper/crypt1



        Resize your root (LVM) Logical Volume.



        lvresize -L +4G /dev/hardy/root



        Note: Change the +4G to the amount of space you are adding.



        Re-lock the (LVM) Physical Volume.



        sudo pvchange -x n /dev/mapper/crypt1



        1. Resize the filesystem.

        sudo e2fsck -f /dev/mapper/hardy-root
        sudo resize2fs -p /dev/mapper/hardy-root






        share|improve this answer














        I was able to enlarge the partition using the method outlined in this forum post.



        I'll repost it here in case that post is taken down. Side note: I did not do steps 1 - 3, because I had already managed to enlarge the partition in Gparted.



        1. Boot a live CD and, using any tool, create a new partition, lets call it /dev/sda6 , next to and to the left of (after) your crypt.


        2. Write random data to the new partition.


        Make sure you have the correct partition for this command or you will overwrite your crypt.



        sudo dd if=/dev/urandom of=/dev/sda6



        You can run that command as many times as your paranoia requires.



        1. Use fdisk as above to delete and then re-create a larger crypt partition.


        2. Reboot to the live CD.


        3. Install lvm2 and cryptsetup.


        sudo apt-get update && sudo apt-get install lvm2 cryptsetup



        1. Load the cryptsetup module.

        sudo modprobe dm-crypt



        1. Decrypt your file system.

        sudo cryptsetup luksOpen /dev/sda5 crypt1



        1. Get the live CD to recognize (activate) your LVM.

        sudo vgscan --mknodes
        sudo vgchange -ay



        1. Resize the Crypt.

        sudo cryptsetup resize crypt1



        1. Resize the (LVM) Physical volume.

        sudo pvresize /dev/mapper/crypt1



        1. Resize your root (LVM) Logical Volume.

        Unlock the physical volume.



        sudo pvchange -x y /dev/mapper/crypt1



        Resize your root (LVM) Logical Volume.



        lvresize -L +4G /dev/hardy/root



        Note: Change the +4G to the amount of space you are adding.



        Re-lock the (LVM) Physical Volume.



        sudo pvchange -x n /dev/mapper/crypt1



        1. Resize the filesystem.

        sudo e2fsck -f /dev/mapper/hardy-root
        sudo resize2fs -p /dev/mapper/hardy-root







        share|improve this answer













        share|improve this answer




        share|improve this answer










        answered Oct 4 at 12:52









        FlobinFlobin

        1013 bronze badges




        1013 bronze badges































            draft saved

            draft discarded















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177700%2fhow-to-add-unallocated-space-to-encrypted-partition-using-gparted%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown









            Popular posts from this blog

            Tamil (spriik) Luke uk diar | Nawigatjuun

            Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

            Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?