- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: copy a filesystem best solution (local host o...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2011 05:59 AM
тАО05-12-2011 05:59 AM
what is the best and safest solution to copy a filesystem
- local host: to a new mounted filesystem
- remote host: to a remote new server and new mounted filesystem
commands : "cpio", "dd" or "cp/rcp" or "tar" ?
why ? we will get a new storage system. sometimes old and new storage were connected and new storage where activated in a new vg and mounted as a new mount-point.
or sometimes we have a new server !
command "cpio" :
Local Host:
# Check, Files > 2 GB /old_fs
find /old_fs -xdev -size +2097152000c
OK:
cd /old_fs
find . ! -name lost+found -depth -print | cpio -padlmuv /new_fs
Remote Host:
RET_DIR=$( remsh server -n '(test -d /new_fs;echo $?) `
cd /old_fs
find . ! -name lost+found -depth -print | cpio -oc | remsh server "cd /new_fs; cpio -icdlumv"
Files < 2 GB will copied by "cp/rcp"
command "dd" :
Check, if filesystems have the same version and lvol has the same size
Local Host:
dd if=/dev/vgold_fs/rold_fs of=/dev/vgnew_fs/rnew_fs bs=1024k
Remote Host:
dd if=/dev/vgold_fs/rold_fs ibs=1024k | remsh server "dd of=/dev/vgnew_fs/rnew_fs obs=1024k "
note: filesystems during copy are umounted and after finish a fsck will done
is "cp/rcp" or "tar a alternative ?
regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2011 07:16 AM
тАО05-12-2011 07:16 AM
Re: copy a filesystem best solution (local host or remote host)
Looks like you've done your homework!! :)
You've got plenty of ideas for the local copy, for remote copy, I generally use this:
#!/bin/ksh
# run this script on the remote host where
# you want the copied files to go
#
# Start this script in the destination folder
RGZIP="/usr/contrib/bin/gzip -1"
LGZIP="/usr/contrib/bin/gzip -d"
remsh source_host -n \
"cd head_of_source_tree;tar cvf - . |$RGZIP" | $LGZIP |tar xvf -
...placement of the quotes is important.
If your target and source hosts are on the same subnet ( very close together ), the gzip may slow it down a bit, but if theres a bit of network between them, the gzip will help with speed.
Hth,
-klb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2011 07:24 AM
тАО05-12-2011 07:24 AM
Re: copy a filesystem best solution (local host or remote host)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2011 07:30 AM
тАО05-12-2011 07:30 AM
Re: copy a filesystem best solution (local host or remote host)
another way is using vxdump/vxrestore as follows:
vxdump 0f - ${SOURCEFS} | (cd ${DESTINFS} ; vxrestore xf -)
This is for the local system. You can use the same "remsh remote-server" construct in your original question, for copying to the remote server.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2011 11:05 AM
тАО05-12-2011 11:05 AM
Re: copy a filesystem best solution (local host or remote host)
'fbackup' is still included on 11.31.
'fbackup' is also pretty sophisticated, supporting double-buffering, and you can tweak its performance.
My technique is simlar to Mel's (note that vxdump does not support ACLs either):
*******************
For a Local copy:
*******************
# tweak some fbackup parms
# 4 blocks required for pipe into frecover (def=16) to avoid err:
# "frecover(2104): zero length read from disk file. Frecover exiting"
# 3 readers for triple buffering
## echo > /tmp/fbc '
blocksperrecord 4
readerprocesses 3
'
## (cd /tmp/bvd1/ ; fbackup -c /tmp/fbc -f - -i . -e ./lost+found ) \
| (cd /tmp/bvd2/ ; frecover -rf - )
(note that we are excluding the mountpoint lost+found dir)
*******************
For a Network copy:
*******************
# tweak some fbackup parms
# 1 block sufficient for a network copy
# 2 readers for double buffering
## echo > /tmp/fbc '
blocksperrecord 1
readerprocesses 2
'
## (cd /tmp/bvd1/ ; fbackup -c /tmp/fbc -f - -i . -e ./lost+found ) \
|(ssh pine4 \
cd /tmp/bvd2/ \; frecover -rf - )
------------------------------^^^^^
notice the backslash before the semicolon
Of course, you probably are not using ACLs, so you can use the same technique and use any backup that supports symbolic links, like even 'tar -cf -' into 'tar xf -'
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2011 12:14 PM - last edited on тАО07-06-2011 09:58 AM by Kevin_Paul
тАО05-12-2011 12:14 PM - last edited on тАО07-06-2011 09:58 AM by Kevin_Paul
Re: copy a filesystem best solution (local host or remote host)
Hi:
As usual, TIMTOWTDI. See my comments in this thread:
http://h30499.www3.hp.com/t5/System-Administration/migrating-from-lvol1-to-lvol2-onto-a-different-drive/m-p/4344245#M343952
Remember, 'fbackup/frestore' is an HP-UX only product and sadly deprecated at 11.31 at that.
Regards!
...JRF..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2011 10:48 PM
тАО05-12-2011 10:48 PM
Re: copy a filesystem best solution (local host or remote host)
I would like to thank you for posts. i good a lot of new informations and new commands. i have to test the new commands. then i will post my experiences.
@ Mel Burslan
I will have the luxury of time and taking the applications using the filesystem down !
when processes write in a filesystem and i will copy the filesystem to another filesystem,then filesystem one and filesystem new is not equal ? i must have a "exclusive" access to a filesystem for copy ?
maybe "umount" and "mount" it like "/mount_copy" ?
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2011 11:39 PM
тАО05-12-2011 11:39 PM
Re: copy a filesystem best solution (local host or remote host)
Just look at the man page and numerous docs here for ignite.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2011 02:07 AM
тАО05-13-2011 02:07 AM
Re: copy a filesystem best solution (local host or remote host)
Good catch!
Another option is:
umount /mount
mount -r /mount
for read-only mode.
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2011 02:35 AM
тАО05-13-2011 02:35 AM
Re: copy a filesystem best solution (local host or remote host)
@ for read-only mode.
good input, thx