Operating System - HP-UX
1752796 Members
5609 Online
108789 Solutions
New Discussion юеВ

HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

 
SOLVED
Go to solution
Raj D.
Honored Contributor

HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

Hi All ,

Can any one tell me , how to backup files system to another filesystem , using (1) fbackup or (2)dd or (3)tar command.

I have two file system

/data1 size 1GB used=800MB
/data2 size 1GB used=0MB.

can i copy all files and dirs of /data1 filesystem , to /data2 filesystem using fbackup or dd. both are vxfs filesystem.

I beleive this will be faster and accurate than cp command.
Thanks in advance.

Raj. D.
--------
" If u think u can , If u think u cannot , - You are always Right . "
12 REPLIES 12
Jeff_Traigle
Honored Contributor

Re: HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

This should do the trick...

(cd /data1; tar cf - .) | (cd /data2; tar xvf -)
--
Jeff Traigle
Robert-Jan Goossens
Honored Contributor

Re: HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

Hi,

You can use cpio.

# find /data1 | cpio -pcmudv /data2

Regards,
Robert-Jan
Ps, to gain extra speed remove the -v option.
Pete Randall
Outstanding Contributor

Re: HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

Any of those methods should work, some maybe better than others. My personal approach is to run "find /data1 -print |cpio -pdumxl /data2".


Pete

Pete
Fabio Ettore
Honored Contributor
Solution

Re: HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

Hi,

it is not needed fbackup filesystem, just copy it!

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=611082

Check thread above, it has a lot of suggestions about that.
My one was:

# cd /data1
# find . -xdev -print | cpio -pdmvux /data2

I suggest you to compare two directories at the end:

# diff /data1 /data2


HTH.

Best regards,
Ettore
WISH? IMPROVEMENT!
Raj D.
Honored Contributor

Re: HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

Thanks ,

Jeff , Robert , Pete & Etore , and who all replied. The Problem solved , with , solution of :

1] Jeff & 2] Ettore .

The command given by robert is creating one more directory called data1 under /data2

i.e
Robert:
# find /data1 | cpio -pcmudv /data2

Pete:
# find /data1 -print | cpio -pdumxl /data2

creates one more directory.
i.e /data2/data1/....under /.

This two works fine.
of Jeff and Etorre ,

Thanks to all .
--------------
Raj. D.
-------
" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

Hi All ,

This command i have tried and found good result.

# umount /data2
# dd if=/dev/vg01/data1 of=/dev/vg01/data2
# fsck /dev/vg01/data2
# mount -F /dev/vg01/data2 /data2

# diff /data1 /data2

Found OK.

Thanks to all who replied ,

Raj.D
" If u think u can , If u think u cannot , - You are always Right . "
Victor Fridyev
Honored Contributor

Re: HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

Hi,

I use this method as well, just take into account that it's good only if logical volumes size is equal.
PS. It's better to use /dev/vgxx/rlvol and not lvol. You can change bs in dd command in order to accelerate the process.

HTH
Entities are not to be multiplied beyond necessity - RTFM
Raj D.
Honored Contributor

Re: HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

Thanks Victor..

But Whats the Block size to be used , to accelarate the dd operation.
is it bs=64 . ?


Raj. D.
" If u think u can , If u think u cannot , - You are always Right . "
Bernhard Mueller
Honored Contributor

Re: HP-UX 11.00 FileSystem Copy with fabackup or dd or tar.

Raj,

although cpio passthrough copying, as recommended by others, is the most common method, in terms of performance for copying an entire filesystem you can hardly beat dd (you found out yourself).

The only things to be aware of are:
target rlvol must be the same size or larger than the source rlvol.
(if larger, you simply run extendfs on the target rlvol after the copy is done and before mounting it)

Blocksize should be between 256k and 4096k.
Whether this actually makes a difference, is hard to tell because it depends on the system configuration. I found 256k suitable for most situations.

Especially if you have filesystems with tens or hundreds of thousands of files the dd method will save you *hours* compared to cpio.

Regards,
Bernhard