Move Encrypted Home Directory to New Partition

In this article I will show you how to move an encrypted home directory to another partition.

This method will keep the data in the home directory encrypted, but will move it on the new partition.

First, close all the running applications, in order not to have some files updated during the copy.

This is how you copy the encrypted data to the new partition:

$ ecryptfs-umount-private
$ chown $USER /new_mount_point/$USER
$ rsync -avP $HOME/.Private $HOME/.ecryptfs /new_mount_point/$USER
$ vim /etc/passwd # Change the user's home directory to point to the new location

  • replace $USER with your user name.
  • replace $HOME with your homedirectory and $USER with your username.

And now Log off and Log back in.

Explanation: this rsync command moves your ~/.Private and your keys from ~/.ecryptfs.

Tagged with: , , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!