Operating System - HP-UX
1837524 Members
3954 Online
110117 Solutions
New Discussion

Moving files between logical Volumes

 
SOLVED
Go to solution
Peter Klausner_1
Frequent Advisor

Moving files between logical Volumes

Hi,

yesterday i wanted to move the content of a "normal" Logical Volume to a volume with distributed extents.

I created a new directory and mounted the new logical volume on the new directory.

Then i went in to the original directory and used

find . | cpio -pdumv /new_directory to move the content.

Here I get an error concerning socket files.

Socket not backed up

I know that socket files are used for inter process communication. But i don't know if the
are created only temporary so the error isn't critical.
If the error is critical, which is command shall i use to move them.

Who can helps ?

Thanks in advance
6 REPLIES 6
Steven Sim Kok Leong
Honored Contributor

Re: Moving files between logical Volumes

Hi,

Try using the x option ie.

cpio -pdumvx

Extracted from the man page of cpio for your convenience:

x Save or restore device special files. Since mknod() is used to recreate these files on a restore, -ix and -px can be used only by users with appropriate privileges (see mknod(2)). This option is intended for intrasystem (backup) use only. Restoring device files from previous versions of the OS, or from different systems can be very dangerous. cpio may prevent the restoration of certain device files from the archive.

Hope this helps. Regards.

Steven Sim Kok Leong
Justo Exposito
Esteemed Contributor

Re: Moving files between logical Volumes

Hi,

Try this:
find . | cpio -pudlmv /destination_dir

or this:
tar -cvf tarfile /opt

then

tar -xvf tarfile

Regards,

Justo.
Help is a Beatiful word
Joseph C. Denman
Honored Contributor

Re: Moving files between logical Volumes

Peter,

I have to agree with Steven, try with the x option.

find . | cpio -pdmuxvl /newdir

...jcd...
If I had only read the instructions first??
Helen French
Honored Contributor
Solution

Re: Moving files between logical Volumes

Hi Peter,

Normally the socket files are created by calling socket() with a socket type of AF_UNIX. That means whenever an application creates those sockets a socket file will be created. There is no need, therefore, to backup these files.

Normally this command will copy all files from a file system to another:

# find . -depth | cpio -pdlmuva /dest_dir

HTH,
Shiju
Life is a promise, fulfill it!
Stefan Farrelly
Honored Contributor

Re: Moving files between logical Volumes


Why are you using cpio to copy when the only true complete image copy method is to dd the raw logical volumes ?? Then you create an exact bit-for-bit copy from old to new.

dd if=/dev/vg/rlvol of=/dev/vg/rlvol bs=1024k

All you need to do is ensure the 2 lvols are the exact same size in extents. This is also the fastest way to copy one lvol to another.
Im from Palmerston North, New Zealand, but somehow ended up in London...
David Totsch
Valued Contributor

Re: Moving files between logical Volumes

Peter:

Now that you know why the cpio failed, let
me ask "why" you used cpio. First of all,
cpio does not deal with device files, sockets
(like you experienced), ACLs, largefiles, etc.,
very well.

If you have MirroDisk/UX, how about this
process:

1) create your new LV (complete with extent-
based stripes [NOT LVM stripes, because you
cannot mirror them]) making sure it is exactly the same size as the LV you want a copy of.
You will want to avoid using disks the existing
LV is on.

2) lvmerge the new and old LVs together (taking
great care that the old LV is copied into the
new LV).

3) once the LV is synced, use lvreduce to
de-allocate the old distribution mirror.

4) celebrate (because you completely avoided
going off-line to make sure your copy is clean
and worrying about your copy missing something).

-dlt-