Ubuntu: moved /home folder into subfolder of /root, when logged as root



Question:

I did a mistake, I was logged as root and I moved the home folder accidentally. I don't have a GUI as I am running on a Openstack virtual machine setup by someone else. I can't boot from a LiveUSB and move it back.

Here is what it looks like

  • ....
    • (here there should be home)
    • root
      • mydirectoryname (this used to be the homefolder)
        • mydirectoryname (it has the same name as its parent. I don't care if i loose what is inside)
        • Ubuntu

Please, help me get things as this again:

  • ....
    • home
      • Ubuntu
    • root

Which command should I execute ? Thank you for your help !!


Solution:1

Run

mv /root/mydirectoryname /home  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »