I was about to use the encryptfs procedure to migrate my existing home folder and discovered that the process needs 2.5x the size of home to complete. I have 258GB in my home, but only 430GB free. Is there a way that I can encrypt home without reinstalling?
-
yes, but you need to temporarily store some of the home data to another partition and then encrypt the home partition (which is less used). However, you should maybe also think about not encrypting the whole home directory, but only important private data.– Michael KJan 13, 2012 at 13:55
-
What happens if I move "documents," then encrypt, then copy documents back after encryption? will this work?– KendorJan 14, 2012 at 1:26
-
yes of course, it is as if you would store new data on your home drive.– Michael KJan 16, 2012 at 7:07
1 Answer
Full disclosure here, I'm the co-author and maintainer of the ecryptfs-migrate-home utility.
Note that the 2.5x multiplier is perhaps an aggressive overestimation of the required disk space, but I've published that recommendation as a safety precaution
To answer your question, yes, it is possible, though perhaps slightly risky, and not generally recommended.
You could accomplish this by editing the shell script, /usr/bin/ecryptfs-migrate-home
, and modify the line that looks like this:
rsync -aP "$orig/" "$USER_HOME/" 1>&2
to:
mv -vf "$orig/"* "$orig/".* "$USER_HOME/" 1>&2
This will move files in place, instead of copying them.
-
This is perfect. I did a backup to an external drive previously, so I'm not worried about it breaking things. Oct 28, 2015 at 20:02
-
Hey Dustin, I've modified the line as you suggested and I've also "neutralized" the check for the 2.5x free space, but it doesn't work. The encryption process actually starts, but for some reason the files are not moved in place. They rather seem to be copied, and the original file is not deleted afterwards (I checked this). In fact, after about 30 seconds the process has started, the system runs out of space. Do you have any idea how to fix that? (of course I'm running encryptfs-migrate-home as root with
sudo su
)– korg91Mar 2, 2017 at 11:33 -
/usr/bin/encryptfs-migrate-home
is not a shell script on my machine, it is a binary.– naraghiDec 28, 2022 at 16:21