Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 41

Thread: How to: Resize an Encrypted Partition (LUKS)

  1. #11
    Join Date
    Dec 2007
    Beans
    8

    Re: How to: Resize an Encrypted Partition (LUKS)

    thx for the guide but I have a small question:

    I made a single error, my swap is too big. I thought I could just unmount the swap while being logged into the swap and resize it. Unfortunately I can't seem to unmount it

    I tried swapoff -a which should unmount all swaps but when I want to resize I am told that it is in use

    any hints please?

    after resizing the swap, I'd like to increase/reyize the / root partition, will this work while using the system or do I again need to boot from CD?

  2. #12
    Join Date
    Dec 2007
    Beans
    8

    Re: How to: Resize an Encrypted Partition (LUKS)

    ok, I brute-forced the swap to be resized. I was warned that data might be lost, but I didn't care about the swap

    what about resizing the / partition now using the free space I saved by resizing the swap partition?

    can I stop the GDM, unmount the root "umount / " then use "lvextend -L+15G /dev/titan/titan-root" "e2fsck -f /dev/titan/titan-root" and "mount /" to do this?

  3. #13
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How to: Resize an Encrypted Partition (LUKS)

    Are you running from a live CD ? It does not sound as if you are.

    Why do you need to stop GDM ?

    Otherwise this how to gives detailed step-by-step instructions on how to resize and those command are part, but not all, of what needs to be done.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  4. #14
    Join Date
    Dec 2007
    Beans
    8

    Re: How to: Resize an Encrypted Partition (LUKS)

    sorry for not being specific enough, what I wanted to know is if there is a way to resize my root partition inside a lvm group which now has enough free space because I resized my swap partition, while residing inside an encrypted partition, from within the live system

  5. #15
    Join Date
    Mar 2008
    Location
    Cardiff, UK
    Beans
    425
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to: Resize an Encrypted Partition (LUKS)

    I'm trying to enlarge an encrypted LVM to the left. Right now it's all the way to the right, so I can't expand it in that direction any longer.

    Right now, I'm stuck at this step:
    3. Use fdisk as above to delete and then re-create a larger crypt partition.
    As I understand it, I'm supposed to use fdisk to delete the old partition location and recreate it with a larger size. However, I've read here that you can only resize LVMs by expanding them to the right, based on this:
    WARNING: Make sure the old and new partition start at the same cylinder position, not doing so will destroy your data.
    So what can I do? How do I resize an LVM partition to the left using fdisk?

  6. #16
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How to: Resize an Encrypted Partition (LUKS)

    Quote Originally Posted by Flimm View Post
    I'm trying to enlarge an encrypted LVM to the left. Right now it's all the way to the right, so I can't expand it in that direction any longer.

    Right now, I'm stuck at this step:


    As I understand it, I'm supposed to use fdisk to delete the old partition location and recreate it with a larger size. However, I've read here that you can only resize LVMs by expanding them to the right, based on this:


    So what can I do? How do I resize an LVM partition to the left using fdisk?
    That I know of you can not do that. Gparted does not handle LVM either so most likely you are looking at backing up your data, deleting the LVM, make a new larger LVM / Crypt, restore your data.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  7. #17
    Join Date
    Mar 2008
    Location
    Cardiff, UK
    Beans
    425
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to: Resize an Encrypted Partition (LUKS)

    What about extending the volume group by adding physical volumes to it to the left? That's what linux.com seems to recommend:
    But what happens when your logical volume has taken up all the space in your volume group? You can add more physical volumes to an existing volume group, and then increase the size of your logical volume as discussed already.

    First, unmount the logical volumes within your volume group. Assuming you already have physical volumes available, you can use the command vgextend home2 /dev/sda5 /dev/sda7 to add the physical volumes sda5 and sda7 to the existing volume group home2. The volume group home2 is now made up of sda3, sda5, and sda7
    I'm not sure how encryption fits in though.

  8. #18
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How to: Resize an Encrypted Partition (LUKS)

    In theory you could do that.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  9. #19
    Join Date
    Mar 2006
    Beans
    12

    Re: How to: Resize an Encrypted Partition (LUKS)

    Hi, I had a problem extending the LUKS partition.

    * 64GB SSD -> 128GB SSD
    * Recreated partitions on new SSD, made the LUKS partition fill the rest of the available space before the extended partition and boot partition at the end of the device
    * used dd to copy the contents of the original disk partitions to the new partitions
    * Used blockdev --getsize to find the number of sectors in the LUKS partition
    * cryptsetup luksOpen /dev/sda1 sda1_crypt
    * cryptsetup resize sda1_crypt --size NEWNUMBEROFSECTORS

    Now, cryptsetup status shows the LUKS volume as having a size just a bit smaller than the new number of sectors I provided. However, pvresize does not do anything but exit 0. The PV is not resized. Any ideas what I'm doing wrong?

  10. #20
    Join Date
    Jan 2009
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to: Resize an Encrypted Partition (LUKS)

    Thanks for the tutorial. Will this work in Lucid? I see "hardy" in the shrinking section. Thanks.

Page 2 of 5 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •