0

I am running into an issue moving my /home folder from my SSD to an external HDD. I have a dual boot of linux and windows on the SSD and I am running out of space, so I want to move the /home partition to the external drive.

I am following this guide: https://www.maketecheasier.com/move-home-folder-ubuntu/

I have followed the first few steps:

  1. Created a temp home folder at /media/home and on fstab I gave it the UUID of the external partition. This worked fine, I can see this folder with the right size.

  2. I used rsync to copy all the files from /home to /media/home

I run into an issue at this point, I am not able to relocate my /home directory into /home_backup. It tells me that the device or resource is busy. So I looked it up and came to this similar question:

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

Now, reading the first answer and it says that if your /home is it's own partition (which is the case for me) you should ignore that step and comment out the current home paritition in fstab, or the new one will never be mounted.

Is this correct? the next answer says to log out and go on a virtual terminal, run as sudo -i and check lsof -n | grep '/home' to make sure that nothing is open. In my case it lists bash and sudo.

Maybe I'm being too careful, but I need the computer working for university and can't be slowed down by bricking my laptop. Can someone clear up what the right process is? I don't see how I can just mount my new partition at /home, and comment out the currnet partition in fstab while I am actively in the current partition. Especially if what I tried above tells me that sudo and bash are running out of the current /home/username.

Don't know if that makes sense, but hopefully someone can clear this up for me.

2 Answers2

0

Here is a possibility.

Create a bootable Linux thumb drive. Here is an article https://www.cnet.com/how-to/what-to-do-with-your-usb-flash-drive-run-linux/

Boot from the thumb drive.

Mount the hard drive under media.

Use "sudo su" to become root.

You should now be able to rename the /home directory.

Shutdown and reboot from your hard disk.

If you set up your fstab correctly it should work.

If not, you may have difficulty logging in because there is no /home available.

In that unfortunate case you need to go back through the procedure and undo the rename.

You might consider a second option.

If your disk usage under /home is all down one or two directories, you might leave home in place and instead put in links to copies of those directories.

This leaves other user names in place and may be easier to trouble shoot.

Mike G.

0

Do Mike's answer with one more step... after the mv create an empty /home. The guide says to do it too. I think it's needed for the mount to work.

(I would have commented on Mike's answer but I don't have the reputation to do it)

Sandio
  • 11