1834275 Members
2066 Online
110066 Solutions
New Discussion

cpio command

 
SOLVED
Go to solution
bassey essien_1
Frequent Contributor

cpio command

does any know the simplest way of copying data
from old disk to new disk using cpio command. what options will facilitates copying entire directory tree from old PV to new VG.
Iam not acquainted with cpio, but i think this is what i need in other to move datas from the old PV to the new volume groups.
Thanks.
4 REPLIES 4
Maureen Gunkel
Trusted Contributor
Solution

Re: cpio command

Bassey,
I would think you would want to use -odmv, and the syntax would be:
find . -depth -print | cpio -odmv > newdisk

the o means output, d means create directories as needed, m means retain mod time, and v is verbose.

HTH
Mo
No matter where you go, there you are.
Maureen Gunkel
Trusted Contributor

Re: cpio command

Bassey,
I would think you would want to use -pdmv, and the syntax would be:
find . -depth -print | cpio -pdmv newdisk

the p means passthrough, d means create directories as needed, m means retain mod time, and v is verbose.

HTH
Mo
No matter where you go, there you are.
Dan Hetzel
Honored Contributor

Re: cpio command

Hi Bassey,

cd
find . -xdev -print | cpio -pdvum

If you want a whole filesystem to be copied, is its mount point, is the mount point of the new filesystem.

The -xdev flag will prevent find from crossing filesystem boundaries so that you could find files under / but not files under /usr, /tmp, /var, etc...

Best regards,

Dan

Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Darrel Louis
Honored Contributor

Re: cpio command

Hi,

Copy over the entire original stand directory to the /stand.tmp(new mount point)
directory.
# cd /stand
# find . -xdev -depth -print | cpio -pxdumv /stand.tmp

Good Luck