Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I installed Natty (11.04) I chose to encrypt /home and I chose to mount it on a separate partition. I would like to repartition /home without losing data and by having the same sort of encryption after the repartitioning is done.

I guess that this would mean to do the following:

  • Temporarily storing the data I want to keep somewhere else.
  • Repartitioning.
  • Putting the data pack on the partition.
  • Activation of encryption.

Or maybe I can clone the data on the partition so that I can skip the last point? How should I proceed? I would appreciate detailed instructions for every step in the process.

Here's the output from mount:

/dev/sdc1 on / type ext4 (rw,noatime,errors=remount-ro,discard,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
/dev/sdb1 on /var type ext4 (rw,commit=0)
/dev/sda2 on /home type ext4 (rw,commit=0)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
/home/username/.Private on /home/username type ecryptfs (ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs,ecryptfs_sig=9095a85defbbd74d,ecryptfs_fnek_sig=ac460d25b6a798e1)
gvfs-fuse-daemon on /media/ssd-store/home/username/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=username)
share|improve this question
    
Are you using eCryptFS (per-user encryption) or a fully encrypted partition? eCryptFS would come from a question that is similar to "Do you want to encrypt your home directory?" whereas encrypted partitions would be more of a manual process. –  David Jul 15 '11 at 19:11
    
Also, providing the output of "mount" run in a Terminal would help us to see your current setup. (And does not generally expose sensitive information.) –  David Jul 15 '11 at 19:11
    
@David I'm using the encryption that you get if you check a checkbox during the installation that says something like "Encrypt /home". –  N.N. Jul 15 '11 at 19:23
    
@David I've added the output from mount. –  N.N. Jul 21 '11 at 11:06

1 Answer 1

(This answer is targeted only at those using eCryptFS-based encryption, as the original author has indicated.)

In this case, you'll want to do the following: 1. Back up your data. (Always a good idea.) 2. Boot from a LiveCD with GNU parted. (I believe the Ubuntu CD has this. GParted is a Gnome front-end that makes this easy.) 3. Have Parted resize the partition.

Because you're using eCryptFS, you can just resize the underlying partition and filesystem without any interference to the encryption layer.

share|improve this answer
    
The file .ecryptfs is in the root of the partition I want to repartition. I want to repartition as in deleting the partition and making a new and put back the data. –  N.N. Jul 15 '11 at 19:36
    
In which case you will have to pull your data to another harddrive or usb key or last option is to burn your data to cd or dvd then delete your partion and Reinstall. –  freebird Jul 16 '11 at 15:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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