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?
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?
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:
assuming /sdb1 is the new partition for HOME
Copy HOME to the new location:
We then may mount the new partition as HOME with
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):Make HOME permanent
We need to know the UUID of the new partition for the
fstab
entry seen from:Note or copy/paste the correct UUID to edit your
fstab
withand add the following line at the end:
Take care to choose the appropriate filesystem here, e.g.
ext3
if ext3 formattedReboot
After a reboot, your
/home
resides on the new drive having plenty of space.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
After that select the user that you want to change and click properties, go to advanced tab
change the home directory to new directory i.e the directory that you copied to other partition.
The official detailed procedure is here on the Ubuntu help wiki
Find the UUID of the Partition
Set up Fstab
and add these lines into it
and replace the
????????
with the UUID number of the intended/home
partition.Save and close the
fstab
file, then type the following command:Copy
/home
to the new partitionCheck copying worked
Note: You can also expect to see some errors about files not found. These are due to symbolic links that point to places that don't presently exist (but will do after you have rebooted). You can ignore these - but check out anything else.
Preparing fstab for the switch
and now edit the lines you added earlier, changing the
/media/home
part to simply say/home
so that it looks like this:Moving
/home
into/old_home
Reboot or Remount all
Reboot or remount all with this:
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
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.
Task:
Related links:
Format disks
Plugin all necessary SATA and power cables to your HDDs. Load Ubuntu. Press keyboard and type "Disks". "Disks" utility will be opened:
In this utility you could format your HDDs into Ext4 file system. Otherwise to format disks use commands:
For example, but I'm not sure with parameters because used GUI "Disks":
Keep in mind, that formatting will delete everything on target hard disk. You can skip this step if there are any data on the hard disk and you want to not lose it.
Slow formatting should take a lot of time: from 16 up to 20 hours for 4TB disk.
Permanently mount disks
Moving HOME from command line