From: Kenneth P. <sh...@we...> - 2001-11-01 17:26:51
|
On Wed, 31 Oct 2001 13:53:59 -0800 (PST), Marcos Rubinstein - ALPA WWW wrote: >cp -pR /home /mypartition/ >cp -pR /var /mypartition/ > >(I'm not so sure about mv... I do know that with cp -p I >replicate the same info than the original file/dir) The way I copy trees to preserve all file properties is this: cd /home tar cvf - . | (cd /mypartition && tar xvfp -) Optionally add "z" to the tar commands for compression. This can be handy if you're doing the copy between two different hosts, and the second tar is running remotely via rsh. >after checking that all is ok with the copy: > >rm -fR /home >rm -fR /var > >ln -s /mypartition/var /home >ln -s /mypartition/home /var > >my main doubt is about rm -fR /var ... will the system allow >it (because of /var/run and /var/log)? (wouldn't be this >better done while booting as single user?... to avoid >problems with processes that could be using any of the files >in /home or /var ?) You don't need to delete the original data if you don't want. When you mount the new partition, it will hide any data in the original directory. Any processes that had files open on the original partition will continue to write to those files, not to your new partition, until they close and reopen them. For log files, you probably want to send a HUP to syslog and friends. But it *is* safer to mount new partitions while in single user mode, at least for testing. Once you know things work, put the new partitions in fstab and the startup scripts will usually mount them before other processes attempt to open files on them. Ken mailto:sh...@we... http://www.sewingwitch.com/ken/ [If answering a mailing list posting, please don't cc me your reply. I'll take my answer on the list.] |