On Sunday 14 March 2004 14:58 pm, Hylton Conacher (ZR1HPC) wrote:
I have a system with 2 HDD's, namely a 20Gb and a 7.5Gb HDD.
What I would like to do is copy an exact replica of /home and /etc and all of their contents from the 20Gb to the 7.5Gb.
What I have tried so far is to do it via Konqueror ie right click on /home, left click on copy, left click on /data4(this is the other drive), right click, left click paste. The system seems to copy all the files but I have noticed that the directory count on what files have been read and what files have been written is different. I thought this was just a quirk of the X session not being updated quick enough or that the complete replica had actually failed.
Yes, I've noticed that too... don't know what causes it. Konq doesn't preserve ownerships and permissions though :((
Not liking the 'replica failed' idea, I decided to rather try the copy process from the command line (cli).
I used the command #:cp -R -v /home /data4/home The system went crazy for a few minutes whilst it copied 1Gb of data and all seemed to work.
I have now decided NOT to use the -v switch but would like to know if there is some way I could get a progress indicator/bar in the cli? Are there any other switches which could be added to further enhance the cp? How about using the --b switch?
Try the -a switch - it's equivalent to -dpR,
What about the file permissions, as I see there are 6 files owned by root in my /home ie /lost+found?
They are files which have become orphaned or crosslinked - check out their contents as root and you'll likely find you can delete them.
I would like to copy the /home directory across with a normal user but I am worried about the root owned files in the directory. For the /etc directory I know I am going to have to use root as although the files are marked as read there is no write permission.
This doesn't affect whether you can write a new copy, only whether you can write to the existing file.
How can I get the ownership to NOT change if I do copy the /home with root? ie ownership changes ie the original user hylton is changed to root?
That's covered by cp's -p (=preserve attributes) switch. I quite often use midnight commander for these things since it gives you options and lets you select files. HTH Dylan -- "They that can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety." -Benjamin Franklin