Before you start, it would be best to back up everything from /home. Always back up!
--- update: as bigrigdriver pointed out, using a liveCD is a better idea. Then, as Dinithion notes, you could mount the volume currently containing /home read-only. ---
You'll need to be logged in as root. If that's not possible, you can become root on many systems using: sudo -i
First, make sure that no one is using /home: no users logged in other than you. You can check to see if any files are open on /home using:
lsof | grep /home
Since you already have the new disk mounted, copy the home stuff there, using:
cp -rp /home/* /mnt/sdb1
(The r means recursive, the p means keep permissions)
Once it's all copied, you can rename the old /home directory to something else:
mv /home /was_home
(This is for safety's sake. If something goes wrong you can restore everything -)
Make the new /home mount point:
Unmount the drive that will be home:
Change the line in fstab to:
/dev/sdb1 /home ext3 defaults 2 1
Finally, mount the new /home:
While still logged in as root, try to log in as a user and make sure that user's home directory copied. Once you're sure everything has copied, you can remove the old (saved) home directory:
rm -rf /was_home
I've checked this three times, so it should be fairly accurate. Of course, I can't come and fix it if it fails, so use at your own risk.
Hope that helps!
Last edited by stureedy; 07-13-2009 at 07:14 AM.
Reason: better ideas from others