HowTo: Use Separate Partitions for the Users' Data [i.e. /home] and the Root Filesystem
Many new Linux users perform their first installations on a single partition. Then after a time they realise that greater security is achieved by moving the user directories under /home across to a separate partiton. There are many ways to achieve this transition. The one used here is structured for the convenience of new users.
THE SHORT VERSION
THE LONG VERSION
Runlevel 1 as root, with X Window system: First you switch to a state where you have the minimum of services running, you have root authority to carry out the modifications and you have the X windows system so you can use the normal GUI tools. Reboot the computer and log on as root. Then open a terminal and issue the init 1 command by entering the following in a console:
X Windows will be replaced by a full-screen console. You will be presented with a login prompt lie so:
Ignore it. It's spurious and will just confuse the issue if you respond. You wait for an invitation to enter root's password, like so:
It may take some time, up to a minute, before the password invitation for root appears. Once you are logged in, enter the command startx to activate the X Windows system and enable the graphic interface.:
Store the old /home data: You can now disassociate the old /home from the filesystem to make way for the new /home partition by renaming the old /home directory to /oldhome. Open a console and issue this re-naming command:
Create the new /home: Open Yast partitioner --> System --> Partitioner and create your new partition. Make sure to add the mount point /home as in the screenshot.
Copy the stored user data to the new /home directory: When you exit Yast Partitioner the new /home partition will be mounted in the filesystem. The scene is set for adding the user data to the new /home. Simply open a console and issue the copy command with the -R option set and with option -p set to preserve file and directory ownership. Here's the console command:
FYI: The archive switch, -a, is the same as switches -dpPR. It preserves permissions, ownership and time stamps and also copies links but does not follow symbolic links.
Job done: simply reboot when the copy command has finished and log in as a normal user to return to normal operations. There is a backup copy of the user data in directory /oldhome which you should keep for a time, as a precaution.
Credits: thanks to hcvv and ken_yap for discussion & clarification