> :
> :I recently bought a new hard drive. Of course I wanted to copy my old
> :linux system to the new drive.
> :So I tried the old trick from Running Linux tar cf - . | (cd /mnt; tar
> :xvf -) which is SUPPOSED to copy everything exactly as it was to the new
> :place.
> :
> :I did the trick doing a ctrl-z once it got to /mnt otherwise would have
> :a recursive copy. [SNIP]
> Some recent versions of 'tar' delay setting final ownership and
> permissions until the entire archive has been processed. This avoids
> some problems when files and directories in the archive have restrictive
> permissions, but it means you have to let 'tar' run to completion to get
> everything set properly. You'll need to find another way to exclude
> /mnt. You can include the name "/mnt" in a "--exclude" file or perhaps
> use the "--one-file-system" option.
> Yes it's a PITA, especially when I'm just extracting a few files from
> the beginning of a lengthy archive that really _is_ on a (slow) tape
> drive.
> --
I have a script that I run, used it many times and it preserves everything as
it should, you mount the new drive as /mnt and mount it as /mnt. After the
script is done, you can make directories /mnt/proc and /mnt/mnt, boot off a
floppy made by "dd if=<your_kernel> of=/dev/fd0H1440 bs=16k", run lilo on the
new hda, then reboot on it.
[barrabas:~]# less /usr/local/mybin/hdcopy
umask 000
(cd /; tar -cf - . --atime-preserve -p --exclude=proc --exclude=mnt) | tar -xvf
- --atime-preserve -p
umask 002
The - --atime-preserve -p is all part of the line above it.
Regards
--
... Sid Boyce...Amdahl(Europe)...44-121 422 0375
-----------------------------------
Any opinions expressed above are mine and do not necessarily represent
the opinions or policies of Amdahl Corporation.