Which is the best way in order to resize an encrypted (ecryptfs) ext4 home partition ?

Pros nad Cons of each method are greatly appreciated.

$ fdisk -l
Disk /dev/sda: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    41945714    20972826    7  HPFS/NTFS/exFAT
/dev/sda2       207007744   211206554     2099405+  82  Linux swap / Solaris
/dev/sda3        42946560    82008063    19530752   83  Linux
/dev/sda4        82008064   207007743    62499840   83  Linux

Boot Ubuntu from the LiveCD (or a USB-key) and run gparted. In the top-right you can select your harddisk. When it is selected you can just right-click on the partition and chose resize.

eCryptfs encrypts single files and not the whole partition. So can safely resize the partition as you like. Remember that you should have backups of your things!

  • Are you sure? Resizing an encrypted partition is somewhat complicated. GUI tools such as Gparted see the LUKS container or crypt as unpartitioned space and thus resizing encrypted partitions must be performed entirely from the command line Source – pl1nk Aug 9 '12 at 19:19
  • Yes, I'm sure. As I stated, ecryptfs ist not an encrypted container, but a file-based encryption. – mniess Aug 9 '12 at 20:07
  • By this I assume that eCryptfs and LUKS are two different methods of encryption, and that Ubuntu uses eCryptfs by default? – Jacques MALAPRADE Jan 12 '15 at 11:27
  • If you chose to only encrypt your HOME, ecryptfs will be used. If you chose the new whole disk encryption option in the installer, LUKS will be used (and resizing becomes A LOT more difficult). – mniess Jan 13 '15 at 12:38

eCryptfs doesn't have on-disk partitions. To be safe, be sure that you've unmounted your eCryptfs-encrypted home directory and then follow the usual steps to resize the ext4 filesystem.

  • 1
    Which are the "usual steps to resize the ext4 filesystem" ? – pl1nk Jul 22 '12 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.