Dylan wrote:
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 :(( So I noticed when I tried to open one of the backed up files using my normal user. A bit of a pain that you can't retain the ownerships using Konq!
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, Will do. I see that the -p switch preserves the ownership, according to the man pages, so I'll see.
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. OK. Why does the fs create crosslinked and orphaned files? Are these types of files similar to Windows .tmp or \~ files?
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. such a minor subtlety...aaarrrggghhhhh. But thanks for clearing me up on that.
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. mmm, tried my mc and all I got was the rough mc screen with little blocks all over it, the same ones Microsoft Word uses when it can't display a font or symbol. Think I'll therefore have to stick to the cli and the -a switch.
-- The Little Helper ======================================================================== Hylton Conacher - Licenced ex-Windows user (apart from Quicken) Registered Linux user # 229959 at http://counter.li.org Currently using SuSE 9.0 Professional with KDE 3.1 ========================================================================