- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- tar restore
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
06-23-2004 06:01 AM
06-23-2004 06:01 AM
I'm trying to restore the /usr directory from tape using tar but I want to restore it to a different directory. Could someone tell me the command to extract the /usr directory from tape to my /dumps directory.
Thanks,
Eric
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:04 AM
06-23-2004 06:04 AM
Re: tar restore
If it was done like:
# tar -cvf /dev/rmt/?mn /usr
Then you'll need to use pax and do some name substitution to do what you want. 'man pax' for more information.
If it was done like:
# tar -cvf /dev/rmt/?mn ./usr
or
# tar -cvf /dev/rmt/?mn usr
Then just do:
# cd /dumps
# tar -xvf /dev/rmt/?mn usr
or
# tar -xvf /dev/rmt/?mn ./usr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:04 AM
06-23-2004 06:04 AM
Re: tar restore
GNU tar can take care of this. Get gnu tar and check if you can do that.
The crude method would be as follows.
cd /dumps
pax -rv -s '/^\///' < /dev/rmt/0m
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:07 AM
06-23-2004 06:07 AM
Re: tar restore
PAX is the way to go.
# mt -f /dev/rmt/0mn fsf 1
# cd /mnt
# pax -rvf /dev/rmt/0mn -s '|^\/|\./|'
Sundar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:10 AM
06-23-2004 06:10 AM
Re: tar restore
cd /dumps
tar -xvf /dev/rmt/0m
My screen showed it extracting but when I looked in the /dumps directory I didn't see anything so I killed the process.
It was tar'd by this command
tar -cvf /dev/rmt/0m /usr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:11 AM
06-23-2004 06:11 AM
Re: tar restore
mt -f /dev/rmt/0mn fsf 1
No points for this please.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:12 AM
06-23-2004 06:12 AM
Re: tar restore
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:12 AM
06-23-2004 06:12 AM
Re: tar restore
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:13 AM
06-23-2004 06:13 AM
Re: tar restore
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:20 AM
06-23-2004 06:20 AM
Re: tar restore
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:22 AM
06-23-2004 06:22 AM
Re: tar restore
You took it as tar -cvf /dev/rmt/0m /usr
You should have done tar -cvf /dev/rmt/0m ./usr OR usr
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:26 AM
06-23-2004 06:26 AM
SolutionYes, your tar command effectively extracted the contents to /usr file system.
With tar,if you create the archive with absolute path, tar -xvf will always restore the contents to the absolute path. You will have to use pax or GNU tar.
Here, since you created the archive using the absolute path (tar -cvf /dev/rmt/0m /usr), tar -xvf will always restore the files to /usr.
How recent was the archive ? What prompted the need for restoring /usr file system from the tape ? were there any signification changes to the system after the archive was created (like installation of sw/patches etc).
-- Sundar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:37 AM
06-23-2004 06:37 AM
Re: tar restore
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2004 06:51 AM
06-23-2004 06:51 AM