Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to move my /home directory following the steps described in

https://help.ubuntu.com/community/Partitioning/Home/Moving

Everything works fine until I reach the point where I have to move /home to /old_home. When I issue the commands:

cd / && sudo mv /home /old_home && sudo mkdir /home

I get the error message:

mv: cannot move /home' to/old_home': Device or resource busy

when I issue the command I am running a terminal and a browser. Should I log out and re-enter as root to issue the command?

Thank you !

JEV

share|improve this question

1 Answer 1

Should I log out and re-enter as root to issue the command?

Yes! Moving your /home while you're logged in is a very bad idea. Files are still open here.

  1. Log out.

  2. Go to a virtual terminal by pressing Ctrl+Alt+F1

  3. Log in using the command line.

  4. Use sudo su - to become completely root, including the environment variables.

  5. Check if no file is still open on /home and only continue if nothing's open:

    lsof -n | grep \/home\/
    
  6. Perform the actions.

  7. Go back to your graphical VT: Ctrl+Alt+F7

  8. Log back in.

Alternatively, run this in recovery mode to be very sure no file to a user is open:


I get the error message:

mv: cannot move /home' to/old_home': Device or resource busy

This is probably because not only files are open there, but also file systems are mounted by you in your /home/username/.gvfs/ somewhere. Logging out should unmount them. If not, inspect the current mounts with cat /proc/mounts.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.