2

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

ECRYPTFS_FNEK_ENCRYPTED.FWYHu94wM71d5EQDu3OhIS0WQ49MjHMLwGT5D6ewucAr45Lpz.Up5pFON---
ECRYPTFS_FNEK_ENCRYPTED.FWYHu94wM71d5EQDu3OhIS0WQ49MjHMLwGT5J0oMSIHm6ODyTJAEnMuyPU--
ECRYPTFS_FNEK_ENCRYPTED.FWYHu94wM71d5EQDu3OhIS0WQ49MjHMLwGT5Ls7skHy0SI306pYhYDdVPE--
ECRYPTFS_FNEK_ENCRYPTED.FWYHu94wM71d5EQDu3OhIS0WQ49MjHMLwGT5N4O7SgxwwIAheJRFBWjR.---
ECRYPTFS_FNEK_ENCRYPTED.FWYHu94wM71d5EQDu3OhIS0WQ49MjHMLwGT5RD18uy.MohdmQEtKhCzKbk--
ECRYPTFS_FNEK_ENCRYPTED.FWYHu94wM71d5EQDu3OhIS0WQ49MjHMLwGT5aPjD6ZKeV9A4zCj9lKR9OU--
ECRYPTFS_FNEK_ENCRYPTED.FWYHu94wM71d5EQDu3OhIS0WQ49MjHMLwGT5bk9rL114fhD.VUoP36.2Ek--
ECRYPTFS_FNEK_ENCRYPTED.FWYHu94wM71d5EQDu3OhIS0WQ49MjHMLwGT5brAUbYyvXXPQY.HJb4Zv1k--

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
0

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.

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.