tape listing

Rick Stevens rstevens at vitalstream.com
Tue Jul 19 16:57:07 UTC 2005


ajay wrote:
>  
> 
> 
> On Mon, 18 Jul 2005 Bob McClure Jr wrote :
>  >On Mon, Jul 18, 2005 at 07:00:55AM -0000, ajay wrote:
>  > >
>  > > On Fri, 15 Jul 2005 Rick Stevens wrote :
>  > > >ajay wrote:
>  > > >>  hi gurus
>  > > >>
>  > > >>i try to list my tape hp 40gb (under compression)
>  > > >>
>  > > >>------------------------------------------------------
>  > > >>[root at tivimtech ajay]# tar vft /dev/st0
>  > > >>tar: This does not look like a tar archive
>  > > >>tar: Skipping to next header
>  > > >>tar: Archive contains obsolescent base-64 headers
>  > > >>
>  > > >>-------------------------------------------------------
>  > > >>
>  > > >>it do not list anything and gives this error and comes out.
>  > > >>is there any way i can mount it, if yes what is mount type ?
>  > > >>
>  > > >>i use this command to backup:
>  > > >>i am very sure it does backup as i checked date against backup.log
>  > > >>it changes everyday and shows latest date time as supposed.
>  > > >>
>  > > >># Daily Backup on the Dat
>  > > >>tar cvfz /dev/st0 /home /data /etc /var/spool/mail /var/www  
>  >/var/log/backup.log &
>  > > >>
>  > > >>It is scheduled in cron.
>  > > >>
>  > > >>here is some part of this log.....
>  > > >>
>  > > >>UW PICO(tm) 4.2                    File: /var/log/backup.log
>  > > >>
>  > > >>
>  > > >>home/
>  > > >>home/niteen/
>  > > >>home/niteen/.bash_history
>  > > >>home/niteen/.addressbook
>  > > >>home/niteen/.addressbook.lu
>  > > >>home/niteen/.bash_logout
>  > > >>home/niteen/.bash_profile
>  > > >>home/niteen/.bashrc
>  > > >>home/niteen/.canna
>  > > >>home/niteen/.emacs
>  > > >>home/niteen/.esd_auth
>  > > >>home/niteen/.fetchmailrc
>  > > >>home/niteen/.fonts.cache-1
>  > > >>home/niteen/.gtkrc
>  > > >>home/niteen/.gtkrc-1.2-gnome2
>  > > >>home/niteen/.ICEauthority
>  > > >>home/niteen/.mailboxlist
>  > > >>home/niteen/.pinerc
>  > > >>home/niteen/.recently-used
>  > > >>home/niteen/.rhn-applet.conf
>  > > >>home/niteen/.viminfo
>  > > >>
>  > > >>..............................
>  > > >>
>  > > >>I am confussed why it says "This does not look like a tar archive" ??
>  > > >>
>  > > >>
>  > > >>help me from this dilemma !!!
>  > > >
>  > > >Did you rewind the tape before trying to list its contents?
>  > > >
>  > > ># mt -f /dev/st0 rewind
>  > > ># tar tvf /dev/st0
>  >
>  >Actually, your device, /dev/st0, rewinds after each operation.  If you
>  >were using the non-rewinding device, /dev/nst0, you would have to
>  >rewind it in a separate command.
>  >
>  > > i wrote "mt -f /dev/st0 rewind" but it returns silent , no error 
> messg , no attempt on tape to rewind it.
>  > >
>  > > i am confused why ?
>  > >
>  > > it just comes to prompt without doing anything, no activity , no 
> message at all.
>  >
>  >That means the tape is already rewound.  If in doubt, you can issue
>  >
>  >  mt -f /dev/st0 reten
>  >
>  >and it will retension the tape by winding it all the way to the end
>  >and back again.
>  >
>  > > i checked "mt -f /dev/st0 offline" to confirm "mt" function though.
>  > > It works and tape ejects immediately .
>  > >
>  > > scratching my head why not with "rewind" option!
>  >
>  >It's working.  That's not your problem.
>  >
>  > > awaiting your reply
>  > >
>  > > thanks and regards
>  > >
>  > > ajay
>  >
>  >Cheers,
> 
> thanks now i got it and its working that is showing list .
> i have one more query.
> 
> what is the proper command to restore data?
> i issued :
> 
> tar xvfzp /dev/st0 /home/user
> 
> as i want to pick up only this particular user data , not entire tape .
> i know it is hardly 4MB , but after firing this currsor strucks there 
> and tape becomes busy "doing something" for unlimited time .

tar, by default, uses relative paths (it strips the leading "/").  Since
there's no leading "/" on the data, it can't find your stuff.  The
correct way to do this is to "cd" to the parent directory of "home" (in
your case, you want to restore stuff in /home, so "cd /"), then enter
the command "tar xvzpf /dev/st0 home/user".

If you want to backup whole paths, you MUST use the "P" option when
creating the tar archive, "tar cvpPf /dev/st0 /home/user".

> nothing comes out of tape even half and hour after.
> 
> i will be thankful for your suggestion.
> 
> also tell how can i also preserve ownership of data?
> and can i use a file containing folder/file enteries inspite of defining 
> individual folders name with tar command. if yes what is that file 
> format and how to fit it in tar command ?

Ajay, have you read the man page for tar ("man tar") yet?  All of the
information you want is in there.  The lower case "-p" preserves
permissions, "--same-owner" preserves ownership, "--preserve" does
both.  The "-T filename" causes it to read the data to back up or
restore from "filename".
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
- Life:  That which happens while you search for the remote control. -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list