SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Once you have created a partition and filesystem. Mount the new partition and copy all your data. Unmount the old partition or move the /home folder if it is on the root partition. Then mount the new partition as /home. Then all you need to do is update fstab to mount the new home on boot.
Copying the files like that will change their owner and group to whatever user copied them (probably root). What you want to do is move them but I don't know if the standard move command will move directory trees. You could use midnight commander but failing that, I suggest you tar the entire directory, delete the old files, mount the new partition as /home, and untar the entire directory using the -p switch to preserve the permissions:
tar jcvf /tmp/home.tar.bz2 .
rm -rf *
mount /dev/hdb1 /home
tar jxvpf /tmp/home.tar.bz2
-r duplicates directories recursively
-p preserves mode,ownership and timestamp
(see also: man cp) ;-)
The second consideration uses the tar command as LSD suggested, but in a slightly different way:
(cd /home-old ; tar cf - .)|(cd /home-new ; tar pxvf -)
The advantages are:
preserves *all* protection information (see also: man tar)
Symbolic links are transfered as symbolic links and not as files.
There is no real file created, so no additional diskspace is used while transfering the data.
Disadvatage: both directories must exist before the transfer.