I have a special requirement, where I need to rollback the encrypted drive (using ecryptfs) to un-encrypted with its contents untouched. For this task, I am following below steps.

  1. Take backup of my encrypted drive contents (say /home mounted to /dev/sda3) to temporary .tgz file stored on a temporary unencrypted drive in my system.
  2. Unmount my encrypted folder /home
  3. Delete /home and recreate new /home
  4. Format my /dev/sda3 with ext3
  5. Mount /dev/sda2 to /home
  6. Unzip all .tgz contents to /home

After step-6, I see garbage filenames in my /home folder. When I checked .tgz file, it contains garbage files in it. Any reason why these garbage files are gathered in step-1 above. Anyway to avoid this. Please suggest.

If you need additional information please let me know.

Below are sample garbage file names displayed


Note : I am using ecryptfs_fnek_sig while mounting ecryptfs folder to encrypt my filenames

  • FYI, those are not "garbage file names", they're clearly eCryptfs filenames - the ECRYPTFS_FNEK_ENCRYPTED. at the start is a little bit of a hint. Garbage names would be something like completely random non-ASCII characters and such. – Xen2050 Oct 22 '16 at 13:17

I was able to overcome this issue by clearing all contents of my /home directory after taking backup of it.

rm -rf /home/*
rm -rf /home.* 2>/dev/null

I did this as a part of step 2 above. From debug information, I came to know that step 2 was failing with error rm failed because of "directory not empty". Once after deleting its contents with above commands, I was able to delete it and recreate a new one. From there on, I dont see above error.

| improve this answer | |

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.