Ask Your Question

Trying to move /home to a new partition

asked 2015-09-27 22:11:40 -0500

bbycakes3 gravatar image

My home directory is in /dev/sda1, and I'm trying to move it to /dev/sdb1. I'm not really sure how to use the mv command to go about this.

I'm running Fedora 22 if that helps.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-09-28 04:11:04 -0500

masteroman gravatar image

Or you can also try steps described in this question. :-)

edit flag offensive delete link more

answered 2015-09-28 00:25:58 -0500

hmaarrfk gravatar image

First backup your files.

The gnome "Disks" utility is your friend here:

  1. Create a new linux partition on your new hard drive (Ext4 or something like that)
  2. Create a new partition in your root filesystem like /newhome

    sudo mkdir /newhome

  3. Let it automount with the following settings but change the Mount point to /newhome,HomeMountSettings

  4. Reboot, and make sure that the new partition is mounted in /newhome . There should be a "lost+found" file if you look at the hidden folders (Ctrl+H in Nautilus).
  5. Logout of all users that use the /home directory on your system.
  6. Use a different TTY to log in with root (using the shell). CTRL+ALT+3 should give you a login shell
  7. Log in with root.
  8. Now move the files

    cd /home

    mv -v * /newhome/.

-v allows you to see things spewing on the output, to give you piece of mind that things are actually getting moved. 9. Now your home directory should be empty. Make sure with

ls -lah /home
  1. Unmount newhome

    umount /newhome

  2. Now edit /etc/fstab to make newhome mount in the home directory

    nano /etc/fstab

  3. Mount the new home partition

    mount /home

  4. Check that your files are there

    ls -lah /home

  5. Success. Logout of the root shell. Log in to your graphical interface with CTRL+ALT+F1 enjoy having a new home partition

edit flag offensive delete link more


I've tried other methods while still logging in as a user not root, after I rebooted and entered the password, it couldn't login and the login screen appeared again. This method works for me, I guess cp/mv/rsync cannot really copy everything from a user's home dir while that user is logged in.

phuhnguyen gravatar imagephuhnguyen ( 2019-03-26 17:51:30 -0500 )edit

Question Tools


Asked: 2015-09-27 22:11:40 -0500

Seen: 3,160 times

Last updated: Sep 28 '15