Re: [vox-tech] HD xfer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vox-tech] HD xfer
On Sat, Aug 11, 2001 at 02:53:25AM -0700, Foo Lim wrote:
> # [cdrom's root] cp -ax /mnt/old-disk-part1 /mnt/new-disk-part1
>
> 2. Would the -x option also copy the stuff in /proc?
cp -ax /oldroot /newroot would copy /oldroot ONLY, ie no other
filesystems, not /proc/, not /home (if home were it's on fs), etc.
cp -ax /oldroot/* /newroot would copy /, /proc, /home, etc. (obvious, I
know)
> 3. What was the bug in the tar method? Also, what was the tar method?
The tar method usually fails to properly set ownership on symlinks.
tar -clvpf - /oldroot | ( cd /newroot; tar -xvpf - )
-l = one file system
-p = preserve permissions & ownership (except for symlinks).
> 4. Any other caveats I should know about before I begin?
Nothing too major, just go slow and make sure you mind your directory
structures... ( dirname/, dirname/*, etc).
If you "copy half way" anything, you might want to look at rsync to 'fix
up' stuff. cp -u isn't a good idea because it only looks at file
times, not sizes or contents. rsync is much slower than a raw copy
(relatively speaking) when doing local copies.
rsync -avxrP --delete /oldroot /newroot (try without --delete if you're
unsure you've got your directory structures right).
-a archive (perms, ownership, modtimes)
-v verbose
-x one file system
-r recursive
-P progress status (percent complete counts)
--delete remove entries from target that don't exist in source
After a file system copy, your 'du' counts will be off, as will 'df'
(especially if you've changed block sizes). A 'find /oldroot -xdev | wc
-l' compared against a 'find /newroot -xdev | wc -l' is a good way to be
sure you got things "mostly right" without doing exhaustive checks.
Good luck!
--
Ted Deppner
http://www.psyber.com/~ted/
|