I don't have separate /home partition, and running out of space, so i want to move it to another drive, and make this /home partition.
Is enough to perform "mv -r * new partition", and then mount a new partition as /home, or it's a more than this?


Code: Select all
touch /mnt/newhome/newhome
yes, will try it, thanksNeddySeagoon wrote:leonchik1976,
It takes a bit of care because /home must not be in use. Any open files will not be copied correctly.
To make sure home is not in use log in as root directly. Logging in as a normal user requires /home to be in use.
To be safe issue the sync command then remount /home as read only. If that fails, there are files open on home.
Mount the replacement home somewhere, say /mnt/newhome
cp -a the old to the new.
You can't use mv with /home being ro.
To keep your sanity,so you can tell the two different /homes apart.Code: Select all
touch /mnt/newhome/newhome
unmount /mnt/newhome anh mount it over the top of the existing home.
Log is as a normal user and you should have a /home/newhome file.
If everything works, update /etc/fstab then reboot to test. /home/newhome should still be there.
Run like that for a few days, then you can delete the content of the old /home.
Before you issue the rm command do check that newhome is missing.
If you use mv directly and it fails for any reason, it leaves you in a mess.
The above process is safer because its non destructive until the result is tested.
You have backups anyway, don't you?