Tech Journal - .Deleting Encrypts. files accidently remove $HOME in Linux mint

Created on: 18 May 24 10:05 +0700 by Son Nguyen Hoang in English

Why it happened? And how to solve?

Thumbnail 1

Let’s say that you realized that 150GB of your hard drive had been used up in some sort of .encryptf files of your Linux Machine. This is already too much. You read article about this from to make sure that the file can be deleted safely.

As it said below

3.2 Removal of encryption There are no special steps involved, if you want to remove your private directory. Make sure it is un-mounted and delete the respective lower directory (e.g. ~/.Private/), along with all the encrypted files. After also removing the related encryption signatures and configuration in ~/.ecryptfs/, all is gone. If you were using the #Ubuntu tools to setup a single directory encryption, you can directly follow the steps detailed by: $ ecryptfs-setup-private –undo and follow the instructions.

I assumed the heavy files can be removed without any consequence. So you remove .encryptfs and .Private/, also it seem like a also deleted home/.encryptds/$USER/. So here go the whole files in home/$USER folder. Thus, the next time I restart and login, the desktop environment cannot be loaded.

How to solve this? I followed steps:

  • Create new user (using sudo adduser)
  • Copy all files from /home/newuser to the /home/original_user
  • Change owner of new files (in /home/original_user to original_user by using chown -R)
  • Delete .Xauthority file (copied from /newuser)
  • Done! Login again to see the result. Of course, the whole data in old home/original_user had been wiped out but now you can go to Desktop again.
Back To Top