mv: cannot move `/home' to `/old_home': Device or resource busy
I maybe a little late but I hope my solution will help someone who comes here now. I think the author of https://help.ubuntu.com/community/Partitioning/Home/Moving forgot to mention that the step Moving /home into /old_home
will work only if /home is NOT IN ITS OWN PARTITION. mv /home /old_home
will work if home
is just another folder. Not if /home
has its own partition.
If /home
has its own partition, then your command mv /home /old_home
will never work because fstab will mount that partition on boot and hence the error you are getting.
If you have /home
as a separate partition, I would suggest ignoring this step. You dont need a backup because when you move to your newer, bigger home partition your old /home
partition will just sit there unmounted. Once you are satisfied with your newer home partition, you can format it and reuse the space.
So bottomline is if you have /home
in its own partition and you followed the steps mentioned in the link above all you have to do is comment out the older home partition in fstab. Otherwise your newer home partition will never be mounted.
That's it. Hope it helps someone.
Thanks.
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.
Log out.
Go to a virtual terminal by pressing Ctrl+Alt+F1
Log in using the command line.
Use
sudo -i
to become completely root, including the environment variables.-
Check if no file is still open on
/home
and only continue if nothing's open:lsof -n | grep '/home/'
Perform the actions.
Go back to your graphical VT: Ctrl+Alt+F7
Log back in.
Alternatively, run this in recovery mode to be very sure no file to a user is open:
- How do I boot into single-user mode from GRUB?
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
.