Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 HDD drives in my computer. At the moment second drive is mounted as /media/storage.

How can I move my user data from /home to /media/storage/home?

Can I just move the data over there and then simply symlink it back?

share|improve this question
up vote 18 down vote accepted

If you want to just move your home directory i.e /home/your-username then simply copy your home directory to other partition and then use System->Administration->Users & Groups to open user settings dialog. Click on the keys icon to authenticate your self

alt text

After that select the user that you want to change and click properties, go to advanced tab

alt text

change the home directory to new directory i.e the directory that you copied to other partition.

share|improve this answer
    
awesome. thanks – Stann Jan 13 '11 at 7:23
2  
Indeed. it is a great way to easily change the home directory location of a specific user. While reading the question, I was understanding that this would have been for the /home directory globally. In this case, you could create the partition on the other device, manually move all files there and then change the device for the mount point in /etc/fstab file itself. – jfmessier Jan 13 '11 at 13:09
1  
@jfmessier: you should make that an answer rather than a comment! – Skizz Jan 13 '11 at 15:19
1  
If you're copying your home directory with 'cp' on the command line, you'd better use 'cp -rPa *' : r for recursive, P for not following links, a for preserving ownership and permission flags. – drevicko Feb 28 '12 at 11:20
1  
Unity in 13.04 has no "Users & Groups", just a "Users" setting that does not include these options. Can you mention the corresponding terms for Unity in 13.04? – Torben Gundtofte-Bruun Aug 8 '13 at 21:57

Moving HOME from command line

To avoid side effects while working in a graphical, environment we should perform all actions to move HOME from a terminal with Ctrl+Alt+F1.

Temporarily mount the new partition:

sudo mkdir /mnt/tmp
sudo mount /dev/sdb1 /mnt/tmp

assuming /sdb1 is the new partition for HOME

Copy HOME to the new location:

sudo rsync -avx /home/ /mnt/tmp

We then may mount the new partition as HOME with

sudo mount /dev/sdb1 /home

to make sure all data are present. Easiest is to delete the old /home at this point (you could do this later but then you will have to boot a live system to see the old home):

sudo umount /home  #unmount the new home first!
rm -rf /home/*  #deletes the old home

Make HOME permanent

We need to know the UUID of the new partition for the fstab entry seen from:

sudo blkid

Note or copy/paste the correct UUID to edit your fstab with

sudo nano /etc/fstab   #or any other editor

and add the following line at the end:

UUID=<noted number from above>    /home    ext4    defaults   0  2

Take care to choose the appropriate filesystem here, e.g. ext3 if ext3 formatted

Reboot

After a reboot, your /home resides on the new drive having plenty of space.

share|improve this answer
1  
Did not work for me. – corev Sep 27 '11 at 2:30
1  
I recommend logging out of the profile you want to move, you then can also use the distribution tools like usermod for this task. – LiveWireBT Feb 10 '13 at 10:39
    
It worked! Thanks. Can I remove /mnt/tmp after reboot? – e9t Sep 13 '15 at 6:39
    
@e9t: it is only a mount point we had created to be able to temporarily mount our HOME. It is possible to remove this mount point but it will do no harm (and may be safer) to just keep it. If for any reason you still want to remove it please take extra care to not have anything mounted there (otherwise you risk to irreversibly delete all data you had mounted to /mnt/tmp). – Takkat Sep 13 '15 at 6:57

Indeed. it is a great way to easily change the home directory location of a specific user. While reading the question, I was understanding that this would have been for the /home directory globally. In this case, you could create the partition on the other device, manually move all files there and then change the device for the mount point in /etc/fstab file itself

share|improve this answer

The official. detailed procedure here:

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

share|improve this answer
6  
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Eliah Kagan Jan 6 '13 at 0:51

ok, the only way I found this would work is to create another user, give it admin authority, logoff the main id, logon with the new id and then use usermod command.

share|improve this answer

@binW

To do this through /etc/fstab add this line:

/<new home directory> /home/<user> none bind 0 0
share|improve this answer
    
Welcome to Ask Ubuntu! ;-) We're very sorry, but there is a reason why new users cannot comment everywhere: get to know the site, take the tour, review the editing help, read some questions and answers and if you see a problem you've encountered before and know the answer to, go for it! – Fabby Feb 22 '15 at 22:11
    
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – David Foerster Feb 22 '15 at 22:30
    
@Fabby I feel I am failing to see where this is not an answer.. Did I miss something? – Seth Feb 24 '15 at 4:27
    
@Seth: the OP asked to move his home directory. This just creates the false impression that it was moved... It's just a bind that leaves everything where it is. – Fabby Feb 24 '15 at 4:58

protected by Community Jul 18 at 1:00

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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