[CentOS] Taking file from pyhsical disk to new virtual disk

Wed Oct 24 17:41:58 UTC 2007
Alain Spineux <aspineux at gmail.com>

On 10/24/07, Jerry Geis <geisj at pagestation.com> wrote:
> Hi
>
> I am playing with virtualization on centos 5.
> I have an old redhat 7 system I still need so I want to virtualize it.
> I found the old disk, installed in the virtual environment but found
> I had done some additions WAY back.
> I want to be sure my virtual system is exactly the same as the ACTUAL
> system.
>
> Do I use cpio on the actual system to grab everything and then put that
> back on the
> virtual system?

I'm more "tar" adept !
Here is the tar command :

# cd /src
# tar cf - . | ( cd /dst ; tar tvpf - )
This is just a try that display all file it will copy.
Now I copy for real
# tar cf - . | ( cd /dst ; tar xvpf - )
To copy through ssh on a remote machine
 # tar cf - . | ssh root at host "( cd /dst ; tar xvpf - )"
bu scp is fine too

To avoid copy of /proc and other anoying file system you can use
--except ./proc  --except ./sys .......
or better use -l to copy only /src and not other mounted filesystem
then you have to copy /boot and other data partition the same way.

cpio require you to use a filesysteme walker like find to generate the
list of file you wan to  copy.
Something like :
# find . | cpio ???? | (cd /dst ; cpio ??? )






>
> What would the format of the command be to grab it and extract it? I
> have never used cpio and dont
> want to screw something up.
>
> Is there a better way?
>
> Jerry
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>


-- 
Alain Spineux
aspineux gmail com
May the sources be with you