- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Tar Command....
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
тАО07-27-2001 09:37 AM
тАО07-27-2001 09:37 AM
I have a tape with an unknow tar file, so I want to extract it on the machine, but when I extract the tar file, the files in it try to be restored on the / filesystem, something that I don't want... What I want is to extract what's in the tar file into the /tmp directory for example... What I want to know is what is the tar command that will permit me to extract the file on my tape under another filesystem???
Thanks
Jonathan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2001 09:50 AM
тАО07-27-2001 09:50 AM
Re: Tar Command....
Tar would restore the way it was abcked up supose you have give
tar cvf /etc/* then files will be stored in that path like
/etc/xxx
/etc/YYYY
so whenever you have to restore it back , it restores using the same path .Where as if you have backed it up by going into /etc and then using
tar cv * then it will just store the file name.
The way around to restore with PATH is to clear the directory in question , move it to some other place ,and then restore the tape.
Slightly cumbersome but it should work.
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2001 10:17 AM
тАО07-27-2001 10:17 AM
Re: Tar Command....
you may apply the following command :
tar -tf /dev/rmt/#m
this command lists only the names of files from the tape without any extraction of the files it selfs.
if The first character from these files id
/
then the backup on that tape is done with the absolute path ( which start referincing from the root directory "/") and there is no manner to restaure it to another place. The only place is it's real place.
Workaround :
As siad before, remove the directory that it will be overwrite with the content of the restaure to some where else ( saved directory) and
resture your backup and then manually remove the saved directory to it's original place.
Magdi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2001 10:18 AM
тАО07-27-2001 10:18 AM
Re: Tar Command....
you make me think to something.. I've made symbolic link to another filesystem... :)
so it solved my probleme!!! :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2001 10:39 AM
тАО07-27-2001 10:39 AM
Re: Tar Command....
1. Use pax and the -s option. The man page shows an example of how to restore /usr files on tape to the current working directory.
2. Use chroot (change root directory) to change the / directory to someplace local and now all files will be recovered relative to the new (but temporary) root filesystem.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2001 11:48 AM
тАО07-27-2001 11:48 AM
Solution1. cd to a directory which would have enough space to extract the file. Lets call it "/extract" for arguments sake.
2. make a directory under this called "bin" and give it permissions so that you can access it's files.
I.E.
# mkdir /extract/bin
# chmod 755 /extract/bin
3. Next copy "tar" to this directory. This is important because the chrooted environment needs any binaries and libs you will need to access while chrooted.
# cp -p /sbin/tar /extract/bin
NOTE: nothing in /sbin is dynamically linked, so it is safe!
4. chroot and issue the tar command
I.E.
dd if=/dev/rmt/0m | chroot /extract /bin/tar xvf -
NOTE the full path given for tar!!!!!!
This should fix your problems!
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2001 12:00 PM
тАО07-27-2001 12:00 PM
Re: Tar Command....
The basic sintaxe to extract file in tar format is :
tar -xvf /dev/rmt/0
When it will be restore depends :
1) your actual position ( directory ).
2) if the tape was write with relative path,
for example, I am in /home and run
"#tar -cvf /dev/rmt/0 . " , you can restore
the files to any filesystem, but if the tape
was the write without relative path, for
example, "#tar -cvf /dev/rmt/0 /home " then
you can only restore the files to the
original filesystem, in this case /home.
3) You can list the tape "tar -tvf /dev/rmt/0"
and to verify how it writed.
I think this help !
Regards,
Abel Berger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-27-2001 12:58 PM
тАО07-27-2001 12:58 PM
Re: Tar Command....
Regards,
Abel Berger