- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Copying /home
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
Forums
Discussions
Discussions
Discussions
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
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
12-09-2005 11:42 AM
12-09-2005 11:42 AM
Copying /home
Can I restore the files from my weekend backup using Data Protector 5.5?
Do I need to create all of them over again?
Thanks for any and all help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2005 12:13 PM
12-09-2005 12:13 PM
Re: Copying /home
1. Copy the /etc/passwd file from the old server to newserver.
say copied as
/restore/pw.orig to newserver.
2. Create a script on the new server:
# cd /restore/pw.orig
# vi uadd.sc
cat /restore/pw.orig | while read line
do
USER=$(echo $line|awk '{FS=":";print $1}')
PASS=$(echo $line|awk '{FS=":";print $2}')
USERID=$(echo $line|awk '{FS=":";print $3}')
GID=$(echo $line|awk '{FS=":";print $4}')
INFO=$(echo $line|awk '{FS=":";print $5}')
HOME=$(echo $line|awk '{FS=":";print $6}')
SHELL=$(echo $line|awk '{FS=":";print $7}')
echo "Adding $USER"
useradd -u $USERID -g $GID -s $SHELL -c "$INFO" -o -m -k /etc/skel -d $HOME $USER
/usr/sam/lbin/usermod.sam -p`echo "$PASS"` $USER
done
Run the script and all the user will be created on the new server.
Username , UID , Homedir, shell, Group , password, and Gecos fileds everything will be created same as it was in old server.
3. Restore the home directory from old server to new server.
You are done.
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2005 12:18 PM
12-09-2005 12:18 PM
Re: Copying /home
1.You can restore the /home directory using Protector 5.5. from old to new server.
2. Or if size is less than 8GB , you can use tar to copy it with tape.
3. Or you can do NFS export to /home of your old server , and mount and then copy it to /home on your new server.
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2005 05:50 PM
12-09-2005 05:50 PM
Re: Copying /home
Dear Jeffrey,
#rcp -R -p host1:/
the -p option coppies the files with PERMISSIONs info, UID,GID etc.
HtH,
Siva.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2005 10:59 PM
12-09-2005 10:59 PM
Re: Copying /home
Best option for copying is duing weekend NFS mount the old system on the new one and use
find and cpio command if you need only the less files.
If you use SAN best way is to VGexport with -s -p -m create a map file and Bind LUN to the new system and vgimport. All will be fine.
..007
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2005 03:15 AM
12-10-2005 03:15 AM
Re: Copying /home
Copying /etc/passwd and /etc/group will recreate the user accouts with same UID and GIDs. Also before logging in restore backup, which will create all the directory structure under /home. Allthough you need to create home directory for user not having it under /home.
It will also change root password also to be the same as of old server. So if you do not want it to be same then after restoring files before logging out change it using passwd command.
For backup of old server there are many ways. If you can export /home and mount it on new server then then suppose you mounted /home of old server at /homeold in new server. Then do this
#pwd
/homeold
#find ./ -name "*" -print|cpio -pdmv /home
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2005 08:56 PM
12-10-2005 08:56 PM
Re: Copying /home
To copy the /home directory, ensure the filesystem size is the same as the old server then
"remsh oldserver tar cf - /home | tar xvf -". You will need to make sure the /.rhost or /etc/hosts .equiv on you oldserver knows about your new machine.