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 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

6 Answers 6

up vote 13 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
1  
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/dsb1 /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
    
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

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

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

The official. detailed procedure here:

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

share|improve this answer
4  
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

I used Ubuntu Tweak.

http://ubuntu-tweak.com/

It drives me a bit crazy that little things like this either need to be recoded in terminal or require programs to be loaded onto my PC.

It could easily be seen as the kind of thing that is holding Linux back from the mainstream.

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.