In the process of using Linux OS, over time, it becomes necessary to transfer the home directory of system users to another medium or disk. Such a need may arise due to a lack of used disk space or other user changes. Linux has a sufficient number of commands and capabilities to carry out this operation without causing any special problems and breaking the whole system structure.
Instructions
Step 1
First, boot from the LiveCD of the operating system. It doesn't really matter which disk distribution you choose, but if you are using Ubuntu on your computer, it is advisable to boot from the Ubuntu LiveCD.
Step 2
Start the Terminal ("Menu" - "Programs" - "Accessories" - "Terminal") and mount the root partition. To do this, enter the command:
mount / / mnt / partition
Mount a backup partition in the same way. After that, copy the home directory to the newly created section:
cp –R / mnt / partition / home / / mnt / backup / backup_home
Step 3
After that, unmount the backup partition using the unmount command:
unmount / mnt / backup /
Mount the partition you want to transfer and clean it up with cfdisk or mkfs (format can be produced):
mount / mnt / targert
Step 4
Copy / home to the newly created partition using the cp function. For example:
cp / mnt / partition / home / / mnt / targert / home
Step 5
Next, delete all content in the mount point / mnt / partition / home. To do this, just use the rm function. For example:
rm / mnt / partition / home
Step 6
Then open the file / mnt / partition / etc / fstab and change the mount point of the / home folder to the used one or add a new line in the corresponding block.
Step 7
Reboot and make sure the directory is correctly mounted. If you cannot get access to the / home directory, then edit the files / etc / mtab and / etc / fstab.